group.vue 12 KB

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