group.vue 8.1 KB

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