SelectCarTwo.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <template>
  2. <view class="box">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
  8. style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
  9. <view class="zdyNavTitle">车型</view>
  10. <view class="zdyNavRight" @click="goOemSearch">OEM搜索</view>
  11. </view>
  12. </view>
  13. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  14. <view style="height: 44px;"></view>
  15. <view class="top">{{title}}</view>
  16. <!-- 车型 -->
  17. <view v-if="carModelShow" class="cangBox">
  18. <view v-for="(item,index) in xingList" :key="index">
  19. <view class="cangTitle">{{item.fct_name}}</view>
  20. <view @click="goNext(item2)" class="xingBox" v-for="(item2,index) in item.models" :key="index">
  21. <view class="xing">{{item2.model_name}}</view>
  22. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  23. </view>
  24. </view>
  25. </view>
  26. <!-- 年份 -->
  27. <view v-if="yearShow" class="cangBox">
  28. <view @click="goNext2(item)" class="xingBox" v-for="(item,index) in yearList">
  29. <view class="xing">{{item.year}}</view>
  30. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  31. </view>
  32. </view>
  33. <!-- 型号 -->
  34. <view v-if="xinghaoShow" class="cangBox">
  35. <view @click="goVinDetail(item)" class="workBox2" v-for="(item,index) in xinghaoList" :key="index">
  36. <view class="leftBox">
  37. <view class="oneBox">
  38. <view class="comtent2">
  39. <view class="left2" style="width: 28%;">变速器:</view>
  40. <view class="right2">{{item.trans}}</view>
  41. </view>
  42. <view class="comtent2">
  43. <view class="left2">车型:</view>
  44. <view class="right2">{{item.model}}</view>
  45. </view>
  46. </view>
  47. <view class="oneBox">
  48. <view class="comtent2">
  49. <view class="left2">级别:</view>
  50. <view class="right2">{{item.grade}}</view>
  51. </view>
  52. <view class="comtent2">
  53. <view class="left2" style="width: 35%;">发动机号:</view>
  54. <view class="right2">{{item.engine}}</view>
  55. </view>
  56. </view>
  57. <view class="oneBox">
  58. <view class="comtent2">
  59. <view class="left2">装配:</view>
  60. <view class="right2">{{item.equip}}</view>
  61. </view>
  62. </view>
  63. <view class="oneBox">
  64. <view class="comtent2">
  65. <view class="left2" style="width: 35%;">模型代码:</view>
  66. <view class="right2">{{item.mdcode}}</view>
  67. </view>
  68. </view>
  69. </view>
  70. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  71. </view>
  72. </view>
  73. </view>
  74. </template>
  75. <script>
  76. export default {
  77. data() {
  78. return {
  79. epc_id: '',
  80. title: '',
  81. iStatusBarHeight: '',
  82. searchValue: '',
  83. xingList: [],
  84. access_time: '',
  85. yearList: [],
  86. yearShow: false,
  87. carModelShow: false,
  88. xinghaoShow: false,
  89. xinghaoList: [],
  90. }
  91. },
  92. onLoad(opt) {
  93. console.log('opt', opt);
  94. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  95. this.epc_id = opt.epc_id;
  96. this.title = opt.title;
  97. this.getItemData();
  98. },
  99. methods: {
  100. goNext(item) {
  101. if (item.next_restrain == 1) {
  102. this.title += ' > ' + item.model_name;
  103. this.getYueSuData(item)
  104. }
  105. },
  106. goNext2(item) {
  107. if (item.next_restrain == 1) {
  108. this.title += ' > ' + item.year;
  109. this.getYueSuData(item)
  110. }
  111. },
  112. //获取车型约束列表
  113. getYueSuData(item) {
  114. let that = this
  115. uni.showLoading({
  116. title: '加载中'
  117. });
  118. this.$http('advancedEpc/getRestrain', {
  119. epc_id: this.epc_id,
  120. token: item.token,
  121. param: item.param,
  122. access_time: this.access_time,
  123. // page: this.page
  124. }, 'GET').then(res => {
  125. uni.hideLoading();
  126. if (res.data.result.caption == '年份') {
  127. that.carModelShow = false;
  128. that.yearShow = true;
  129. that.yearList = res.data.result.list;
  130. that.access_time = res.data.result.access_time;
  131. }
  132. if (res.data.result.next_level.caption == '总组') {
  133. that.title += ' > ' + res.data.result.caption;
  134. that.carModelShow = false;
  135. that.yearShow = false;
  136. that.xinghaoShow = true;
  137. that.xinghaoList = res.data.result.list;
  138. that.access_time = res.data.result.access_time;
  139. }
  140. });
  141. },
  142. //获取车型
  143. getItemData() {
  144. let that = this
  145. uni.showLoading({
  146. title: '加载中'
  147. });
  148. this.$http('advancedEpc/getModel', {
  149. epc_id: this.epc_id,
  150. // token: this.token,
  151. // param: this.param,
  152. // access_time: this.access_time,
  153. // page: this.page
  154. }, 'GET').then(res => {
  155. uni.hideLoading();
  156. if (res.data.result.caption == '车型') {
  157. that.xingList = res.data.result.list;
  158. that.access_time = res.data.result.access_time;
  159. that.carModelShow = true;
  160. }
  161. });
  162. },
  163. goVinDetail() {
  164. uni.navigateTo({
  165. url: 'VinDetail'
  166. })
  167. },
  168. goOemSearch() {
  169. uni.navigateTo({
  170. url: 'OemSearch'
  171. })
  172. },
  173. goback() {
  174. console.log('返回');
  175. this.carModelShow = true;
  176. this.yearShow = false;
  177. // uni.navigateBack({})
  178. },
  179. }
  180. }
  181. </script>
  182. <style>
  183. .box {
  184. min-height: 100vh;
  185. background: #ffffff;
  186. padding-bottom: constant(safe-area-inset-bottom);
  187. padding-bottom: env(safe-area-inset-bottom);
  188. }
  189. .zdyNavBox {
  190. width: 100vw;
  191. background: #FFFFFF;
  192. position: fixed;
  193. top: 0;
  194. left: 0;
  195. z-index: 9999999;
  196. }
  197. .zdyNav {
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: center;
  201. padding: 14rpx 6rpx;
  202. }
  203. .zdyNavTitle {
  204. background: #FFFFFF;
  205. text-align: center;
  206. font-size: 32rpx;
  207. font-weight: bold;
  208. }
  209. .zdyNavRight {
  210. background: #FFFFFF;
  211. text-align: center;
  212. font-size: 28rpx;
  213. color: #3F90F7;
  214. width: 120rpx;
  215. }
  216. .top {
  217. color: #FFFFFF;
  218. font-size: 28rpx;
  219. padding: 24rpx;
  220. background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
  221. }
  222. .cangBox {
  223. background: #FFFFFF;
  224. }
  225. .cangTitle {
  226. padding: 10rpx 24rpx;
  227. background: #F4F5F7;
  228. color: #333333;
  229. font-size: 28rpx;
  230. }
  231. .xingBox {
  232. font-size: 28rpx;
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. padding: 24rpx;
  237. border-bottom: 1rpx solid #eeeeee;
  238. }
  239. .oneBox {
  240. display: flex;
  241. justify-content: space-between;
  242. align-items: baseline;
  243. font-size: 26rpx;
  244. padding-bottom: 20rpx;
  245. }
  246. .comtent2 {
  247. display: flex;
  248. align-items: baseline;
  249. font-size: 26rpx;
  250. width: 50%;
  251. }
  252. .workBox2 {
  253. background: #FFFFFF;
  254. border-bottom: 1rpx solid #EEEEEE;
  255. padding: 20rpx 24rpx 0rpx;
  256. display: flex;
  257. align-items: center;
  258. }
  259. .leftBox {
  260. width: calc(100vw - 20rpx);
  261. }
  262. .rightBox {
  263. width: 20rpx;
  264. }
  265. .left2 {
  266. width: 20%;
  267. color: #999999;
  268. white-space: nowrap;
  269. }
  270. .right2 {
  271. width: 80%;
  272. color: #333333;
  273. margin-right: 20rpx;
  274. }
  275. </style>