group.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422
  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. <image src="../../static/img/nav_icon_back.png" mode="aspectFit" class="backImg" @click="goback">
  9. </image>
  10. </view>
  11. <view class="zdyNavTitle">车型件</view>
  12. <view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
  13. <!-- <view v-else style="width: 50rpx;"></view> -->
  14. </view>
  15. </view>
  16. <view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
  17. <view style="height: 44px;"></view>
  18. <view class="top">
  19. <view class="topCont">
  20. <view class="carBox">
  21. <!-- <image src="../../static/img/nocar.png" mode="" class="carLogo"></image> -->
  22. <view class="carTxt" v-if="!description">{{brand_name}}</view>
  23. <view class="carTxt" v-if="description">{{description}}</view>
  24. <!-- <image src="../../static/img/jt.png" mode="" class="carJt"></image> -->
  25. </view>
  26. <view class="vinBox">
  27. <view class="vinBox2">
  28. <view class="vinB">VIN</view>
  29. <view class="vinNum">{{vin}}</view>
  30. </view>
  31. <view v-if="chexingMesList.length != 0" class="vinBox2">
  32. <view class="detail" @click="goCarDetail()">车型详情</view>
  33. <image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
  34. </view>
  35. </view>
  36. </view>
  37. </view>
  38. <!--车辆配置 -->
  39. <view class="mainBox" v-if="restrainShow">
  40. <view class="maintitle">{{caption}}</view>
  41. <view class="mainLine" v-for="(item,index) in restrains" @click="restrainsClick(item)">
  42. <view class="lineName">{{item.combine_cp}}</view>
  43. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  44. </view>
  45. </view>
  46. <!-- 总组 -->
  47. <view class="mainBox" v-if="groupShow">
  48. <view class="maintitle">{{caption}}</view>
  49. <view class="mainLine" v-for="(item,index) in zlist" @click="goTwo(item)">
  50. <view class="lineName">{{item.caption}}</view>
  51. <image src="../../static/img/jt.png" mode="" class="mainLineJt"></image>
  52. </view>
  53. </view>
  54. </view>
  55. </template>
  56. <script>
  57. export default {
  58. data() {
  59. return {
  60. vin: '',
  61. iStatusBarHeight: '',
  62. restrains: '',
  63. zlist: '',
  64. brand_name: '',
  65. brand_id: '',
  66. access_time: '',
  67. zzTime: '',
  68. caption: '',
  69. restrainShow: false,
  70. groupShow: false,
  71. param: '',
  72. token: '',
  73. epc_id: '',
  74. chexingMesList:[],
  75. chexing:'',
  76. description:'',
  77. }
  78. },
  79. onLoad(opt) {
  80. this.vin = opt.vin
  81. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  82. this.getData()
  83. },
  84. methods: {
  85. getData() {
  86. uni.showLoading({
  87. title: '加载中'
  88. });
  89. this.$http('advancedEpc/getVinGroup', {
  90. vin: this.vin,
  91. }, 'GET').then(res => {
  92. uni.hideLoading();
  93. //console.log(res.data.number);
  94. if (res.data.number == 200 || res.data.number == 5212) {
  95. this.brand_name = res.data.result.brand_name;
  96. this.brand_id = res.data.result.brand_id;
  97. this.access_time = res.data.result.access_time;
  98. this.caption = res.data.result.caption
  99. this.epc_id = res.data.result.epc_id;
  100. if (res.data.result.restrains.length > 0) {
  101. this.restrains = res.data.result.restrains;
  102. this.restrainShow = true;
  103. } else {
  104. this.zzTime = res.data.result.access_time;
  105. this.zlist = res.data.result.list;
  106. this.restrainShow = false;
  107. this.groupShow = true;
  108. this.token = res.data.result.list[0].token;
  109. this.param = res.data.result.list[0].param;
  110. if(res.data.result.vehicle.description){
  111. this.description=res.data.result.vehicle.description
  112. }
  113. }
  114. if (Object.keys(res.data.result.vehicle).length != 0) {
  115. this.chexingMesList = res.data.result.vehicle.tree;
  116. this.chexing = res.data.result.vehicle.description;
  117. }
  118. } else {
  119. uni.showToast({
  120. title: res.data.message,
  121. icon: 'none',
  122. duration: 3000
  123. });
  124. }
  125. });
  126. },
  127. restrainsClick(item) {
  128. this.param = item.param;
  129. this.token = item.token;
  130. this.getcarVinGroup()
  131. },
  132. getcarVinGroup() {
  133. uni.showLoading({
  134. title: '加载中'
  135. });
  136. this.$http('advancedEpc/getVinGroup', {
  137. vin: this.vin,
  138. access_time: this.access_time,
  139. param: this.param,
  140. token: this.token
  141. }, 'GET').then(res => {
  142. uni.hideLoading();
  143. //console.log(res.data.number);
  144. if (res.data.number == 200 || res.data.number == 5212) {
  145. this.brand_name = res.data.result.brand_name;
  146. this.access_time = res.data.result.access_time;
  147. this.caption = res.data.result.caption
  148. if (res.data.result.restrains.length > 0) {
  149. this.restrains = res.data.result.restrains;
  150. this.restrainShow = true;
  151. this.token = res.data.result.restrains[0].token;
  152. this.param = res.data.result.restrains[0].param;
  153. } else {
  154. this.token = res.data.result.list[0].token;
  155. this.param = res.data.result.list[0].param;
  156. this.zzTime = res.data.result.access_time;
  157. this.zlist = res.data.result.list;
  158. this.restrainShow = false;
  159. this.groupShow = true;
  160. if(res.data.result.vehicle.description){
  161. this.description=res.data.result.vehicle.description
  162. }
  163. }
  164. if (Object.keys(res.data.result.vehicle).length != 0) {
  165. this.chexingMesList = res.data.result.vehicle.tree;
  166. this.chexing = res.data.result.vehicle.description;
  167. }
  168. } else {
  169. uni.showToast({
  170. title: res.data.message,
  171. icon: 'none',
  172. duration: 3000
  173. });
  174. }
  175. });
  176. },
  177. goCarDetail() {
  178. var that = this;
  179. uni.setStorage({
  180. key: 'chexing',
  181. data: that.chexing,
  182. success: function() {
  183. uni.setStorage({
  184. key: 'chexingMesList',
  185. data: that.chexingMesList,
  186. success: function() {
  187. uni.navigateTo({
  188. url: 'CarDetail'
  189. })
  190. }
  191. });
  192. }
  193. });
  194. },
  195. goOemSearch() {
  196. uni.navigateTo({
  197. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&vin=' + this.vin + '&param=' + this.param +
  198. '&token=' + this.token + '&access_time=' + this.access_time
  199. })
  200. },
  201. goback() {
  202. console.log('返回');
  203. uni.navigateBack({})
  204. },
  205. goTwo(item) {
  206. var that = this;
  207. uni.setStorage({
  208. key: 'chexing',
  209. data: that.chexing,
  210. success: function() {
  211. uni.setStorage({
  212. key: 'chexingMesList',
  213. data: that.chexingMesList,
  214. success: function() {
  215. uni.navigateTo({
  216. url: 'modelTwo?vin=' + that.vin + '&zzTime=' + that.zzTime + '&param=' + item.param +
  217. '&token=' + item.token + '&epc_id=' + that.epc_id+'&description='+that.description
  218. })
  219. }
  220. });
  221. }
  222. });
  223. }
  224. }
  225. }
  226. </script>
  227. <style scoped>
  228. .content {
  229. background: #F4F5F7;
  230. min-height: 100vh;
  231. padding-bottom: constant(safe-area-inset-bottom);
  232. padding-bottom: env(safe-area-inset-bottom);
  233. }
  234. .zdyNavBox {
  235. width: 100vw;
  236. background: #FFFFFF;
  237. position: fixed;
  238. top: 0;
  239. left: 0;
  240. z-index: 9999999;
  241. }
  242. .zdyNav {
  243. height: 44px;
  244. display: flex;
  245. justify-content: space-between;
  246. align-items: center;
  247. padding: 0 24rpx;
  248. }
  249. .backImg {
  250. width: 22rpx;
  251. height: 40rpx;
  252. }
  253. .homeImg {
  254. width: 44rpx;
  255. height: 44rpx;
  256. }
  257. .zdyNavLeft {
  258. display: flex;
  259. align-items: center;
  260. width: 120rpx;
  261. }
  262. .zdyNavTitle {
  263. height: 44px;
  264. background: #FFFFFF;
  265. text-align: center;
  266. font-size: 34rpx;
  267. line-height: 44px;
  268. }
  269. .zdyNavRight {
  270. height: 44px;
  271. background: #FFFFFF;
  272. text-align: center;
  273. font-size: 28rpx;
  274. line-height: 44px;
  275. color: #3F90F7;
  276. width: 120rpx;
  277. }
  278. .top {
  279. padding: 20rpx 0;
  280. }
  281. .topCont {
  282. width: 750rpx;
  283. height: 160rpx;
  284. background: #FFFFFF;
  285. }
  286. .carLogo {
  287. width: 72rpx;
  288. height: 72rpx;
  289. }
  290. .carTxt {
  291. font-size: 28rpx;
  292. font-family: PingFangSC-Medium, PingFang SC;
  293. font-weight: 500;
  294. color: #333333;
  295. line-height: 36rpx;
  296. width: 606rpx;
  297. }
  298. .carJt {
  299. width: 25rpx;
  300. height: 24rpx;
  301. margin-top: 6rpx;
  302. }
  303. .carBox {
  304. display: flex;
  305. justify-content: space-between;
  306. padding: 30rpx 24rpx 24rpx 34rpx;
  307. }
  308. .vinBox {
  309. display: flex;
  310. justify-content: space-between;
  311. padding-left: 34rpx;
  312. padding-right: 24rpx;
  313. }
  314. .vinBox2 {
  315. display: flex;
  316. align-items: center;
  317. }
  318. .detail {
  319. color: #3F90F7;
  320. font-size: 24rpx;
  321. margin-right: 10rpx;
  322. }
  323. .vinB {
  324. background: #F19D01;
  325. width: 60rpx;
  326. height: 30rpx;
  327. text-align: center;
  328. line-height: 30rpx;
  329. color: #FFFFFF;
  330. font-size: 22rpx;
  331. border-radius: 5rpx;
  332. }
  333. .vinNum {
  334. color: #999999;
  335. font-size: 24rpx;
  336. line-height: 30rpx;
  337. padding-left: 10rpx;
  338. }
  339. .mainBox {
  340. background: #FFFFFF;
  341. }
  342. .maintitle {
  343. font-size: 28rpx;
  344. font-family: PingFangSC-Medium, PingFang SC;
  345. font-weight: 500;
  346. color: #333333;
  347. text-align: center;
  348. line-height: 88rpx;
  349. border-bottom: 1px solid #EEEEEE;
  350. }
  351. .mainLineJt {
  352. width: 25rpx;
  353. height: 24rpx;
  354. margin-top: 8rpx;
  355. }
  356. .mainLine {
  357. display: flex;
  358. justify-content: space-between;
  359. border-bottom: 1px solid #EEEEEE;
  360. padding: 24rpx;
  361. }
  362. .lineName {
  363. font-size: 28rpx;
  364. font-family: PingFangSC-Regular, PingFang SC;
  365. font-weight: 400;
  366. color: #333333;
  367. line-height: 40rpx;
  368. }
  369. </style>