group.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726
  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" v-if="type!=2">车型件</view>
  12. <view class="xx" v-if="type==2" style="position: absolute;left:100rpx;color: black;font-size: 23px;" @click="goToSelectCarModel">X</view>
  13. <view class="tab-box" v-if="type==2">
  14. <span class="tab-box-title jian" :class="{clickbu:clickType==1}" @click="clickbu(1)">简易版</span>
  15. <span class="tab-box-title zhuan" :class="{clickbu:clickType==2}" @click="clickbu(2)">专业版</span>
  16. </view>
  17. <view v-if="param.length != 0 && type!=2" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
  18. <view v-if="param.length != 0 && type==2" class="zdyNavRight"></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" v-if="type !=2">
  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. <view v-else class="top" v-if="type == 2">
  52. <!-- <view class="carBox2">
  53. <view class="carTxt2" v-if="!description">{{brand_name}}</view>
  54. <view class="carTxt2" v-if="description">{{description}}</view>
  55. </view> -->
  56. <view class="head-box">
  57. <view class="searchBtn" @click="goOemSearch()">
  58. <image src="../../static/img/icon_search.png" class="searchImg"></image>
  59. <span class="searchTitle">搜索配件名称/OE号</span>
  60. </view>
  61. <view class="cardDetail">
  62. <view class="image-box">
  63. <image :src="imageicon" style="width: 80rpx;height: 80rpx;"></image>
  64. </view>
  65. <view class="detail">
  66. <view class="code">
  67. <span>{{param.split("_")[0]}}</span>
  68. </view>
  69. <view class="title">
  70. <span>{{description}}</span>
  71. </view>
  72. </view>
  73. </view>
  74. </view>
  75. </view>
  76. <!--车辆配置 -->
  77. <view class="mainBox" v-if="restrainShow">
  78. <view class="maintitle">{{caption}}</view>
  79. <view class="mainLine" v-for="(item,index) in restrains" @click="restrainsClick(item)">
  80. <view class="lineName">{{item.combine_cp}}</view>
  81. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  82. </view>
  83. </view>
  84. <!-- 总组 -->
  85. <view class="mainBox" :style="{background: type==2 ? '#F4F5F7' : ''}" v-if="groupShow">
  86. <view class="mainBoxChildJian" v-if="type == 2 && clickType==1">
  87. <!-- 简版 -->
  88. <view class="childTitle">选择分类</view>
  89. <view class="jianShowContent">
  90. <view class="jianChildbox" v-for="item in groupList" @click="toDetail(item)">
  91. <view class="childBoxImage">
  92. <image :src="item.image" mode="aspectFit" style="width: 230rpx;height: 300rpx;"></image>
  93. </view>
  94. <view class="childBoxTitle">
  95. {{item.title}}
  96. </view>
  97. </view>
  98. </view>
  99. </view>
  100. <view class="mainBoxChildZhuan" v-if="clickType==2 || type == 1">
  101. <!-- 专业版 -->
  102. <view class="maintitle">{{caption}}</view>
  103. <view class="mainLine" v-for="(item,index) in zlist" @click="goTwo(item)">
  104. <view class="lineName">{{item.caption}}</view>
  105. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  106. </view>
  107. </view>
  108. </view>
  109. </view>
  110. </template>
  111. <script>
  112. export default {
  113. data() {
  114. return {
  115. vin: '',
  116. iStatusBarHeight: '',
  117. restrains: '',
  118. zlist: '',
  119. brand_name: '',
  120. brand_id: '',
  121. access_time: '',
  122. zzTime: '',
  123. caption: '',
  124. restrainShow: false,
  125. groupShow: false,
  126. param: '',
  127. token: '',
  128. epc_id: '',
  129. chexingMesList: [],
  130. chexing: '',
  131. description: '',
  132. type: '',
  133. clickType:1,
  134. brand_id:'',
  135. groupList:[],
  136. imageicon:'',
  137. captionOld:'', //名称
  138. }
  139. },
  140. onLoad(opt) {
  141. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  142. if (opt.type == 2) {
  143. this.type = 2
  144. this.token = opt.token;
  145. this.param = opt.param;
  146. this.access_time = opt.access_time;
  147. this.epc_id = opt.epc_id;
  148. this.description = opt.modelname;
  149. this.brand_id = opt.brand_id;
  150. this.imageicon = opt.imageicon;
  151. this.captionOld = opt.caption;
  152. //车型点选
  153. this.getModelGroup()
  154. this.getDataByBtnType()
  155. } else {
  156. this.vin = opt.vin
  157. this.getData()
  158. }
  159. },
  160. methods: {
  161. getModelGroup() {
  162. uni.showLoading({
  163. title: '加载中'
  164. });
  165. this.$http('advancedEpc/getModelGroup', {
  166. token: this.token,
  167. param: this.param,
  168. epc_id: this.epc_id,
  169. access_time: this.access_time
  170. }, 'GET').then(res => {
  171. uni.hideLoading();
  172. //console.log(res.data.number);
  173. if (res.data.number == 200 || res.data.number == 5212) {
  174. this.brand_name = res.data.result.brand_name;
  175. this.brand_id = res.data.result.brand_id;
  176. this.access_time = res.data.result.access_time;
  177. this.caption = res.data.result.caption
  178. this.epc_id = res.data.result.epc_id;
  179. if (res.data.result.restrains.length > 0) {
  180. this.restrains = res.data.result.restrains;
  181. this.restrainShow = true;
  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. getData() {
  207. uni.showLoading({
  208. title: '加载中'
  209. });
  210. this.$http('advancedEpc/getVinGroup', {
  211. vin: this.vin,
  212. }, 'GET').then(res => {
  213. uni.hideLoading();
  214. //console.log(res.data.number);
  215. if (res.data.number == 200 || res.data.number == 5212) {
  216. this.brand_name = res.data.result.brand_name;
  217. this.brand_id = res.data.result.brand_id;
  218. this.access_time = res.data.result.access_time;
  219. this.caption = res.data.result.caption
  220. this.epc_id = res.data.result.epc_id;
  221. if (res.data.result.restrains.length > 0) {
  222. this.restrains = res.data.result.restrains;
  223. this.restrainShow = true;
  224. } else {
  225. this.zzTime = res.data.result.access_time;
  226. this.zlist = res.data.result.list;
  227. this.restrainShow = false;
  228. this.groupShow = true;
  229. this.token = res.data.result.list[0].token;
  230. this.param = res.data.result.list[0].param;
  231. if (res.data.result.vehicle.description) {
  232. this.description = res.data.result.vehicle.description
  233. }
  234. }
  235. if (Object.keys(res.data.result.vehicle).length != 0) {
  236. this.chexingMesList = res.data.result.vehicle.tree;
  237. this.chexing = res.data.result.vehicle.description;
  238. }
  239. } else {
  240. uni.showToast({
  241. title: res.data.message,
  242. icon: 'none',
  243. duration: 3000
  244. });
  245. }
  246. });
  247. },
  248. restrainsClick(item) {
  249. this.param = item.param;
  250. this.token = item.token;
  251. this.getcarVinGroup()
  252. },
  253. getcarVinGroup() {
  254. uni.showLoading({
  255. title: '加载中'
  256. });
  257. this.$http('advancedEpc/getVinGroup', {
  258. vin: this.vin,
  259. access_time: this.access_time,
  260. param: this.param,
  261. token: this.token
  262. }, 'GET').then(res => {
  263. uni.hideLoading();
  264. //console.log(res.data.number);
  265. if (res.data.number == 200 || res.data.number == 5212) {
  266. this.brand_name = res.data.result.brand_name;
  267. this.access_time = res.data.result.access_time;
  268. this.caption = res.data.result.caption
  269. if (res.data.result.restrains.length > 0) {
  270. this.restrains = res.data.result.restrains;
  271. this.restrainShow = true;
  272. this.token = res.data.result.restrains[0].token;
  273. this.param = res.data.result.restrains[0].param;
  274. } else {
  275. this.token = res.data.result.list[0].token;
  276. this.param = res.data.result.list[0].param;
  277. this.zzTime = res.data.result.access_time;
  278. this.zlist = res.data.result.list;
  279. this.restrainShow = false;
  280. this.groupShow = true;
  281. if (res.data.result.vehicle.description) {
  282. this.description = res.data.result.vehicle.description
  283. }
  284. }
  285. if (Object.keys(res.data.result.vehicle).length != 0) {
  286. this.chexingMesList = res.data.result.vehicle.tree;
  287. this.chexing = res.data.result.vehicle.description;
  288. }
  289. } else {
  290. uni.showToast({
  291. title: res.data.message,
  292. icon: 'none',
  293. duration: 3000
  294. });
  295. }
  296. });
  297. },
  298. goCarDetail() {
  299. var that = this;
  300. uni.setStorage({
  301. key: 'chexing',
  302. data: that.chexing,
  303. success: function() {
  304. uni.setStorage({
  305. key: 'chexingMesList',
  306. data: that.chexingMesList,
  307. success: function() {
  308. uni.navigateTo({
  309. url: 'CarDetail'
  310. })
  311. }
  312. });
  313. }
  314. });
  315. },
  316. goOemSearch() {
  317. uni.navigateTo({
  318. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&vin=' + this.vin +
  319. '&param=' + this.param +
  320. '&token=' + this.token + '&access_time=' + this.access_time
  321. })
  322. },
  323. goback() {
  324. console.log('返回');
  325. uni.navigateBack({})
  326. },
  327. //返回选品牌
  328. goToSelectCarModel(){
  329. uni.navigateTo({url:'SelectCarModel'});
  330. },
  331. goTwo(item) {
  332. var that = this;
  333. uni.setStorage({
  334. key: 'chexing',
  335. data: that.chexing,
  336. success: function() {
  337. uni.setStorage({
  338. key: 'chexingMesList',
  339. data: that.chexingMesList,
  340. success: function() {
  341. uni.navigateTo({
  342. url: 'modelTwo?vin=' + that.vin + '&zzTime=' + that
  343. .zzTime + '&param=' + item.param +
  344. '&token=' + item.token + '&epc_id=' + that.epc_id +
  345. '&description=' + that.description + '&type=' + that.type
  346. })
  347. }
  348. });
  349. }
  350. });
  351. },
  352. clickbu(type){
  353. console.log("点我了type:"+type);
  354. this.clickType = type;
  355. },
  356. /**
  357. * 查询简版数据
  358. */
  359. getDataByBtnType(){
  360. console.log(this.brand_id);
  361. uni.showLoading({
  362. title: '加载中'
  363. });
  364. this.$http('simpleEpc/getAllCata', {
  365. token: this.token,
  366. param: this.param,
  367. epc_id: this.epc_id,
  368. access_time: this.access_time,
  369. brand_id: this.brand_id,
  370. }, 'GET').then(res => {
  371. uni.hideLoading();
  372. //console.log(res.data.number);
  373. if (res.data.number == 200 || res.data.number == 5212) {
  374. //查询成功
  375. this.groupList = res.data.result.list;
  376. } else {
  377. uni.showToast({
  378. title: res.data.message,
  379. icon: 'none',
  380. duration: 3000
  381. });
  382. }
  383. });
  384. },
  385. toDetail(item){
  386. uni.removeStorageSync('epcChildren');
  387. uni.removeStorageSync('epcAllChildren');
  388. uni.setStorageSync('epcChildren', item);
  389. uni.setStorageSync('epcAllChildren', this.groupList);
  390. console.log(item);
  391. console.log(this.groupList);
  392. uni.navigateTo({
  393. url: 'epcSimpleDetailOne?type=2&token='+this.token+'&param='+this.param+'&access_time='+this.access_time+'&epc_id='
  394. +this.epc_id+'&brand_id='+this.brand_id+"&brand_name="+this.brand_name+"&caption="+this.captionOld
  395. })
  396. }
  397. }
  398. }
  399. </script>
  400. <style scoped>
  401. .content {
  402. background: #F4F5F7;
  403. min-height: 100vh;
  404. padding-bottom: constant(safe-area-inset-bottom);
  405. padding-bottom: env(safe-area-inset-bottom);
  406. }
  407. .zdyNavBox {
  408. width: 100vw;
  409. background: #FFFFFF;
  410. position: fixed;
  411. top: 0;
  412. left: 0;
  413. z-index: 9999999;
  414. }
  415. .zdyNav {
  416. display: flex;
  417. justify-content: space-between;
  418. align-items: center;
  419. padding: 14rpx 6rpx;
  420. }
  421. .zdyNavLeft {
  422. width: 120rpx;
  423. }
  424. .zdyNavTitle {
  425. background: #FFFFFF;
  426. text-align: center;
  427. font-size: 32rpx;
  428. font-weight: bold;
  429. }
  430. .zdyNavRight {
  431. background: #FFFFFF;
  432. text-align: center;
  433. font-size: 28rpx;
  434. color: #3F90F7;
  435. width: 120rpx;
  436. }
  437. .top {
  438. padding: 20rpx 0;
  439. }
  440. .topCont {
  441. width: 750rpx;
  442. height: 160rpx;
  443. background: #FFFFFF;
  444. }
  445. .carLogo {
  446. width: 72rpx;
  447. height: 72rpx;
  448. }
  449. .carTxt {
  450. font-size: 28rpx;
  451. font-family: PingFangSC-Medium, PingFang SC;
  452. font-weight: 500;
  453. color: #333333;
  454. line-height: 36rpx;
  455. width: 606rpx;
  456. }
  457. .carJt {
  458. width: 25rpx;
  459. height: 24rpx;
  460. margin-top: 6rpx;
  461. }
  462. .carBox {
  463. display: flex;
  464. justify-content: space-between;
  465. padding: 30rpx 24rpx 24rpx 34rpx;
  466. }
  467. .carBox2{
  468. background-color: #FFFFFF;
  469. padding: 30rpx 24rpx;
  470. }
  471. .carTxt2 {
  472. font-size: 28rpx;
  473. font-family: PingFangSC-Medium, PingFang SC;
  474. font-weight: 500;
  475. color: #333333;
  476. line-height: 36rpx;
  477. /* width: 606rpx; */
  478. height: 75rpx;
  479. /* 隐藏文字显示 ...超过2行省略 */
  480. overflow: hidden;
  481. -webkit-line-clamp: 2;
  482. text-overflow: ellipsis;
  483. display: -webkit-box;
  484. -webkit-box-orient: vertical;
  485. }
  486. .vinBox {
  487. display: flex;
  488. justify-content: space-between;
  489. padding-left: 34rpx;
  490. padding-right: 24rpx;
  491. }
  492. .vinBox2 {
  493. display: flex;
  494. align-items: center;
  495. }
  496. .detail {
  497. color: #3F90F7;
  498. font-size: 24rpx;
  499. margin-right: 10rpx;
  500. }
  501. .vinB {
  502. background: #F19D01;
  503. width: 60rpx;
  504. height: 30rpx;
  505. text-align: center;
  506. line-height: 30rpx;
  507. color: #FFFFFF;
  508. font-size: 22rpx;
  509. border-radius: 5rpx;
  510. }
  511. .vinNum {
  512. color: #999999;
  513. font-size: 24rpx;
  514. line-height: 30rpx;
  515. padding-left: 10rpx;
  516. }
  517. .mainBox {
  518. background: #FFFFFF;
  519. }
  520. .maintitle {
  521. font-size: 28rpx;
  522. font-family: PingFangSC-Medium, PingFang SC;
  523. font-weight: 500;
  524. color: #333333;
  525. text-align: center;
  526. line-height: 88rpx;
  527. border-bottom: 1px solid #EEEEEE;
  528. }
  529. .mainLineJt {
  530. width: 25rpx;
  531. height: 24rpx;
  532. margin-top: 8rpx;
  533. }
  534. .mainLine {
  535. display: flex;
  536. justify-content: space-between;
  537. border-bottom: 1px solid #EEEEEE;
  538. padding: 24rpx;
  539. }
  540. .lineName {
  541. font-size: 28rpx;
  542. font-family: PingFangSC-Regular, PingFang SC;
  543. font-weight: 400;
  544. color: #333333;
  545. line-height: 40rpx;
  546. }
  547. .tab-box{
  548. width: 360rpx;
  549. display: flex;
  550. height: 52rpx;
  551. background-color: #EFEFEF;
  552. border-radius: 10rpx;
  553. }
  554. .tab-box-title{
  555. width: 175rpx;
  556. height: 46rpx;
  557. font-size: 20rpx;
  558. border-radius: 10rpx;
  559. font-weight: 400;
  560. text-align: center;
  561. line-height: 46rpx;
  562. margin: 3rpx 5rpx;
  563. }
  564. .clickbu{
  565. background-color: #FFFFFF;
  566. font-weight: 700;
  567. }
  568. .tab-box-jian{
  569. }
  570. .tab-box-zhuan{
  571. }
  572. .head-box{
  573. width: 660rpx;
  574. height: 160rpx;
  575. margin: 10rpx auto;
  576. }
  577. .searchBtn{
  578. background-color: #F7FBFE;
  579. width: 100%;
  580. height: 60rpx;
  581. }
  582. .searchImg{
  583. width: 20rpx;
  584. height: 20rpx;
  585. margin: auto 20rpx;
  586. }
  587. .searchTitle{
  588. font-size: 20rpx;
  589. color: #999999;
  590. line-height: 60rpx;
  591. }
  592. .cardDetail{
  593. display: flex;
  594. flex-direction: row;
  595. width: 100%;
  596. margin: 20rpx 0;
  597. }
  598. .image-box{
  599. background-color: #ffffff;
  600. width: 80rpx;
  601. height: 80rpx;
  602. border-radius: 80rpx;
  603. }
  604. .detail{
  605. color: #333333;
  606. width: 500rpx;
  607. font-size: 19rpx;
  608. margin: 20rpx 10rpx;
  609. }
  610. .mainBoxChildJian{
  611. width: 720rpx;
  612. padding: 10rpx;
  613. background: #F4F5F7;
  614. }
  615. .childTitle{
  616. text-align: center;
  617. font-size: 20rpx;
  618. font-weight: 700;
  619. margin-bottom: 10rpx;
  620. }
  621. .jianShowContent{
  622. width: 100%;
  623. display: grid;
  624. grid-template-columns: repeat(2, 1fr);
  625. gap: 25rpx;
  626. padding: 10rpx;
  627. background: #F4F5F7;
  628. }
  629. .jianChildbox{
  630. background: #ffffff;
  631. min-height: 200rpx;
  632. border-radius: 10rpx;
  633. /* box-shadow: 1rpx -1rpx 3rpx 1rpx #999999; */
  634. border: 1rpx solid rgb(244, 245, 247);
  635. }
  636. .childBoxImage{
  637. width: 230rpx;
  638. height: 300rpx;
  639. margin: 20rpx auto;
  640. }
  641. .childBoxTitle{
  642. text-align: center;
  643. margin-bottom: 15rpx;
  644. }
  645. </style>