group.vue 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  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="param.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="chexingMesList.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. chexingMesList:[],
  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. this.token = res.data.result.list[0].token;
  106. this.param = res.data.result.list[0].param;
  107. }
  108. if (Object.keys(res.data.result.vehicle).length != 0) {
  109. this.chexingMesList = res.data.result.vehicle.tree
  110. }
  111. } else {
  112. uni.showToast({
  113. title: res.data.message,
  114. icon: 'none',
  115. duration: 3000
  116. });
  117. }
  118. });
  119. },
  120. restrainsClick(item) {
  121. this.param = item.param;
  122. this.token = item.token;
  123. this.getcarVinGroup()
  124. },
  125. getcarVinGroup() {
  126. uni.showLoading({
  127. title: '加载中'
  128. });
  129. this.$http('advancedEpc/getVinGroup', {
  130. vin: this.vin,
  131. access_time: this.access_time,
  132. param: this.param,
  133. token: this.token
  134. }, 'GET').then(res => {
  135. uni.hideLoading();
  136. //console.log(res.data.number);
  137. if (res.data.number == 200 || res.data.number == 5212) {
  138. this.brand_name = res.data.result.brand_name;
  139. this.access_time = res.data.result.access_time;
  140. this.caption = res.data.result.caption
  141. if (res.data.result.restrains.length > 0) {
  142. this.restrains = res.data.result.restrains;
  143. this.restrainShow = true;
  144. this.token = res.data.result.restrains[0].token;
  145. this.param = res.data.result.restrains[0].param;
  146. } else {
  147. this.token = res.data.result.list[0].token;
  148. this.param = res.data.result.list[0].param;
  149. this.zzTime = res.data.result.access_time;
  150. this.zlist = res.data.result.list;
  151. this.restrainShow = false;
  152. this.groupShow = true;
  153. }
  154. if (Object.keys(res.data.result.vehicle).length != 0) {
  155. this.chexingMesList = res.data.result.vehicle.tree
  156. }
  157. } else {
  158. uni.showToast({
  159. title: res.data.message,
  160. icon: 'none',
  161. duration: 3000
  162. });
  163. }
  164. });
  165. },
  166. goCarDetail() {
  167. var that = this;
  168. uni.setStorage({
  169. key: 'chexingMesList',
  170. data: that.chexingMesList,
  171. success: function() {
  172. uni.navigateTo({
  173. url: 'CarDetail'
  174. })
  175. }
  176. });
  177. },
  178. goOemSearch() {
  179. uni.navigateTo({
  180. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&vin=' + this.vin + '&param=' + this.param +
  181. '&token=' + this.token + '&access_time=' + this.access_time
  182. })
  183. },
  184. goback() {
  185. console.log('返回');
  186. uni.navigateBack({})
  187. },
  188. goTwo(item) {
  189. uni.navigateTo({
  190. url: 'modelTwo?vin=' + this.vin + '&zzTime=' + this.zzTime + '&param=' + item.param +
  191. '&token=' + item.token + '&epc_id=' + this.epc_id
  192. })
  193. }
  194. }
  195. }
  196. </script>
  197. <style scoped>
  198. .content {
  199. background: #F4F5F7;
  200. min-height: 100vh;
  201. padding-bottom: constant(safe-area-inset-bottom);
  202. padding-bottom: env(safe-area-inset-bottom);
  203. }
  204. .zdyNavBox {
  205. width: 100vw;
  206. background: #FFFFFF;
  207. position: fixed;
  208. top: 0;
  209. left: 0;
  210. z-index: 9999999;
  211. }
  212. .zdyNav {
  213. height: 44px;
  214. display: flex;
  215. justify-content: space-between;
  216. align-items: center;
  217. }
  218. .backImg {
  219. width: 44rpx;
  220. height: 44rpx;
  221. margin-left: 10rpx;
  222. margin-right: 20rpx;
  223. }
  224. .homeImg {
  225. width: 44rpx;
  226. height: 44rpx;
  227. }
  228. .zdyNavLeft {
  229. display: flex;
  230. align-items: center;
  231. }
  232. .zdyNavTitle {
  233. height: 44px;
  234. background: #FFFFFF;
  235. text-align: center;
  236. font-size: 34rpx;
  237. line-height: 44px;
  238. }
  239. .zdyNavRight {
  240. height: 44px;
  241. background: #FFFFFF;
  242. text-align: center;
  243. font-size: 28rpx;
  244. line-height: 44px;
  245. color: #3F90F7;
  246. margin-right: 24rpx;
  247. }
  248. .top {
  249. padding: 20rpx 0;
  250. }
  251. .topCont {
  252. width: 750rpx;
  253. height: 185rpx;
  254. background: #FFFFFF;
  255. }
  256. .carLogo {
  257. width: 72rpx;
  258. height: 72rpx;
  259. }
  260. .carTxt {
  261. font-size: 28rpx;
  262. font-family: PingFangSC-Medium, PingFang SC;
  263. font-weight: 500;
  264. color: #333333;
  265. line-height: 36rpx;
  266. width: 606rpx;
  267. }
  268. .carJt {
  269. width: 25rpx;
  270. height: 24rpx;
  271. margin-top: 6rpx;
  272. }
  273. .carBox {
  274. display: flex;
  275. justify-content: space-between;
  276. padding: 30rpx 24rpx 24rpx 24rpx;
  277. }
  278. .vinBox {
  279. display: flex;
  280. justify-content: space-between;
  281. padding-left: 120rpx;
  282. padding-right: 24rpx;
  283. }
  284. .vinBox2 {
  285. display: flex;
  286. align-items: center;
  287. }
  288. .detail {
  289. color: #3F90F7;
  290. font-size: 24rpx;
  291. margin-right: 10rpx;
  292. }
  293. .vinB {
  294. background: #F19D01;
  295. width: 60rpx;
  296. height: 30rpx;
  297. text-align: center;
  298. line-height: 30rpx;
  299. color: #FFFFFF;
  300. font-size: 22rpx;
  301. border-radius: 5rpx;
  302. }
  303. .vinNum {
  304. color: #999999;
  305. font-size: 24rpx;
  306. line-height: 30rpx;
  307. padding-left: 10rpx;
  308. }
  309. .mainBox {
  310. background: #FFFFFF;
  311. }
  312. .maintitle {
  313. font-size: 28rpx;
  314. font-family: PingFangSC-Medium, PingFang SC;
  315. font-weight: 500;
  316. color: #333333;
  317. text-align: center;
  318. line-height: 88rpx;
  319. border-bottom: 1px solid #EEEEEE;
  320. }
  321. .mainLineJt {
  322. width: 25rpx;
  323. height: 24rpx;
  324. margin-top: 8rpx;
  325. }
  326. .mainLine {
  327. display: flex;
  328. justify-content: space-between;
  329. border-bottom: 1px solid #EEEEEE;
  330. padding: 24rpx;
  331. }
  332. .lineName {
  333. font-size: 28rpx;
  334. font-family: PingFangSC-Regular, PingFang SC;
  335. font-weight: 400;
  336. color: #333333;
  337. line-height: 40rpx;
  338. }
  339. </style>