modelTwoSimple.vue 13 KB

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