modelTwo.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744
  1. <template>
  2. <view class="content" style="background-color: #ffffff;">
  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="xx" style="margin-left: -70rpx;" @click="goToSelectCarModel">
  12. <image src="/static/img/group2.png" style="width: 27rpx;height: 27rpx;"></image>
  13. </view>
  14. <view class="tab-box2">车型件</view>
  15. <!-- <view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view> -->
  16. <view v-if="param.length != 0" class="zdyNavRight" ></view>
  17. <view v-else style="width: 120rpx;"></view>
  18. </view>
  19. </view>
  20. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  21. <view style="height: 44px;"></view>
  22. <!-- <view v-if="type != 2" class="top">
  23. <view class="topCont">
  24. <view class="carBox">
  25. <view class="carTxt">{{description}}</view>
  26. </view>
  27. <view class="vinBox">
  28. <view class="vinBox2">
  29. <view class="vinB">VIN</view>
  30. <view class="vinNum">{{vin}}</view>
  31. </view>
  32. <view class="vinBox2" v-if="chexingMesList.length != 0">
  33. <view class="detail" @click="goCarDetail()">车型详情</view>
  34. <image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
  35. </view>
  36. </view>
  37. </view>
  38. </view>
  39. <view class="top">
  40. <view class="carBox2">
  41. <view class="carTxt2">{{description}}</view>
  42. </view>
  43. </view> -->
  44. <view class="top" >
  45. <!-- <view class="carBox2">
  46. <view class="carTxt2" v-if="!description">{{brand_name}}</view>
  47. <view class="carTxt2" v-if="description">{{description}}</view>
  48. </view> -->
  49. <view class="head-box">
  50. <view class="searchBtn" @click="goOemSearch()">
  51. <image src="../../static/img/icon_search.png" class="searchImg"></image>
  52. <span class="searchTitle">搜索配件名称/OE号</span>
  53. </view>
  54. <!-- <view class="cardDetail">
  55. <view class="image-box">
  56. <image :src="image" style="width: 78rpx;height: 78rpx;"></image>
  57. </view>
  58. <view class="detail">
  59. <view class="code" v-if="vin !=undefined && vin !='undefined'" >
  60. <view>{{vin}}</view>
  61. </view>
  62. <view class="head-this-title">{{description}}</view>
  63. </view>
  64. </view> -->
  65. <view class="cardDetail" :class="{novin: vin ==undefined || vin=='undefined' || vin =='' }">
  66. <view class="image-box">
  67. <image :src="image" style="width: 78rpx;height: 78rpx;"></image>
  68. </view>
  69. <view class="detail" :class="{detailNoVin: vin == undefined || vin=='undefined' || vin =='' }">
  70. <view class="code" v-if="vin !=undefined && vin!='undefined' && vin !='' " >
  71. <view>{{vin}}</view>
  72. </view>
  73. <view class="head-this-title" >{{description}}</view>
  74. </view>
  75. </view>
  76. </view>
  77. </view>
  78. <view class="mainBox">
  79. <view class="maintitle">{{caption}}
  80. <view @click="goback" class="backBox">
  81. <image src="../../static/img/icon_arrow_blue_l@2x.png" mode="" class="backZongImg"></image>
  82. <view class="backTxt">返回总组</view>
  83. </view>
  84. </view>
  85. <view class="searchBox" v-if="lastShow">
  86. <view class="inputBox">
  87. <img src="../../static/img/icon_search.png" alt="" class="searchImg2">
  88. <input type="text" placeholder="快速查找子组" class="topInput" v-model="childrenss"
  89. @confirm="childrenkeyup">
  90. </view>
  91. </view>
  92. <view class="mainLine" v-for="(item,index) in childrenList" @click="goThree(item,index)" v-if="lastShow">
  93. <view class="lineLeft">
  94. <image class="lineIMg" :src="item.image_url" v-if="item.image_url" mode="aspectFit"></image>
  95. <image class="lineIMg" src="../../static/img/noimg.png" v-else mode="aspectFit"></image>
  96. </view>
  97. <view class="lineRIght">
  98. <view class="lineName">{{item.caption}}</view>
  99. <view class="lineBm">{{item.code}}</view>
  100. <view class="linejs" v-html="item.remark"></view>
  101. </view>
  102. </view>
  103. <view class="mainBox m1" v-if="restrainShow1">
  104. <view class="mainLine2" v-for="(item,index) in restrainList1" @click="restrainClickOne(item)">
  105. <view class="lineName2">{{item.caption}}</view>
  106. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  107. </view>
  108. </view>
  109. <view class="mainBox m2" v-if="restrainShow2">
  110. <view class="mainLine2" v-for="(item,index) in restrainList2" @click="restrainClickTwo(item)">
  111. <view class="lineName2">{{item.caption}}</view>
  112. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. </template>
  118. <script>
  119. export default {
  120. data() {
  121. return {
  122. vin: '',
  123. brand_name: '',
  124. access_time: '',
  125. zzTime: '',
  126. caption: '',
  127. param: '',
  128. token: '',
  129. list: '',
  130. restrainShow1: false,
  131. restrainList1: '',
  132. restrainShow2: false,
  133. restrainList2: '',
  134. lastShow: false,
  135. childrenList: '',
  136. oldList: '',
  137. childrenss: '',
  138. iStatusBarHeight: '',
  139. epc_id:'',
  140. description:'',
  141. chexingMesList:[],
  142. type:'',
  143. image:'',
  144. vin:'',
  145. }
  146. },
  147. onLoad(opt) {
  148. this.vin = opt.vin;
  149. this.zzTime = opt.zzTime;
  150. this.param = opt.param;
  151. this.token = opt.token;
  152. this.epc_id = opt.epc_id;
  153. this.description=opt.description;
  154. this.type = opt.type;
  155. this.image = opt.image;
  156. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  157. this.getData()
  158. this.chexingMesList = uni.getStorageSync('chexingMesList');
  159. },
  160. methods: {
  161. goOemSearch(){
  162. uni.navigateTo({
  163. url:'OemSearch?brand='+ this.brand_name + '&epc_id=' + this.epc_id + '&vin=' + this.vin + '&param=' + this.param +
  164. '&token=' + this.token + '&access_time=' + this.access_time
  165. })
  166. },
  167. goback() {
  168. console.log('返回');
  169. uni.navigateBack({})
  170. },
  171. restrainClickOne(item) {
  172. this.param = item.param;
  173. this.token = item.token;
  174. if (item.next_restrain == 1) {
  175. this.getYsone()
  176. } else {
  177. this.getYsDlist()
  178. }
  179. },
  180. restrainClickTwo(item) {
  181. this.param = item.param;
  182. this.token = item.token;
  183. if (item.next_restrain == 1) {
  184. //this.getYsDlist()
  185. this.getYsone()
  186. } else {
  187. this.getYsDlist()
  188. }
  189. },
  190. getYsDlist() {
  191. uni.showLoading({
  192. title: '加载中'
  193. });
  194. let vin = this.vin =="undefined" ? '':this.vin;
  195. console.log(vin);
  196. this.$http('advancedEpc/getSubgroup', {
  197. vin: vin,
  198. access_time: this.access_time,
  199. param: this.param,
  200. token: this.token,
  201. epc_id:this.epc_id,
  202. }, 'GET').then(res => {
  203. uni.hideLoading();
  204. //console.log(res.data.number);
  205. if (res.data.number == 200 || res.data.number == 5212) {
  206. this.caption = res.data.result.caption;
  207. this.brand_name = res.data.result.brand_name;
  208. this.access_time = res.data.result.access_time;
  209. this.restrainShow2 = false;
  210. this.restrainShow1 = false;
  211. this.lastShow = true;
  212. this.childrenList = res.data.result.list;
  213. this.oldList = this.childrenList
  214. } else {
  215. uni.showToast({
  216. title: res.data.message,
  217. icon: 'none',
  218. duration: 3000
  219. });
  220. }
  221. });
  222. },
  223. getYsone() {
  224. uni.showLoading({
  225. title: '加载中'
  226. });
  227. let vin = this.vin =="undefined" ? '':this.vin;
  228. console.log(vin);
  229. this.$http('advancedEpc/getSubgroup', {
  230. vin: vin,
  231. access_time: this.access_time,
  232. param: this.param,
  233. token: this.token,
  234. epc_id:this.epc_id,
  235. }, 'GET').then(res => {
  236. uni.hideLoading();
  237. //console.log(res.data.number);
  238. if (res.data.number == 200 || res.data.number == 5212) {
  239. this.caption = res.data.result.caption;
  240. this.brand_name = res.data.result.brand_name;
  241. this.access_time = res.data.result.access_time;
  242. if (res.data.result.level_identify == 'group_restrain' || res.data.result.level_identify ==
  243. 'subgroup') { //约束
  244. console.log("约束2")
  245. if(res.data.result.list[0].next_restrain==1){
  246. this.restrainShow2 = true;
  247. this.restrainShow1 = false;
  248. this.restrainList2 = res.data.result.list;
  249. }else{
  250. this.lastShow = true;
  251. this.restrainShow2 = false;
  252. this.restrainShow1 = false;
  253. this.childrenList = res.data.result.list;
  254. this.oldList = this.childrenList
  255. }
  256. } else {
  257. this.lastShow = true;
  258. this.restrainShow1 = false;
  259. this.childrenList = res.data.result.list;
  260. this.oldList = this.childrenList
  261. }
  262. } else {
  263. uni.showToast({
  264. title: res.data.message,
  265. icon: 'none',
  266. duration: 3000
  267. });
  268. }
  269. });
  270. },
  271. getData() {
  272. uni.showLoading({
  273. title: '加载中'
  274. });
  275. let vin = this.vin =="undefined" ? '':this.vin;
  276. console.log(vin);
  277. this.$http('advancedEpc/getSubgroup', {
  278. vin: vin,
  279. access_time: this.zzTime,
  280. param: this.param,
  281. token: this.token,
  282. epc_id:this.epc_id,
  283. }, 'GET').then(res => {
  284. uni.hideLoading();
  285. //console.log(res.data.number);
  286. if (res.data.number == 200 || res.data.number == 5212) {
  287. this.caption = res.data.result.caption;
  288. this.brand_name = res.data.result.brand_name;
  289. this.access_time = res.data.result.access_time;
  290. if (res.data.result.level_identify == 'group_restrain' ) { //约束
  291. console.log("约束1")
  292. this.restrainShow1 = true;
  293. this.restrainList1 = res.data.result.list;
  294. } else {
  295. if(res.data.result.list[0].next_restrain==1){
  296. this.restrainShow1 = true;
  297. this.restrainList1 = res.data.result.list;
  298. }else{
  299. this.lastShow = true;
  300. this.childrenList = res.data.result.list;
  301. this.oldList = this.childrenList
  302. }
  303. }
  304. } else {
  305. uni.showToast({
  306. title: res.data.message,
  307. icon: 'none',
  308. duration: 3000
  309. });
  310. }
  311. });
  312. },
  313. goCarDetail() {
  314. uni.navigateTo({
  315. url: 'CarDetail'
  316. })
  317. },
  318. goThree(item, index) {
  319. var that = this;
  320. uni.setStorage({
  321. key: 'childrenList',
  322. data: that.childrenList,
  323. success: function() {
  324. uni.navigateTo({
  325. url: 'vinDetail?vin=' + that.vin + '&token=' + item.token + '&param=' +
  326. item.param + '&access_time=' + that.access_time + '&tabIndex=' + index+'&epc_id='+that.epc_id
  327. })
  328. }
  329. });
  330. },
  331. childrenkeyup() {
  332. this.childrenList = this.oldList;
  333. if (this.childrenss == '') {
  334. this.childrenList = this.oldList;
  335. } else {
  336. this.childrenList = this.query(this.childrenList, this.childrenss, 'caption')
  337. }
  338. },
  339. query(list, keyWord, attribute = 'caption') {
  340. const reg = new RegExp(keyWord) // 创建正则表达式
  341. const arr = []
  342. for (let i = 0; i < list.length; i++) {
  343. if (reg.test(list[i][attribute])) {
  344. arr.push(list[i])
  345. }
  346. }
  347. return arr
  348. },
  349. }
  350. }
  351. </script>
  352. <style scoped>
  353. .searchImg2 {
  354. width: 40rpx;
  355. height: 40rpx;
  356. margin-top: 16rpx;
  357. margin-left: 20rpx;
  358. }
  359. .searchBox {
  360. padding-top: 24rpx;
  361. width: 100vw;
  362. }
  363. .inputBox {
  364. width: 702rpx;
  365. height: 72rpx;
  366. background: #F4F5F7;
  367. border-radius: 36rpx;
  368. margin-left: 24rpx;
  369. display: flex;
  370. position: relative;
  371. }
  372. .topInput {
  373. font-size: 28rpx;
  374. height: 72rpx;
  375. line-height: 72rpx;
  376. padding-left: 16rpx;
  377. width: 500rpx;
  378. }
  379. .top {
  380. padding: 20rpx 0;
  381. background-color: #ffffff;
  382. margin-bottom: ;
  383. }
  384. .topCont {
  385. width: 750rpx;
  386. height: 160rpx;
  387. background: #FFFFFF;
  388. }
  389. .head-box{
  390. width: 660rpx;
  391. height: 160rpx;
  392. margin: 10rpx auto;
  393. }
  394. .searchBtn{
  395. background-color: #F8FBFF;
  396. width: 100%;
  397. height: 75rpx;
  398. border-radius: 10rpx;
  399. line-height: 75rpx;
  400. }
  401. .searchImg{
  402. width: 27rpx;
  403. height: 27rpx;
  404. margin: -6rpx 20rpx;
  405. }
  406. .image-box{
  407. background-color: #ffffff;
  408. width: 80rpx;
  409. height: 80rpx;
  410. border-radius: 80rpx;
  411. }
  412. /* .head-this-title{
  413. font-size: 24rpx;
  414. margin-top: 6rpx;
  415. } */
  416. .searchTitle{
  417. height: 75rpx;
  418. font-size: 26rpx;
  419. color: #9E9E9E;
  420. line-height: 78rpx;
  421. }
  422. .cardDetail{
  423. display: flex;
  424. flex-direction: row;
  425. width: 100%;
  426. margin: 20rpx 0;
  427. }
  428. .image-box{
  429. background-color: #ffffff;
  430. width: 80rpx;
  431. height: 80rpx;
  432. border-radius: 80rpx;
  433. }
  434. .detail{
  435. color: #333333;
  436. width: 500rpx;
  437. font-size: 20rpx;
  438. margin: 20rpx 10rpx;
  439. }
  440. .detailNoVin{
  441. display: flex;
  442. flex-direction: row;
  443. align-items: center;
  444. }
  445. .head-title{
  446. height: 24rpx;
  447. }
  448. .head-this-title{
  449. font-size: 28rpx;
  450. display: -webkit-box;
  451. -webkit-box-orient: vertical;
  452. -webkit-line-clamp: 2; /* 控制显示的行数 */
  453. overflow: hidden;
  454. text-overflow: ellipsis;
  455. }
  456. .novin{
  457. align-items: center;
  458. }
  459. .content {
  460. background: #F4F5F7;
  461. min-height: 100vh;
  462. width: 100vw;
  463. padding-bottom: constant(safe-area-inset-bottom);
  464. padding-bottom: env(safe-area-inset-bottom);
  465. }
  466. .zdyNavBox {
  467. width: 100vw;
  468. background: #FFFFFF;
  469. position: fixed;
  470. top: 0;
  471. left: 0;
  472. z-index: 9999999;
  473. }
  474. .zdyNav {
  475. display: flex;
  476. justify-content: space-between;
  477. align-items: center;
  478. padding: 13rpx 6rpx;
  479. }
  480. .zdyNavLeft{
  481. width: 120rpx;
  482. }
  483. .zdyNavTitle {
  484. background: #FFFFFF;
  485. text-align: center;
  486. font-size: 32rpx;
  487. font-weight: bold;
  488. }
  489. .zdyNavRight {
  490. background: #FFFFFF;
  491. text-align: center;
  492. font-size: 28rpx;
  493. color: #3F90F7;
  494. width: 120rpx;
  495. }
  496. .top {
  497. padding: 20rpx 0;
  498. }
  499. .topCont {
  500. width: 750rpx;
  501. height: 160rpx;
  502. background: #FFFFFF;
  503. }
  504. .carLogo {
  505. width: 72rpx;
  506. height: 72rpx;
  507. }
  508. .carTxt {
  509. font-size: 28rpx;
  510. font-family: PingFangSC-Medium, PingFang SC;
  511. font-weight: 500;
  512. color: #333333;
  513. line-height: 36rpx;
  514. width: 606rpx;
  515. }
  516. .carJt {
  517. width: 25rpx;
  518. height: 24rpx;
  519. margin-top: 6rpx;
  520. }
  521. .carBox {
  522. display: flex;
  523. justify-content: space-between;
  524. padding: 30rpx 24rpx 24rpx 34rpx;
  525. }
  526. .carBox2{
  527. background-color: #FFFFFF;
  528. padding: 30rpx 24rpx;
  529. }
  530. .carTxt2 {
  531. font-size: 28rpx;
  532. font-family: PingFangSC-Medium, PingFang SC;
  533. font-weight: 500;
  534. color: #333333;
  535. line-height: 36rpx;
  536. /* width: 606rpx; */
  537. height: 75rpx;
  538. /* 隐藏文字显示 ...超过2行省略 */
  539. overflow: hidden;
  540. -webkit-line-clamp: 2;
  541. text-overflow: ellipsis;
  542. display: -webkit-box;
  543. -webkit-box-orient: vertical;
  544. }
  545. .vinBox {
  546. display: flex;
  547. justify-content: space-between;
  548. padding-left: 34rpx;
  549. padding-right: 24rpx;
  550. }
  551. .vinBox2 {
  552. display: flex;
  553. align-items: center;
  554. }
  555. /* .detail {
  556. color: #3F90F7;
  557. font-size: 24rpx;
  558. margin-right: 10rpx;
  559. } */
  560. .vinB {
  561. background: #F19D01;
  562. width: 60rpx;
  563. height: 30rpx;
  564. text-align: center;
  565. line-height: 30rpx;
  566. color: #FFFFFF;
  567. font-size: 22rpx;
  568. border-radius: 5rpx;
  569. }
  570. .vinNum {
  571. color: #999999;
  572. font-size: 24rpx;
  573. line-height: 30rpx;
  574. padding-left: 10rpx;
  575. }
  576. .mainBox {
  577. background: #FFFFFF;
  578. width: 100vw;
  579. }
  580. .maintitle {
  581. font-size: 28rpx;
  582. font-family: PingFangSC-Medium, PingFang SC;
  583. font-weight: 500;
  584. color: #333333;
  585. text-align: center;
  586. line-height: 88rpx;
  587. border-bottom: 1px solid #EEEEEE;
  588. position: relative;
  589. }
  590. .backZongImg {
  591. width: 25rpx;
  592. height: 24rpx;
  593. margin-top: 4rpx;
  594. }
  595. .backBox {
  596. display: flex;
  597. position: absolute;
  598. left: 23rpx;
  599. top: 28rpx;
  600. }
  601. .backTxt {
  602. color: #3F90F7;
  603. font-size: 24rpx;
  604. line-height: 33rpx;
  605. }
  606. .mainLineJt {
  607. width: 25rpx;
  608. height: 24rpx;
  609. margin-top: 8rpx;
  610. }
  611. .mainLine {
  612. display: flex;
  613. width: calc(100vw - 48rpx);
  614. border-bottom: 1px solid #EEEEEE;
  615. padding: 29rpx 24rpx;
  616. }
  617. .lineName {
  618. font-size: 26rpx;
  619. font-weight: bold;
  620. color: #333333;
  621. line-height: 40rpx;
  622. }
  623. .mainLine2 {
  624. display: flex;
  625. justify-content: space-between;
  626. border-bottom: 1px solid #EEEEEE;
  627. padding: 24rpx;
  628. }
  629. .lineName2 {
  630. font-size: 28rpx;
  631. font-family: PingFangSC-Regular, PingFang SC;
  632. font-weight: 400;
  633. color: #333333;
  634. line-height: 40rpx;
  635. }
  636. .lineIMg {
  637. width: 160rpx;
  638. height: 160rpx;
  639. }
  640. .lineRIght {
  641. padding-left: 20rpx;
  642. padding-right: 24rpx;
  643. }
  644. .lineBm {
  645. font-size: 24rpx;
  646. font-family: PingFangSC-Regular, PingFang SC;
  647. font-weight: 400;
  648. color: #999999;
  649. padding: 10rpx 0;
  650. }
  651. .linejs {
  652. font-size: 24rpx;
  653. font-family: PingFangSC-Regular, PingFang SC;
  654. font-weight: 400;
  655. color: #999999;
  656. }
  657. .tab-box2{
  658. width: 360rpx;
  659. display: flex;
  660. height: 65rpx;
  661. align-items: center;
  662. justify-content: center;
  663. /* font-size: 32rpx;
  664. font-weight: bold; */
  665. }
  666. </style>