SelectCarTwo.vue 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  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. <view class="zdyNavLeft">
  8. <div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
  9. style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
  10. </view>
  11. <view class="zdyNavTitle">车型</view>
  12. <view class="zdyNavRight" @click="goOemSearch">OEM搜索</view>
  13. </view>
  14. </view>
  15. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  16. <view style="height: 44px;"></view>
  17. <view class="top">{{title}}</view>
  18. <!-- 车型 -->
  19. <view v-if="carModelShow" class="cangBox">
  20. <view v-for="(item,index) in xingList" :key="index">
  21. <view class="cangTitle">{{item.fct_name}}</view>
  22. <view @click="$noMultipleClicks(goNext,item2)" class="xingBox" v-for="(item2,index) in item.models" :key="index">
  23. <view class="xing">{{item2.model_name}}</view>
  24. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  25. </view>
  26. </view>
  27. </view>
  28. <!-- 配置 -->
  29. <view v-if="peizhiShow" class="cangBox">
  30. <view @click="goNext2(item)" class="xingBox" v-for="(item,index) in peizhiList">
  31. <view class="xing">{{item.combine_cp}}</view>
  32. <image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  33. </view>
  34. </view>
  35. </view>
  36. </template>
  37. <script>
  38. export default {
  39. data() {
  40. return {
  41. epc_id: '',
  42. brand_name:'',
  43. title: '',
  44. iStatusBarHeight: '',
  45. access_time: '',
  46. token:'',
  47. param:'',
  48. carModelShow:false,
  49. peizhiShow:false,
  50. xingList: [],
  51. peizhiList:[],
  52. modelname:'',
  53. noClick:true,
  54. }
  55. },
  56. onLoad(opt) {
  57. console.log('opt', opt);
  58. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  59. this.epc_id = opt.epc_id;
  60. this.brand_name = opt.brand_name;
  61. this.title = opt.brand_name;
  62. this.modelname = opt.brand_name;
  63. this.getItemData();
  64. },
  65. methods: {
  66. goNext(item) {
  67. this.token = item.token;
  68. this.param = item.param;
  69. if (item.next_restrain == 1) {
  70. this.title += ' > ' + item.model_name;
  71. this.modelname += ' ' + item.model_name;
  72. this.getYueSuData(item)
  73. }
  74. else{
  75. this.gogroup(item);
  76. }
  77. },
  78. goNext2(item) {
  79. this.token = item.token;
  80. this.param = item.param;
  81. this.modelname += ' ' + item.combine_cp;
  82. if (item.next_restrain == 1) {
  83. this.title += ' > ' + item.combine_cp;
  84. this.getYueSuData(item)
  85. }
  86. else{
  87. this.gogroup(item);
  88. }
  89. },
  90. //获取车型约束列表
  91. getYueSuData(item) {
  92. uni.showLoading({
  93. title: '加载中'
  94. });
  95. this.$http('advancedEpc/getRestrain', {
  96. epc_id: this.epc_id,
  97. token: this.token,
  98. param: this.param,
  99. access_time: this.access_time,
  100. }, 'GET').then(res => {
  101. uni.hideLoading();
  102. this.carModelShow = false;
  103. this.peizhiShow = true;
  104. this.peizhiList = res.data.result.list;
  105. this.access_time = res.data.result.access_time;
  106. });
  107. },
  108. //获取车型
  109. getItemData() {
  110. uni.showLoading({
  111. title: '加载中'
  112. });
  113. this.$http('advancedEpc/getModel', {
  114. epc_id: this.epc_id,
  115. }, 'GET').then(res => {
  116. uni.hideLoading();
  117. this.xingList = res.data.result.list;
  118. this.access_time = res.data.result.access_time;
  119. this.carModelShow = true;
  120. this.token = res.data.result.list[0].models[0].token;
  121. this.param = res.data.result.list[0].models[0].param;
  122. });
  123. },
  124. gogroup(item) {
  125. uni.navigateTo({
  126. url: 'group?type=2&token='+item.token+'&param='+item.param+'&access_time='+this.access_time+'&epc_id='+this.epc_id+'&modelname='+this.modelname
  127. })
  128. },
  129. goOemSearch() {
  130. uni.navigateTo({
  131. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&param=' + this.param +
  132. '&token=' + this.token + '&access_time=' + this.access_time
  133. })
  134. },
  135. goback() {
  136. console.log('返回');
  137. uni.navigateBack({})
  138. },
  139. }
  140. }
  141. </script>
  142. <style>
  143. .box {
  144. min-height: 100vh;
  145. background: #ffffff;
  146. padding-bottom: constant(safe-area-inset-bottom);
  147. padding-bottom: env(safe-area-inset-bottom);
  148. }
  149. .zdyNavBox {
  150. width: 100vw;
  151. background: #FFFFFF;
  152. position: fixed;
  153. top: 0;
  154. left: 0;
  155. z-index: 9999999;
  156. }
  157. .zdyNav {
  158. display: flex;
  159. justify-content: space-between;
  160. align-items: center;
  161. padding: 14rpx 6rpx;
  162. }
  163. .zdyNavLeft{
  164. width: 120rpx;
  165. }
  166. .zdyNavTitle {
  167. background: #FFFFFF;
  168. text-align: center;
  169. font-size: 32rpx;
  170. font-weight: bold;
  171. }
  172. .zdyNavRight {
  173. background: #FFFFFF;
  174. text-align: center;
  175. font-size: 28rpx;
  176. color: #3F90F7;
  177. width: 120rpx;
  178. }
  179. .top {
  180. color: #FFFFFF;
  181. font-size: 28rpx;
  182. padding: 24rpx;
  183. background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
  184. }
  185. .cangBox {
  186. background: #FFFFFF;
  187. }
  188. .cangTitle {
  189. padding: 10rpx 24rpx;
  190. background: #F4F5F7;
  191. color: #333333;
  192. font-size: 28rpx;
  193. text-align: center;
  194. font-weight: bold;
  195. }
  196. .xingBox {
  197. font-size: 28rpx;
  198. display: flex;
  199. justify-content: space-between;
  200. align-items: center;
  201. padding: 24rpx;
  202. border-bottom: 1rpx solid #eeeeee;
  203. }
  204. </style>