carType.vue 5.1 KB

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