carType.vue 5.3 KB

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