group.vue 9.3 KB

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