carType.vue 5.3 KB

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