group.vue 11 KB

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