SelectCarTwo.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  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="gogroup(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. modelname:'',
  91. }
  92. },
  93. onLoad(opt) {
  94. console.log('opt', opt);
  95. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  96. this.epc_id = opt.epc_id;
  97. this.title = opt.title;
  98. this.getItemData();
  99. },
  100. methods: {
  101. goNext(item) {
  102. if (item.next_restrain == 1) {
  103. this.title += ' > ' + item.model_name;
  104. this.modelname=item.model_name
  105. this.getYueSuData(item)
  106. }
  107. },
  108. goNext2(item) {
  109. if (item.next_restrain == 1) {
  110. this.title += ' > ' + item.year;
  111. this.getYueSuData(item)
  112. }
  113. },
  114. //获取车型约束列表
  115. getYueSuData(item) {
  116. let that = this
  117. uni.showLoading({
  118. title: '加载中'
  119. });
  120. this.$http('advancedEpc/getRestrain', {
  121. epc_id: this.epc_id,
  122. token: item.token,
  123. param: item.param,
  124. access_time: this.access_time,
  125. // page: this.page
  126. }, 'GET').then(res => {
  127. uni.hideLoading();
  128. if (res.data.result.caption == '年份') {
  129. that.carModelShow = false;
  130. that.yearShow = true;
  131. that.yearList = res.data.result.list;
  132. that.access_time = res.data.result.access_time;
  133. }
  134. if (res.data.result.next_level.caption == '总组') {
  135. that.title += ' > ' + res.data.result.caption;
  136. that.carModelShow = false;
  137. that.yearShow = false;
  138. that.xinghaoShow = true;
  139. that.xinghaoList = res.data.result.list;
  140. that.access_time = res.data.result.access_time;
  141. }
  142. });
  143. },
  144. //获取车型
  145. getItemData() {
  146. let that = this
  147. uni.showLoading({
  148. title: '加载中'
  149. });
  150. this.$http('advancedEpc/getModel', {
  151. epc_id: this.epc_id,
  152. // token: this.token,
  153. // param: this.param,
  154. // access_time: this.access_time,
  155. // page: this.page
  156. }, 'GET').then(res => {
  157. uni.hideLoading();
  158. if (res.data.result.caption == '车型') {
  159. that.xingList = res.data.result.list;
  160. that.access_time = res.data.result.access_time;
  161. that.carModelShow = true;
  162. }
  163. });
  164. },
  165. gogroup(item) {
  166. uni.navigateTo({
  167. url: 'group?type=2&token='+item.token+'&param='+item.param+'&access_time='+this.access_time+'&epc_id='+this.epc_id+'&modelname='+this.modelname
  168. })
  169. },
  170. goOemSearch() {
  171. uni.navigateTo({
  172. url: 'OemSearch'
  173. })
  174. },
  175. goback() {
  176. console.log('返回');
  177. this.carModelShow = true;
  178. this.yearShow = false;
  179. // uni.navigateBack({})
  180. },
  181. }
  182. }
  183. </script>
  184. <style>
  185. .box {
  186. min-height: 100vh;
  187. background: #ffffff;
  188. padding-bottom: constant(safe-area-inset-bottom);
  189. padding-bottom: env(safe-area-inset-bottom);
  190. }
  191. .zdyNavBox {
  192. width: 100vw;
  193. background: #FFFFFF;
  194. position: fixed;
  195. top: 0;
  196. left: 0;
  197. z-index: 9999999;
  198. }
  199. .zdyNav {
  200. display: flex;
  201. justify-content: space-between;
  202. align-items: center;
  203. padding: 14rpx 6rpx;
  204. }
  205. .zdyNavTitle {
  206. background: #FFFFFF;
  207. text-align: center;
  208. font-size: 32rpx;
  209. font-weight: bold;
  210. }
  211. .zdyNavRight {
  212. background: #FFFFFF;
  213. text-align: center;
  214. font-size: 28rpx;
  215. color: #3F90F7;
  216. width: 120rpx;
  217. }
  218. .top {
  219. color: #FFFFFF;
  220. font-size: 28rpx;
  221. padding: 24rpx;
  222. background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
  223. }
  224. .cangBox {
  225. background: #FFFFFF;
  226. }
  227. .cangTitle {
  228. padding: 10rpx 24rpx;
  229. background: #F4F5F7;
  230. color: #333333;
  231. font-size: 28rpx;
  232. }
  233. .xingBox {
  234. font-size: 28rpx;
  235. display: flex;
  236. justify-content: space-between;
  237. align-items: center;
  238. padding: 24rpx;
  239. border-bottom: 1rpx solid #eeeeee;
  240. }
  241. .oneBox {
  242. display: flex;
  243. justify-content: space-between;
  244. align-items: baseline;
  245. font-size: 26rpx;
  246. padding-bottom: 20rpx;
  247. }
  248. .comtent2 {
  249. display: flex;
  250. align-items: baseline;
  251. font-size: 26rpx;
  252. width: 50%;
  253. }
  254. .workBox2 {
  255. background: #FFFFFF;
  256. border-bottom: 1rpx solid #EEEEEE;
  257. padding: 20rpx 24rpx 0rpx;
  258. display: flex;
  259. align-items: center;
  260. }
  261. .leftBox {
  262. width: calc(100vw - 20rpx);
  263. }
  264. .rightBox {
  265. width: 20rpx;
  266. }
  267. .left2 {
  268. width: 20%;
  269. color: #999999;
  270. white-space: nowrap;
  271. }
  272. .right2 {
  273. width: 80%;
  274. color: #333333;
  275. margin-right: 20rpx;
  276. }
  277. </style>