SelectCarTwo.vue 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  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. brand_id:'',
  55. imageicon:'',
  56. }
  57. },
  58. onLoad(opt) {
  59. console.log('opt', opt);
  60. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  61. this.epc_id = opt.epc_id;
  62. this.brand_name = opt.brand_name;
  63. this.title = opt.brand_name;
  64. this.modelname = opt.brand_name;
  65. this.brand_id = opt.brand_id;
  66. this.imageicon = opt.imageicon
  67. this.getItemData();
  68. },
  69. methods: {
  70. goNext(item) {
  71. this.token = item.token;
  72. this.param = item.param;
  73. if (item.next_restrain == 1) {
  74. this.title += ' > ' + item.model_name;
  75. this.modelname += ' ' + item.model_name;
  76. this.getYueSuData(item)
  77. }
  78. else{
  79. this.gogroup(item);
  80. }
  81. },
  82. goNext2(item) {
  83. this.token = item.token;
  84. this.param = item.param;
  85. this.modelname += ' ' + item.combine_cp;
  86. if (item.next_restrain == 1) {
  87. this.title += ' > ' + item.combine_cp;
  88. this.getYueSuData(item)
  89. }
  90. else{
  91. this.gogroup(item);
  92. }
  93. },
  94. //获取车型约束列表
  95. getYueSuData(item) {
  96. uni.showLoading({
  97. title: '加载中'
  98. });
  99. this.$http('advancedEpc/getRestrain', {
  100. epc_id: this.epc_id,
  101. token: this.token,
  102. param: this.param,
  103. access_time: this.access_time,
  104. }, 'GET').then(res => {
  105. uni.hideLoading();
  106. this.carModelShow = false;
  107. this.peizhiShow = true;
  108. this.peizhiList = res.data.result.list;
  109. this.access_time = res.data.result.access_time;
  110. });
  111. },
  112. //获取车型
  113. getItemData() {
  114. uni.showLoading({
  115. title: '加载中'
  116. });
  117. this.$http('advancedEpc/getModel', {
  118. epc_id: this.epc_id,
  119. }, 'GET').then(res => {
  120. uni.hideLoading();
  121. this.xingList = res.data.result.list;
  122. this.access_time = res.data.result.access_time;
  123. this.carModelShow = true;
  124. this.token = res.data.result.list[0].models[0].token;
  125. this.param = res.data.result.list[0].models[0].param;
  126. });
  127. },
  128. gogroup(item) {
  129. console.log(item);
  130. uni.navigateTo({
  131. url: 'group?type=2&token='+item.token+'&param='+item.param+'&access_time='+this.access_time+'&epc_id='+this.epc_id
  132. +'&modelname='+this.modelname+'&brand_id='+this.brand_id+'&imageicon='+this.imageicon+"&caption="+item.caption
  133. })
  134. },
  135. goOemSearch() {
  136. uni.navigateTo({
  137. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&param=' + this.param +
  138. '&token=' + this.token + '&access_time=' + this.access_time
  139. })
  140. },
  141. goback() {
  142. console.log('返回');
  143. uni.navigateBack({})
  144. },
  145. }
  146. }
  147. </script>
  148. <style>
  149. .box {
  150. min-height: 100vh;
  151. background: #ffffff;
  152. padding-bottom: constant(safe-area-inset-bottom);
  153. padding-bottom: env(safe-area-inset-bottom);
  154. }
  155. .zdyNavBox {
  156. width: 100vw;
  157. background: #FFFFFF;
  158. position: fixed;
  159. top: 0;
  160. left: 0;
  161. z-index: 9999999;
  162. }
  163. .zdyNav {
  164. display: flex;
  165. justify-content: space-between;
  166. align-items: center;
  167. padding: 14rpx 6rpx;
  168. }
  169. .zdyNavLeft{
  170. width: 120rpx;
  171. }
  172. .zdyNavTitle {
  173. background: #FFFFFF;
  174. text-align: center;
  175. font-size: 32rpx;
  176. font-weight: bold;
  177. }
  178. .zdyNavRight {
  179. background: #FFFFFF;
  180. text-align: center;
  181. font-size: 28rpx;
  182. color: #3F90F7;
  183. width: 120rpx;
  184. }
  185. .top {
  186. color: #FFFFFF;
  187. font-size: 28rpx;
  188. padding: 24rpx;
  189. background: linear-gradient(110deg, #48B9F9 0%, #3F90F7 100%);
  190. }
  191. .cangBox {
  192. background: #FFFFFF;
  193. }
  194. .cangTitle {
  195. padding: 10rpx 24rpx;
  196. background: #F4F5F7;
  197. color: #333333;
  198. font-size: 28rpx;
  199. text-align: center;
  200. font-weight: bold;
  201. }
  202. .xingBox {
  203. font-size: 28rpx;
  204. display: flex;
  205. justify-content: space-between;
  206. align-items: center;
  207. padding: 24rpx;
  208. border-bottom: 1rpx solid #eeeeee;
  209. }
  210. </style>