group.vue 14 KB

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