group.vue 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <template>
  2. <view class="content">
  3. <!-- 自定义导航 -->
  4. <view class="zdyNavBox">
  5. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  6. <view class="zdyNav">
  7. <view class="zdyNavLeft">
  8. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">车型件</view>
  12. <view v-if="carPeizhi.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
  13. <view v-else style="width: 50rpx;"></view>
  14. </view>
  15. </view>
  16. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  17. <view style="height: 44px;"></view>
  18. <view class="top">
  19. <view class="topCont">
  20. <view class="carBox">
  21. <image src="../../static/img/nocar.png" mode="" class="carLogo"></image>
  22. <view class="carTxt">{{brand_name}}</view>
  23. <!-- <image src="../../static/img/jt.png" mode="" class="carJt"></image> -->
  24. </view>
  25. <view class="vinBox">
  26. <view class="vinBox2">
  27. <view class="vinB">VIN</view>
  28. <view class="vinNum">{{vin}}</view>
  29. </view>
  30. <!-- <view v-if="carPeizhi.length != 0" class="vinBox2">
  31. <view class="detail" @click="goCarDetail()">车型详情</view>
  32. <image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
  33. </view> -->
  34. </view>
  35. </view>
  36. </view>
  37. <!--车辆配置 -->
  38. <view class="mainBox" v-if="restrainShow">
  39. <view class="maintitle">{{caption}}</view>
  40. <view class="mainLine" v-for="(item,index) in restrains" @click="restrainsClick(item)">
  41. <view class="lineName">{{item.combine_cp}}</view>
  42. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  43. </view>
  44. </view>
  45. <!-- 总组 -->
  46. <view class="mainBox" v-if="groupShow">
  47. <view class="maintitle">{{caption}}</view>
  48. <view class="mainLine" v-for="(item,index) in zlist" @click="goTwo(item)">
  49. <view class="lineName">{{item.caption}}</view>
  50. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  51. </view>
  52. </view>
  53. </view>
  54. </template>
  55. <script>
  56. export default {
  57. data() {
  58. return {
  59. vin: '',
  60. iStatusBarHeight: '',
  61. restrains: '',
  62. zlist: '',
  63. brand_name: '',
  64. brand_id: '',
  65. access_time: '',
  66. zzTime: '',
  67. caption: '',
  68. restrainShow: false,
  69. groupShow: false,
  70. param: '',
  71. token: '',
  72. epc_id: '',
  73. carPeizhi: ''
  74. }
  75. },
  76. onLoad(opt) {
  77. this.vin = opt.vin
  78. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  79. this.getData()
  80. },
  81. methods: {
  82. getData() {
  83. uni.showLoading({
  84. title: '加载中'
  85. });
  86. this.$http('advancedEpc/getVinGroup', {
  87. vin: this.vin,
  88. }, 'GET').then(res => {
  89. uni.hideLoading();
  90. //console.log(res.data.number);
  91. if (res.data.number == 200 || res.data.number == 5212) {
  92. this.brand_name = res.data.result.brand_name;
  93. this.brand_id = res.data.result.brand_id;
  94. this.access_time = res.data.result.access_time;
  95. this.caption = res.data.result.caption
  96. this.epc_id = res.data.result.epc_id;
  97. if (res.data.result.restrains.length > 0) {
  98. this.restrains = res.data.result.restrains;
  99. this.restrainShow = true;
  100. } else {
  101. this.zzTime = res.data.result.access_time;
  102. this.zlist = res.data.result.list;
  103. this.restrainShow = false;
  104. this.groupShow = true;
  105. }
  106. } else {
  107. uni.showToast({
  108. title: res.data.message,
  109. icon: 'none',
  110. duration: 3000
  111. });
  112. }
  113. });
  114. },
  115. restrainsClick(item) {
  116. this.param = item.param;
  117. this.token = item.token;
  118. this.carPeizhi = item.combine_cp;
  119. this.getcarVinGroup()
  120. },
  121. getcarVinGroup() {
  122. uni.showLoading({
  123. title: '加载中'
  124. });
  125. this.$http('advancedEpc/getVinGroup', {
  126. vin: this.vin,
  127. access_time: this.access_time,
  128. param: this.param,
  129. token: this.token
  130. }, 'GET').then(res => {
  131. uni.hideLoading();
  132. //console.log(res.data.number);
  133. if (res.data.number == 200 || res.data.number == 5212) {
  134. this.brand_name = res.data.result.brand_name;
  135. this.access_time = res.data.result.access_time;
  136. this.caption = res.data.result.caption
  137. if (res.data.result.restrains.length > 0) {
  138. this.restrains = res.data.result.restrains;
  139. this.restrainShow = true;
  140. } else {
  141. this.zzTime = res.data.result.access_time;
  142. this.zlist = res.data.result.list;
  143. this.restrainShow = false;
  144. this.groupShow = true;
  145. }
  146. } else {
  147. uni.showToast({
  148. title: res.data.message,
  149. icon: 'none',
  150. duration: 3000
  151. });
  152. }
  153. });
  154. },
  155. goCarDetail() {
  156. uni.navigateTo({
  157. url: 'CarDetail?model_id=' + this.brand_id
  158. })
  159. },
  160. goOemSearch() {
  161. uni.navigateTo({
  162. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id
  163. })
  164. },
  165. goback() {
  166. console.log('返回');
  167. uni.navigateBack({})
  168. },
  169. goTwo(item) {
  170. uni.navigateTo({
  171. url: 'modelTwo?vin=' + this.vin + '&zzTime=' + this.zzTime + '&param=' + item.param +
  172. '&token=' + item.token + '&epc_id=' + this.epc_id
  173. })
  174. }
  175. }
  176. }
  177. </script>
  178. <style scoped>
  179. .content {
  180. background: #F4F5F7;
  181. min-height: 100vh;
  182. padding-bottom: constant(safe-area-inset-bottom);
  183. padding-bottom: env(safe-area-inset-bottom);
  184. }
  185. .zdyNavBox {
  186. width: 100vw;
  187. background: #FFFFFF;
  188. position: fixed;
  189. top: 0;
  190. left: 0;
  191. z-index: 9999999;
  192. }
  193. .zdyNav {
  194. height: 44px;
  195. display: flex;
  196. justify-content: space-between;
  197. align-items: center;
  198. }
  199. .backImg {
  200. width: 44rpx;
  201. height: 44rpx;
  202. margin-left: 10rpx;
  203. margin-right: 20rpx;
  204. }
  205. .homeImg {
  206. width: 44rpx;
  207. height: 44rpx;
  208. }
  209. .zdyNavLeft {
  210. display: flex;
  211. align-items: center;
  212. }
  213. .zdyNavTitle {
  214. height: 44px;
  215. background: #FFFFFF;
  216. text-align: center;
  217. font-size: 34rpx;
  218. line-height: 44px;
  219. }
  220. .zdyNavRight {
  221. height: 44px;
  222. background: #FFFFFF;
  223. text-align: center;
  224. font-size: 28rpx;
  225. line-height: 44px;
  226. color: #3F90F7;
  227. margin-right: 24rpx;
  228. }
  229. .top {
  230. padding: 20rpx 0;
  231. }
  232. .topCont {
  233. width: 750rpx;
  234. height: 185rpx;
  235. background: #FFFFFF;
  236. }
  237. .carLogo {
  238. width: 72rpx;
  239. height: 72rpx;
  240. }
  241. .carTxt {
  242. font-size: 28rpx;
  243. font-family: PingFangSC-Medium, PingFang SC;
  244. font-weight: 500;
  245. color: #333333;
  246. line-height: 36rpx;
  247. width: 606rpx;
  248. }
  249. .carJt {
  250. width: 25rpx;
  251. height: 24rpx;
  252. margin-top: 6rpx;
  253. }
  254. .carBox {
  255. display: flex;
  256. justify-content: space-between;
  257. padding: 30rpx 24rpx 24rpx 24rpx;
  258. }
  259. .vinBox {
  260. display: flex;
  261. justify-content: space-between;
  262. padding-left: 120rpx;
  263. padding-right: 24rpx;
  264. }
  265. .vinBox2 {
  266. display: flex;
  267. align-items: center;
  268. }
  269. .detail {
  270. color: #3F90F7;
  271. font-size: 24rpx;
  272. margin-right: 10rpx;
  273. }
  274. .vinB {
  275. background: #F19D01;
  276. width: 60rpx;
  277. height: 30rpx;
  278. text-align: center;
  279. line-height: 30rpx;
  280. color: #FFFFFF;
  281. font-size: 22rpx;
  282. border-radius: 5rpx;
  283. }
  284. .vinNum {
  285. color: #999999;
  286. font-size: 24rpx;
  287. line-height: 30rpx;
  288. padding-left: 10rpx;
  289. }
  290. .mainBox {
  291. background: #FFFFFF;
  292. }
  293. .maintitle {
  294. font-size: 28rpx;
  295. font-family: PingFangSC-Medium, PingFang SC;
  296. font-weight: 500;
  297. color: #333333;
  298. text-align: center;
  299. line-height: 88rpx;
  300. border-bottom: 1px solid #EEEEEE;
  301. }
  302. .mainLineJt {
  303. width: 25rpx;
  304. height: 24rpx;
  305. margin-top: 8rpx;
  306. }
  307. .mainLine {
  308. display: flex;
  309. justify-content: space-between;
  310. border-bottom: 1px solid #EEEEEE;
  311. padding: 24rpx;
  312. }
  313. .lineName {
  314. font-size: 28rpx;
  315. font-family: PingFangSC-Regular, PingFang SC;
  316. font-weight: 400;
  317. color: #333333;
  318. line-height: 40rpx;
  319. }
  320. </style>