group.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459
  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. <div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon" style="color: rgb(0, 0, 0); font-size: 27px; width: 120rpx;"></i></div>
  8. <view class="zdyNavTitle">车型件</view>
  9. <view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
  10. <view v-else style="width: 120rpx;"></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">
  16. <view class="topCont">
  17. <view class="carBox">
  18. <!-- <image src="../../static/img/nocar.png" mode="" class="carLogo"></image> -->
  19. <view class="carTxt" v-if="!description">{{brand_name}}</view>
  20. <view class="carTxt" v-if="description">{{description}}</view>
  21. <!-- <image src="../../static/img/jt.png" mode="" class="carJt"></image> -->
  22. </view>
  23. <view class="vinBox">
  24. <view class="vinBox2">
  25. <view class="vinB">VIN</view>
  26. <view class="vinNum">{{vin}}</view>
  27. </view>
  28. <view v-if="chexingMesList.length != 0" class="vinBox2">
  29. <view class="detail" @click="goCarDetail()">车型详情</view>
  30. <image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <!--车辆配置 -->
  36. <view class="mainBox" v-if="restrainShow">
  37. <view class="maintitle">{{caption}}</view>
  38. <view class="mainLine" v-for="(item,index) in restrains" @click="restrainsClick(item)">
  39. <view class="lineName">{{item.combine_cp}}</view>
  40. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  41. </view>
  42. </view>
  43. <!-- 总组 -->
  44. <view class="mainBox" v-if="groupShow">
  45. <view class="maintitle">{{caption}}</view>
  46. <view class="mainLine" v-for="(item,index) in zlist" @click="goTwo(item)">
  47. <view class="lineName">{{item.caption}}</view>
  48. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. export default {
  55. data() {
  56. return {
  57. vin: '',
  58. iStatusBarHeight: '',
  59. restrains: '',
  60. zlist: '',
  61. brand_name: '',
  62. brand_id: '',
  63. access_time: '',
  64. zzTime: '',
  65. caption: '',
  66. restrainShow: false,
  67. groupShow: false,
  68. param: '',
  69. token: '',
  70. epc_id: '',
  71. chexingMesList:[],
  72. chexing:'',
  73. description:'',
  74. type:'',
  75. }
  76. },
  77. onLoad(opt) {
  78. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  79. if(opt.type==2){
  80. this.type=2
  81. this.token=opt.token;
  82. this.param=opt.param;
  83. this.access_time=opt.access_time;
  84. this.epc_id=opt.epc_id;
  85. this.description=opt.modelname;
  86. //车型点选
  87. this.getModelGroup()
  88. }else{
  89. this.vin = opt.vin
  90. this.getData()
  91. }
  92. },
  93. methods: {
  94. getModelGroup(){
  95. uni.showLoading({
  96. title: '加载中'
  97. });
  98. this.$http('advancedEpc/getModelGroup', {
  99. token: this.token,
  100. param: this.param,
  101. epc_id:this.epc_id,
  102. access_time:this.access_time
  103. }, 'GET').then(res => {
  104. uni.hideLoading();
  105. //console.log(res.data.number);
  106. if (res.data.number == 200 || res.data.number == 5212) {
  107. this.brand_name = res.data.result.brand_name;
  108. this.brand_id = res.data.result.brand_id;
  109. this.access_time = res.data.result.access_time;
  110. this.caption = res.data.result.caption
  111. this.epc_id = res.data.result.epc_id;
  112. if (res.data.result.restrains.length > 0) {
  113. this.restrains = res.data.result.restrains;
  114. this.restrainShow = true;
  115. } else {
  116. this.zzTime = res.data.result.access_time;
  117. this.zlist = res.data.result.list;
  118. this.restrainShow = false;
  119. this.groupShow = true;
  120. this.token = res.data.result.list[0].token;
  121. this.param = res.data.result.list[0].param;
  122. if(res.data.result.vehicle.description){
  123. this.description=res.data.result.vehicle.description
  124. }
  125. }
  126. if (Object.keys(res.data.result.vehicle).length != 0) {
  127. this.chexingMesList = res.data.result.vehicle.tree;
  128. this.chexing = res.data.result.vehicle.description;
  129. }
  130. } else {
  131. uni.showToast({
  132. title: res.data.message,
  133. icon: 'none',
  134. duration: 3000
  135. });
  136. }
  137. });
  138. },
  139. getData() {
  140. uni.showLoading({
  141. title: '加载中'
  142. });
  143. this.$http('advancedEpc/getVinGroup', {
  144. vin: this.vin,
  145. }, 'GET').then(res => {
  146. uni.hideLoading();
  147. //console.log(res.data.number);
  148. if (res.data.number == 200 || res.data.number == 5212) {
  149. this.brand_name = res.data.result.brand_name;
  150. this.brand_id = res.data.result.brand_id;
  151. this.access_time = res.data.result.access_time;
  152. this.caption = res.data.result.caption
  153. this.epc_id = res.data.result.epc_id;
  154. if (res.data.result.restrains.length > 0) {
  155. this.restrains = res.data.result.restrains;
  156. this.restrainShow = true;
  157. } else {
  158. this.zzTime = res.data.result.access_time;
  159. this.zlist = res.data.result.list;
  160. this.restrainShow = false;
  161. this.groupShow = true;
  162. this.token = res.data.result.list[0].token;
  163. this.param = res.data.result.list[0].param;
  164. if(res.data.result.vehicle.description){
  165. this.description=res.data.result.vehicle.description
  166. }
  167. }
  168. if (Object.keys(res.data.result.vehicle).length != 0) {
  169. this.chexingMesList = res.data.result.vehicle.tree;
  170. this.chexing = res.data.result.vehicle.description;
  171. }
  172. } else {
  173. uni.showToast({
  174. title: res.data.message,
  175. icon: 'none',
  176. duration: 3000
  177. });
  178. }
  179. });
  180. },
  181. restrainsClick(item) {
  182. this.param = item.param;
  183. this.token = item.token;
  184. this.getcarVinGroup()
  185. },
  186. getcarVinGroup() {
  187. uni.showLoading({
  188. title: '加载中'
  189. });
  190. this.$http('advancedEpc/getVinGroup', {
  191. vin: this.vin,
  192. access_time: this.access_time,
  193. param: this.param,
  194. token: this.token
  195. }, 'GET').then(res => {
  196. uni.hideLoading();
  197. //console.log(res.data.number);
  198. if (res.data.number == 200 || res.data.number == 5212) {
  199. this.brand_name = res.data.result.brand_name;
  200. this.access_time = res.data.result.access_time;
  201. this.caption = res.data.result.caption
  202. if (res.data.result.restrains.length > 0) {
  203. this.restrains = res.data.result.restrains;
  204. this.restrainShow = true;
  205. this.token = res.data.result.restrains[0].token;
  206. this.param = res.data.result.restrains[0].param;
  207. } else {
  208. this.token = res.data.result.list[0].token;
  209. this.param = res.data.result.list[0].param;
  210. this.zzTime = res.data.result.access_time;
  211. this.zlist = res.data.result.list;
  212. this.restrainShow = false;
  213. this.groupShow = true;
  214. if(res.data.result.vehicle.description){
  215. this.description=res.data.result.vehicle.description
  216. }
  217. }
  218. if (Object.keys(res.data.result.vehicle).length != 0) {
  219. this.chexingMesList = res.data.result.vehicle.tree;
  220. this.chexing = res.data.result.vehicle.description;
  221. }
  222. } else {
  223. uni.showToast({
  224. title: res.data.message,
  225. icon: 'none',
  226. duration: 3000
  227. });
  228. }
  229. });
  230. },
  231. goCarDetail() {
  232. var that = this;
  233. uni.setStorage({
  234. key: 'chexing',
  235. data: that.chexing,
  236. success: function() {
  237. uni.setStorage({
  238. key: 'chexingMesList',
  239. data: that.chexingMesList,
  240. success: function() {
  241. uni.navigateTo({
  242. url: 'CarDetail'
  243. })
  244. }
  245. });
  246. }
  247. });
  248. },
  249. goOemSearch() {
  250. uni.navigateTo({
  251. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&vin=' + this.vin + '&param=' + this.param +
  252. '&token=' + this.token + '&access_time=' + this.access_time
  253. })
  254. },
  255. goback() {
  256. console.log('返回');
  257. uni.navigateBack({})
  258. },
  259. goTwo(item) {
  260. var that = this;
  261. uni.setStorage({
  262. key: 'chexing',
  263. data: that.chexing,
  264. success: function() {
  265. uni.setStorage({
  266. key: 'chexingMesList',
  267. data: that.chexingMesList,
  268. success: function() {
  269. uni.navigateTo({
  270. url: 'modelTwo?vin=' + that.vin + '&zzTime=' + that.zzTime + '&param=' + item.param +
  271. '&token=' + item.token + '&epc_id=' + that.epc_id+'&description='+that.description
  272. })
  273. }
  274. });
  275. }
  276. });
  277. }
  278. }
  279. }
  280. </script>
  281. <style scoped>
  282. .content {
  283. background: #F4F5F7;
  284. min-height: 100vh;
  285. padding-bottom: constant(safe-area-inset-bottom);
  286. padding-bottom: env(safe-area-inset-bottom);
  287. }
  288. .zdyNavBox {
  289. width: 100vw;
  290. background: #FFFFFF;
  291. position: fixed;
  292. top: 0;
  293. left: 0;
  294. z-index: 9999999;
  295. }
  296. .zdyNav {
  297. display: flex;
  298. justify-content: space-between;
  299. align-items: center;
  300. padding: 14rpx 6rpx;
  301. }
  302. .zdyNavTitle {
  303. background: #FFFFFF;
  304. text-align: center;
  305. font-size: 32rpx;
  306. font-weight: bold;
  307. }
  308. .zdyNavRight {
  309. background: #FFFFFF;
  310. text-align: center;
  311. font-size: 28rpx;
  312. color: #3F90F7;
  313. width: 120rpx;
  314. }
  315. .top {
  316. padding: 20rpx 0;
  317. }
  318. .topCont {
  319. width: 750rpx;
  320. height: 160rpx;
  321. background: #FFFFFF;
  322. }
  323. .carLogo {
  324. width: 72rpx;
  325. height: 72rpx;
  326. }
  327. .carTxt {
  328. font-size: 28rpx;
  329. font-family: PingFangSC-Medium, PingFang SC;
  330. font-weight: 500;
  331. color: #333333;
  332. line-height: 36rpx;
  333. width: 606rpx;
  334. }
  335. .carJt {
  336. width: 25rpx;
  337. height: 24rpx;
  338. margin-top: 6rpx;
  339. }
  340. .carBox {
  341. display: flex;
  342. justify-content: space-between;
  343. padding: 30rpx 24rpx 24rpx 34rpx;
  344. }
  345. .vinBox {
  346. display: flex;
  347. justify-content: space-between;
  348. padding-left: 34rpx;
  349. padding-right: 24rpx;
  350. }
  351. .vinBox2 {
  352. display: flex;
  353. align-items: center;
  354. }
  355. .detail {
  356. color: #3F90F7;
  357. font-size: 24rpx;
  358. margin-right: 10rpx;
  359. }
  360. .vinB {
  361. background: #F19D01;
  362. width: 60rpx;
  363. height: 30rpx;
  364. text-align: center;
  365. line-height: 30rpx;
  366. color: #FFFFFF;
  367. font-size: 22rpx;
  368. border-radius: 5rpx;
  369. }
  370. .vinNum {
  371. color: #999999;
  372. font-size: 24rpx;
  373. line-height: 30rpx;
  374. padding-left: 10rpx;
  375. }
  376. .mainBox {
  377. background: #FFFFFF;
  378. }
  379. .maintitle {
  380. font-size: 28rpx;
  381. font-family: PingFangSC-Medium, PingFang SC;
  382. font-weight: 500;
  383. color: #333333;
  384. text-align: center;
  385. line-height: 88rpx;
  386. border-bottom: 1px solid #EEEEEE;
  387. }
  388. .mainLineJt {
  389. width: 25rpx;
  390. height: 24rpx;
  391. margin-top: 8rpx;
  392. }
  393. .mainLine {
  394. display: flex;
  395. justify-content: space-between;
  396. border-bottom: 1px solid #EEEEEE;
  397. padding: 24rpx;
  398. }
  399. .lineName {
  400. font-size: 28rpx;
  401. font-family: PingFangSC-Regular, PingFang SC;
  402. font-weight: 400;
  403. color: #333333;
  404. line-height: 40rpx;
  405. }
  406. </style>