modelTwo.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431
  1. <template>
  2. <view class="content">
  3. <view class="top">
  4. <view class="topCont">
  5. <view class="carBox">
  6. <image src="../../static/img/nocar.png" mode="" class="carLogo"></image>
  7. <view class="carTxt">{{brand_name}}</view>
  8. <!-- <image src="../../static/img/jt.png" mode="" class="carJt"></image> -->
  9. </view>
  10. <view class="vinBox">
  11. <view class="vinBox2">
  12. <view class="vinB">VIN</view>
  13. <view class="vinNum">{{vin}}</view>
  14. </view>
  15. <view class="vinBox2">
  16. <view class="detail" @click="goCarDetail()">车辆详情</view>
  17. <image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 12rpx; height: 20rpx"></image>
  18. </view>
  19. </view>
  20. </view>
  21. </view>
  22. <view class="mainBox">
  23. <view class="maintitle">{{caption}}
  24. <view class="backBox">
  25. <image src="../../static/img/icon_arrow_blue_l@2x.png" mode="" class="backImg"></image>
  26. <view class="backTxt">返回总组</view>
  27. </view>
  28. </view>
  29. <view class="searchBox" v-if="lastShow">
  30. <view class="inputBox">
  31. <img src="../../static/img/icon_search.png" alt="" class="searchImg">
  32. <input type="text" placeholder="快速查找子组" class="topInput" v-model="childrenss" @confirm="childrenkeyup">
  33. </view>
  34. </view>
  35. <view class="mainLine" v-for="(item,index) in childrenList" @click="goThree(item)" v-if="lastShow">
  36. <view class="lineLeft">
  37. <image class="lineIMg" :src="item.image_url" v-if="item.image_url" mode="aspectFit"></image>
  38. <image class="lineIMg" src="../../static/img/noimg.png" v-else mode="aspectFit"></image>
  39. </view>
  40. <view class="lineRIght">
  41. <view class="lineName">{{item.caption}}</view>
  42. <view class="lineBm">{{item.code}}</view>
  43. <view class="linejs">{{item.remark}}</view>
  44. </view>
  45. </view>
  46. <view class="mainBox" v-if="restrainShow1">
  47. <view class="mainLine2" v-for="(item,index) in restrainList1" @click="restrainClickOne(item)">
  48. <view class="lineName2">{{item.caption}}</view>
  49. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  50. </view>
  51. </view>
  52. <view class="mainBox" v-if="restrainShow2">
  53. <view class="mainLine2" v-for="(item,index) in restrainList2" @click="restrainClickTwo(item)">
  54. <view class="lineName2">{{item.caption}}</view>
  55. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  56. </view>
  57. </view>
  58. </view>
  59. </view>
  60. </template>
  61. <script>
  62. export default {
  63. data() {
  64. return {
  65. vin: '',
  66. brand_name:'',
  67. access_time:'',
  68. zzTime:'',
  69. caption:'',
  70. param:'',
  71. token:'',
  72. list:'',
  73. restrainShow1:false,
  74. restrainList1:'',
  75. restrainShow1:false,
  76. restrainList1:'',
  77. lastShow:false,
  78. childrenList:'',
  79. oldList:'',
  80. childrenss:'',
  81. }
  82. },
  83. onLoad(opt) {
  84. this.vin=opt.vin;
  85. this.zzTime=opt.zzTime;
  86. this.param=opt.param;
  87. this.token=opt.token;
  88. this.getData()
  89. },
  90. methods: {
  91. restrainClickOne(item){
  92. this.param=item.param;
  93. this.token=item.token;
  94. if(item.next_restrain==1){
  95. this.getYsone()
  96. }else{
  97. this.getYsDlist()
  98. }
  99. },
  100. restrainClickTwo(item){
  101. this.param=item.param;
  102. this.token=item.token;
  103. if(item.next_restrain==1){
  104. this.getYsDlist()
  105. }else{
  106. this.getYsDlist()
  107. }
  108. },
  109. getYsDlist(){
  110. uni.showLoading({
  111. title: '加载中'
  112. });
  113. this.$http('advancedEpc/getSubgroupPc', {
  114. vin:this.vin,
  115. access_time:this.access_time,
  116. param:this.param,
  117. token:this.token
  118. }, 'GET').then(res => {
  119. uni.hideLoading();
  120. //console.log(res.data.number);
  121. if(res.data.number==200||res.data.number==5212){
  122. this.caption=res.data.result.caption;
  123. this.brand_name=res.data.result.brand_name;
  124. this.access_time=res.data.result.access_time;
  125. this.restrainShow2=false;
  126. this.restrainShow1=false;
  127. this.lastShow=true;
  128. this.childrenList=res.data.result.list;
  129. this.oldList= this.childrenList
  130. }else{
  131. uni.showToast({
  132. title: res.data.message,
  133. icon: 'none',
  134. duration: 3000
  135. });
  136. }
  137. });
  138. },
  139. getYsone(){
  140. uni.showLoading({
  141. title: '加载中'
  142. });
  143. this.$http('advancedEpc/getSubgroupPc', {
  144. vin:this.vin,
  145. access_time:this.access_time,
  146. param:this.param,
  147. token:this.token
  148. }, 'GET').then(res => {
  149. uni.hideLoading();
  150. //console.log(res.data.number);
  151. if(res.data.number==200||res.data.number==5212){
  152. this.caption=res.data.result.caption;
  153. this.brand_name=res.data.result.brand_name;
  154. this.access_time=res.data.result.access_time;
  155. if(res.data.result.level_identify=='group_restrain'||res.data.result.level_identify=='subgroup'){ //约束
  156. console.log("约束2")
  157. this.restrainShow2=true;
  158. this.restrainShow1=false;
  159. this.restrainList2=res.data.result.list;
  160. }else{
  161. this.lastShow=true;
  162. this.childrenList=res.data.result.list;
  163. this.oldList= this.childrenList
  164. }
  165. }else{
  166. uni.showToast({
  167. title: res.data.message,
  168. icon: 'none',
  169. duration: 3000
  170. });
  171. }
  172. });
  173. },
  174. getData(){
  175. uni.showLoading({
  176. title: '加载中'
  177. });
  178. this.$http('advancedEpc/getSubgroupPc', {
  179. vin:this.vin,
  180. access_time:this.zzTime,
  181. param:this.param,
  182. token:this.token
  183. }, 'GET').then(res => {
  184. uni.hideLoading();
  185. //console.log(res.data.number);
  186. if(res.data.number==200||res.data.number==5212){
  187. this.caption=res.data.result.caption;
  188. this.brand_name=res.data.result.brand_name;
  189. this.access_time=res.data.result.access_time;
  190. if(res.data.result.level_identify=='group_restrain'||res.data.result.level_identify=='subgroup'){ //约束
  191. console.log("约束1")
  192. this.restrainShow1=true;
  193. this.restrainList1=res.data.result.list;
  194. }else{
  195. this.lastShow=true;
  196. this.childrenList=res.data.result.list;
  197. this.oldList= this.childrenList
  198. }
  199. }else{
  200. uni.showToast({
  201. title: res.data.message,
  202. icon: 'none',
  203. duration: 3000
  204. });
  205. }
  206. });
  207. },
  208. goCarDetail(){
  209. uni.navigateTo({
  210. url:'CarDetail'
  211. })
  212. },
  213. goThree(item){
  214. uni.navigateTo({
  215. url:'modelThree?vin='+this.vin+'&token='+item.token+'&param='+item.param+'&access_time='+this.access_time
  216. })
  217. },
  218. childrenkeyup(){
  219. this.childrenList=this.oldList;
  220. if(this.childrenss==''){
  221. this.childrenList=this.oldList;
  222. }else{
  223. this.childrenList=this.query(this.childrenList,this.childrenss,'caption')
  224. }
  225. },
  226. query(list, keyWord, attribute = 'caption') {
  227. const reg = new RegExp(keyWord) // 创建正则表达式
  228. const arr = []
  229. for (let i = 0; i < list.length; i++) {
  230. if (reg.test(list[i][attribute])) {
  231. arr.push(list[i])
  232. }
  233. }
  234. return arr
  235. },
  236. }
  237. }
  238. </script>
  239. <style scoped>
  240. .searchImg{
  241. width: 40rpx;
  242. height: 40rpx;
  243. margin-top: 16rpx;
  244. margin-left: 20rpx;
  245. }
  246. .searchBox{
  247. padding-top:24rpx ;
  248. }
  249. .inputBox{
  250. width: 702rpx;
  251. height: 72rpx;
  252. background: #F4F5F7;
  253. border-radius: 36rpx;
  254. margin-left: 24rpx;
  255. display:flex;
  256. position: relative;
  257. }
  258. .topInput{
  259. font-size: 28rpx;
  260. height: 72rpx;
  261. line-height: 72rpx;
  262. padding-left: 16rpx;
  263. width: 500rpx;
  264. }
  265. .content{
  266. background: #F4F5F7;
  267. min-height: 100vh;
  268. }
  269. .top{
  270. padding: 20rpx 0;
  271. }
  272. .topCont{
  273. width: 750rpx;
  274. height: 185rpx;
  275. background: #FFFFFF;
  276. }
  277. .carLogo{
  278. width: 72rpx;height: 72rpx;
  279. }
  280. .carTxt{
  281. font-size: 28rpx;
  282. font-family: PingFangSC-Medium, PingFang SC;
  283. font-weight: 500;
  284. color: #333333;
  285. line-height: 36rpx;
  286. width: 606rpx;
  287. }
  288. .carJt{
  289. width: 25rpx;
  290. height: 24rpx;
  291. margin-top: 6rpx;
  292. }
  293. .carBox{
  294. display: flex;
  295. justify-content: space-between;
  296. padding: 30rpx 24rpx 24rpx 24rpx;
  297. }
  298. .vinBox{
  299. display: flex;
  300. justify-content: space-between;
  301. padding-left: 120rpx;
  302. padding-right: 24rpx;
  303. }
  304. .vinBox2{
  305. display: flex;
  306. align-items: center;
  307. }
  308. .detail{
  309. color: #3F90F7;
  310. font-size: 24rpx;
  311. margin-right: 10rpx;
  312. }
  313. .vinB{
  314. background: #F19D01;
  315. width: 60rpx;
  316. height: 30rpx;
  317. text-align: center;
  318. line-height: 30rpx;
  319. color: #FFFFFF;
  320. font-size: 22rpx;
  321. border-radius: 5rpx;
  322. }
  323. .vinNum{
  324. color: #999999;font-size: 24rpx;line-height: 30rpx;padding-left: 10rpx;
  325. }
  326. .mainBox{
  327. background: #FFFFFF;
  328. }
  329. .maintitle{
  330. font-size: 28rpx;
  331. font-family: PingFangSC-Medium, PingFang SC;
  332. font-weight: 500;
  333. color: #333333;
  334. text-align: center;
  335. line-height: 88rpx;
  336. border-bottom: 1px solid #EEEEEE;
  337. position: relative;
  338. }
  339. .backImg{
  340. width: 25rpx;height: 24rpx;margin-top: 4rpx;
  341. }
  342. .backBox{
  343. display: flex;position: absolute;
  344. left: 23rpx;top: 28rpx;
  345. }
  346. .backTxt{
  347. color: #3F90F7;font-weight: 400;font-size: 24rpx;line-height: 33rpx;
  348. }
  349. .mainLineJt{
  350. width: 25rpx;
  351. height: 24rpx;
  352. margin-top: 8rpx;
  353. }
  354. .mainLine{
  355. display: flex;
  356. border-bottom: 1px solid #EEEEEE;
  357. padding: 29rpx 24rpx;
  358. }
  359. .lineName{
  360. font-size: 26rpx;
  361. font-family: PingFangSC-Regular, PingFang SC;
  362. font-weight: 500;
  363. color: #333333;
  364. line-height: 40rpx;
  365. width: 570rpx;
  366. word-wrap: break-word; /*强制换行*/
  367. overflow: hidden; /*超出隐藏*/
  368. text-overflow: ellipsis;/*隐藏后添加省略号*/
  369. white-space: nowrap;/*强制不换行*/
  370. }
  371. .mainLine2{
  372. display: flex;
  373. justify-content: space-between;
  374. border-bottom: 1px solid #EEEEEE;
  375. padding:24rpx;
  376. }
  377. .lineName2{
  378. font-size: 28rpx;
  379. font-family: PingFangSC-Regular, PingFang SC;
  380. font-weight: 400;
  381. color: #333333;
  382. line-height: 40rpx;
  383. }
  384. .lineIMg{
  385. width: 110rpx;height: 110rpx;
  386. }
  387. .lineRIght{
  388. padding-left: 20rpx;
  389. }
  390. .lineBm{
  391. font-size: 24rpx;
  392. font-family: PingFangSC-Regular, PingFang SC;
  393. font-weight: 400;
  394. color: #999999;
  395. padding: 10rpx 0;
  396. }
  397. .linejs{
  398. font-size: 24rpx;
  399. font-family: PingFangSC-Regular, PingFang SC;
  400. font-weight: 400;
  401. color: #999999;
  402. width: 570rpx;
  403. word-wrap: break-word; /*强制换行*/
  404. overflow: hidden; /*超出隐藏*/
  405. text-overflow: ellipsis;/*隐藏后添加省略号*/
  406. white-space: nowrap;/*强制不换行*/
  407. }
  408. </style>