modelTwo.vue 14 KB

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