group.vue 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  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="carPeizhi.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. }
  74. },
  75. onLoad(opt) {
  76. this.vin = opt.vin
  77. this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
  78. this.getData()
  79. },
  80. methods: {
  81. getData() {
  82. uni.showLoading({
  83. title: '加载中'
  84. });
  85. this.$http('advancedEpc/getVinGroup', {
  86. vin: this.vin,
  87. }, 'GET').then(res => {
  88. uni.hideLoading();
  89. //console.log(res.data.number);
  90. if (res.data.number == 200 || res.data.number == 5212) {
  91. this.brand_name = res.data.result.brand_name;
  92. this.brand_id = res.data.result.brand_id;
  93. this.access_time = res.data.result.access_time;
  94. this.caption = res.data.result.caption
  95. this.epc_id = res.data.result.epc_id;
  96. if (res.data.result.restrains.length > 0) {
  97. this.restrains = res.data.result.restrains;
  98. this.restrainShow = true;
  99. } else {
  100. this.zzTime = res.data.result.access_time;
  101. this.zlist = res.data.result.list;
  102. this.restrainShow = false;
  103. this.groupShow = true;
  104. }
  105. } else {
  106. uni.showToast({
  107. title: res.data.message,
  108. icon: 'none',
  109. duration: 3000
  110. });
  111. }
  112. });
  113. },
  114. restrainsClick(item) {
  115. this.param = item.param;
  116. this.token = item.token;
  117. this.getcarVinGroup()
  118. },
  119. getcarVinGroup() {
  120. uni.showLoading({
  121. title: '加载中'
  122. });
  123. this.$http('advancedEpc/getVinGroup', {
  124. vin: this.vin,
  125. access_time: this.access_time,
  126. param: this.param,
  127. token: this.token
  128. }, 'GET').then(res => {
  129. uni.hideLoading();
  130. //console.log(res.data.number);
  131. if (res.data.number == 200 || res.data.number == 5212) {
  132. this.brand_name = res.data.result.brand_name;
  133. this.access_time = res.data.result.access_time;
  134. this.caption = res.data.result.caption
  135. if (res.data.result.restrains.length > 0) {
  136. this.restrains = res.data.result.restrains;
  137. this.restrainShow = true;
  138. } else {
  139. this.zzTime = res.data.result.access_time;
  140. this.zlist = res.data.result.list;
  141. this.restrainShow = false;
  142. this.groupShow = true;
  143. }
  144. } else {
  145. uni.showToast({
  146. title: res.data.message,
  147. icon: 'none',
  148. duration: 3000
  149. });
  150. }
  151. });
  152. },
  153. goCarDetail() {
  154. uni.navigateTo({
  155. url: 'CarDetail?model_id=' + this.brand_id
  156. })
  157. },
  158. goOemSearch() {
  159. uni.navigateTo({
  160. url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id
  161. })
  162. },
  163. goback() {
  164. console.log('返回');
  165. uni.navigateBack({})
  166. },
  167. goTwo(item) {
  168. uni.navigateTo({
  169. url: 'modelTwo?vin=' + this.vin + '&zzTime=' + this.zzTime + '&param=' + item.param +
  170. '&token=' + item.token + '&epc_id=' + this.epc_id
  171. })
  172. }
  173. }
  174. }
  175. </script>
  176. <style scoped>
  177. .content {
  178. background: #F4F5F7;
  179. min-height: 100vh;
  180. padding-bottom: constant(safe-area-inset-bottom);
  181. padding-bottom: env(safe-area-inset-bottom);
  182. }
  183. .zdyNavBox {
  184. width: 100vw;
  185. background: #FFFFFF;
  186. position: fixed;
  187. top: 0;
  188. left: 0;
  189. z-index: 9999999;
  190. }
  191. .zdyNav {
  192. height: 44px;
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. }
  197. .backImg {
  198. width: 44rpx;
  199. height: 44rpx;
  200. margin-left: 10rpx;
  201. margin-right: 20rpx;
  202. }
  203. .homeImg {
  204. width: 44rpx;
  205. height: 44rpx;
  206. }
  207. .zdyNavLeft {
  208. display: flex;
  209. align-items: center;
  210. }
  211. .zdyNavTitle {
  212. height: 44px;
  213. background: #FFFFFF;
  214. text-align: center;
  215. font-size: 34rpx;
  216. line-height: 44px;
  217. }
  218. .zdyNavRight {
  219. height: 44px;
  220. background: #FFFFFF;
  221. text-align: center;
  222. font-size: 28rpx;
  223. line-height: 44px;
  224. color: #3F90F7;
  225. margin-right: 24rpx;
  226. }
  227. .top {
  228. padding: 20rpx 0;
  229. }
  230. .topCont {
  231. width: 750rpx;
  232. height: 185rpx;
  233. background: #FFFFFF;
  234. }
  235. .carLogo {
  236. width: 72rpx;
  237. height: 72rpx;
  238. }
  239. .carTxt {
  240. font-size: 28rpx;
  241. font-family: PingFangSC-Medium, PingFang SC;
  242. font-weight: 500;
  243. color: #333333;
  244. line-height: 36rpx;
  245. width: 606rpx;
  246. }
  247. .carJt {
  248. width: 25rpx;
  249. height: 24rpx;
  250. margin-top: 6rpx;
  251. }
  252. .carBox {
  253. display: flex;
  254. justify-content: space-between;
  255. padding: 30rpx 24rpx 24rpx 24rpx;
  256. }
  257. .vinBox {
  258. display: flex;
  259. justify-content: space-between;
  260. padding-left: 120rpx;
  261. padding-right: 24rpx;
  262. }
  263. .vinBox2 {
  264. display: flex;
  265. align-items: center;
  266. }
  267. .detail {
  268. color: #3F90F7;
  269. font-size: 24rpx;
  270. margin-right: 10rpx;
  271. }
  272. .vinB {
  273. background: #F19D01;
  274. width: 60rpx;
  275. height: 30rpx;
  276. text-align: center;
  277. line-height: 30rpx;
  278. color: #FFFFFF;
  279. font-size: 22rpx;
  280. border-radius: 5rpx;
  281. }
  282. .vinNum {
  283. color: #999999;
  284. font-size: 24rpx;
  285. line-height: 30rpx;
  286. padding-left: 10rpx;
  287. }
  288. .mainBox {
  289. background: #FFFFFF;
  290. }
  291. .maintitle {
  292. font-size: 28rpx;
  293. font-family: PingFangSC-Medium, PingFang SC;
  294. font-weight: 500;
  295. color: #333333;
  296. text-align: center;
  297. line-height: 88rpx;
  298. border-bottom: 1px solid #EEEEEE;
  299. }
  300. .mainLineJt {
  301. width: 25rpx;
  302. height: 24rpx;
  303. margin-top: 8rpx;
  304. }
  305. .mainLine {
  306. display: flex;
  307. justify-content: space-between;
  308. border-bottom: 1px solid #EEEEEE;
  309. padding: 24rpx;
  310. }
  311. .lineName {
  312. font-size: 28rpx;
  313. font-family: PingFangSC-Regular, PingFang SC;
  314. font-weight: 400;
  315. color: #333333;
  316. line-height: 40rpx;
  317. }
  318. </style>