group.vue 13 KB

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