carType.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  1. <template>
  2. <view class="page">
  3. <!-- 公共组件-每个页面必须引入 -->
  4. <view class="box">
  5. <view class="row " v-for="(item,index) in typeList" :key="index" @tap="chooseVehicleType(index)">
  6. <!-- 永安 -->
  7. <view class="row_header dis a-c j-s">
  8. <view class="left">{{item.modelName }}</view>
  9. <view class="right">¥{{item.replacementValue}}</view>
  10. </view>
  11. <view class="row_body dis f-c">
  12. <view class="dis j-s">
  13. <view style="margin-right: 5px;">车系:{{item.series}}</view>
  14. <view>{{item.remark}}</view>
  15. <view style="margin-left: auto;">({{item.ratedPassengerCapacity}}座)</view>
  16. </view>
  17. <view class="dis j-s">
  18. <view>年款:<text style="color: #2432ff;">{{item.marketYear}}</text></view>
  19. <view>排量:<text style="color: #2432ff;">{{item.displacement}}</text></view>
  20. <view>功率:<text style="color: #2432ff;">{{item.powerScale}}</text></view>
  21. </view>
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import {
  29. mapState,
  30. mapMutations
  31. } from "vuex"
  32. export default {
  33. data() {
  34. return {
  35. frameNo: "", //车架号
  36. modelName: "", //车型
  37. enrollDate: "", //
  38. typeList: [{
  39. modelName: "大众汽车SVW71612CS轿车",
  40. replacementValue: "779000",
  41. series: "桑塔纳自动档 ",
  42. remark: "豪华版国IV",
  43. marketYear: "200000",
  44. displacement: "1.5858",
  45. ratedPassengerCapacity: "32322",
  46. }],
  47. }
  48. },
  49. async onLoad(options) {
  50. if (options.frameNo) {
  51. this.frameNo = decodeURIComponent(options.frameNo);
  52. let res = await this.$http.get('/order/carModel/vinSearch?frameNo=' + this.frameNo);
  53. this.typeList = res.data;
  54. } else if (options.modelName) {
  55. this.modelName = decodeURIComponent(options.modelName);
  56. let params = {
  57. modelName: this.modelName
  58. }
  59. let res = await this.$http.post('/order/zhongMeiApi/modelsQuery', params);
  60. this.typeList = res.data;
  61. }
  62. },
  63. computed: {
  64. getHeight() {
  65. let height = uni.getSystemInfoSync().windowHeight;
  66. return `height: ${height}px;`;
  67. }
  68. },
  69. methods: {
  70. async queryList(pageNo, pageSize) {
  71. // if (!!this.brandName) {
  72. // /* 永安 */
  73. // let param = {
  74. // // "rows": pageSize,
  75. // // "pageNo": pageNo,
  76. // "modelName": this.brandName,
  77. // // "enrollDate": this.enrollDate,
  78. // // "frameNo": this.frameNo,
  79. // }
  80. // let res = await this.$http.post('/insZhongmei/modelQuery', param);
  81. // let resList = [];
  82. // if (!!res.data) {
  83. // resList = res.data;
  84. // }
  85. // this.$refs.paging.complete(res.data);
  86. // this.firstLoaded = true;
  87. // } else if (!!this.frameNo) {
  88. // let res = await this.$http.get('/insZhongmei/vinSearch?frameNo=' + this.frameNo);
  89. // let resList = [];
  90. // if (!!res.data) {
  91. // resList = res.data;
  92. // }
  93. // this.$refs.paging.complete(res.data);
  94. // this.firstLoaded = true;
  95. // }
  96. },
  97. chooseVehicleType(index) {
  98. let pages = getCurrentPages(); //获取所有页面栈实例列表
  99. let nowPage = pages[pages.length - 1]; //当前页页面实例
  100. let prevPage = pages[pages.length - 2]; //上一页页面实例
  101. prevPage.$vm.carInfo.brandName = this.typeList[index].brandCN; //车型
  102. prevPage.$vm.carInfo.modelcname = this.typeList[index].modelName; //车型
  103. prevPage.$vm.carInfo.caryear = this.typeList[index].marketYear; //年款
  104. prevPage.$vm.carInfo.seatCount = this.typeList[index].ratedPassengerCapacity; //座位数
  105. prevPage.$vm.carInfo.purchasePrice = this.typeList[index].replacementValue; //价格
  106. prevPage.$vm.carInfo.modelCode = this.typeList[index].modelCode; //车辆型号编码
  107. prevPage.$vm.carInfo.familyName = this.typeList[index].series; //系列
  108. prevPage.$vm.carInfo.enginedesc = this.typeList[index].displacement; //排量
  109. prevPage.$vm.carInfo.powertype = this.typeList[index].fuelType; //燃油种类
  110. prevPage.$vm.carInfo.powerScale = this.typeList[index].powerScale; //功率
  111. uni.navigateBack({ //uni.navigateTo跳转的返回,默认1为返回上一级
  112. delta: 1
  113. });
  114. }
  115. }
  116. }
  117. </script>
  118. <style lang="scss" scoped>
  119. .page {
  120. min-height: 100vh;
  121. background: #F8FAFE;
  122. padding: 16px 16px 150px 16px;
  123. }
  124. .row {
  125. width: 100%;
  126. height: auto;
  127. background: #FFFFFF;
  128. box-shadow: 0px 4px 10px 0px #DAE3F4;
  129. border-radius: 12px;
  130. border-bottom: 1px solid #f2f2f2;
  131. padding: 0 10px;
  132. margin-bottom: 10px;
  133. .row_header {
  134. width: 100%;
  135. font-size: 28upx;
  136. border-bottom: 1upx solid #EEEEEE;
  137. padding: 5px 0;
  138. font-weight: bold;
  139. }
  140. .row_body {
  141. width: 100%;
  142. padding: 10px 0;
  143. view {
  144. font-weight: bold;
  145. font-size: 12px;
  146. }
  147. }
  148. }
  149. .row .row_header .left {
  150. flex: 5;
  151. overflow: hidden;
  152. text-overflow: ellipsis;
  153. white-space: nowrap;
  154. color: #333;
  155. }
  156. .row .row_header .right {
  157. flex: 2;
  158. color: #FF5600;
  159. text-align: right;
  160. }
  161. .row .row .row_body view>view {
  162. margin: 0 5px;
  163. }
  164. /* 底部的样式Start */
  165. .bottom {
  166. height: 120upx;
  167. position: fixed;
  168. bottom: 0;
  169. left: 0;
  170. right: 0;
  171. background: #FFFFFF;
  172. border-top: 1upx solid #EEEEEE;
  173. z-index: 99;
  174. }
  175. .bottom>button {
  176. font-size: 30upx;
  177. background: #337ab7;
  178. color: #FFFFFF;
  179. flex: 1;
  180. margin: 0upx 30upx;
  181. }
  182. /* 底部的样式End */
  183. </style>