group.vue 13 KB

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