group.vue 13 KB

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