group.vue 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339
  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="carPeizhi.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">{{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. access_time:'',
  65. zzTime:'',
  66. caption:'',
  67. restrainShow:false,
  68. groupShow:false,
  69. param:'',
  70. token:'',
  71. epc_id:'',
  72. carPeizhi:''
  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.access_time=res.data.result.access_time;
  93. this.caption=res.data.result.caption
  94. this.epc_id = res.data.result.epc_id;
  95. if(res.data.result.restrains.length>0){
  96. this.restrains=res.data.result.restrains;
  97. this.restrainShow=true;
  98. }else{
  99. this.zzTime=res.data.result.access_time;
  100. this.zlist=res.data.result.list;
  101. this.restrainShow=false;
  102. this.groupShow=true;
  103. }
  104. }else{
  105. uni.showToast({
  106. title: res.data.message,
  107. icon: 'none',
  108. duration: 3000
  109. });
  110. }
  111. });
  112. },
  113. restrainsClick(item){
  114. this.param=item.param;
  115. this.token=item.token;
  116. this.carPeizhi = item.combine_cp;
  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'
  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+'&token='+item.token
  170. })
  171. }
  172. }
  173. }
  174. </script>
  175. <style scoped>
  176. .content{
  177. background: #F4F5F7;
  178. min-height: 100vh;
  179. padding-bottom: constant(safe-area-inset-bottom);
  180. padding-bottom: env(safe-area-inset-bottom);
  181. }
  182. .zdyNavBox {
  183. width: 100vw;
  184. background: #FFFFFF;
  185. position: fixed;
  186. top: 0;
  187. left: 0;
  188. z-index: 9999999;
  189. }
  190. .zdyNav {
  191. height: 44px;
  192. display: flex;
  193. justify-content: space-between;
  194. align-items: center;
  195. }
  196. .backImg {
  197. width: 44rpx;
  198. height: 44rpx;
  199. margin-left: 10rpx;
  200. margin-right: 20rpx;
  201. }
  202. .homeImg {
  203. width: 44rpx;
  204. height: 44rpx;
  205. }
  206. .zdyNavLeft {
  207. display: flex;
  208. align-items: center;
  209. }
  210. .zdyNavTitle {
  211. height: 44px;
  212. background: #FFFFFF;
  213. text-align: center;
  214. font-size: 34rpx;
  215. line-height: 44px;
  216. }
  217. .zdyNavRight{
  218. height: 44px;
  219. background: #FFFFFF;
  220. text-align: center;
  221. font-size: 28rpx;
  222. line-height: 44px;
  223. color: #3F90F7;
  224. margin-right: 24rpx;
  225. }
  226. .top{
  227. padding: 20rpx 0;
  228. }
  229. .topCont{
  230. width: 750rpx;
  231. height: 185rpx;
  232. background: #FFFFFF;
  233. }
  234. .carLogo{
  235. width: 72rpx;height: 72rpx;
  236. }
  237. .carTxt{
  238. font-size: 28rpx;
  239. font-family: PingFangSC-Medium, PingFang SC;
  240. font-weight: 500;
  241. color: #333333;
  242. line-height: 36rpx;
  243. width: 606rpx;
  244. }
  245. .carJt{
  246. width: 25rpx;
  247. height: 24rpx;
  248. margin-top: 6rpx;
  249. }
  250. .carBox{
  251. display: flex;
  252. justify-content: space-between;
  253. padding: 30rpx 24rpx 24rpx 24rpx;
  254. }
  255. .vinBox{
  256. display: flex;
  257. justify-content: space-between;
  258. padding-left: 120rpx;
  259. padding-right: 24rpx;
  260. }
  261. .vinBox2{
  262. display: flex;
  263. align-items: center;
  264. }
  265. .detail{
  266. color: #3F90F7;
  267. font-size: 24rpx;
  268. margin-right: 10rpx;
  269. }
  270. .vinB{
  271. background: #F19D01;
  272. width: 60rpx;
  273. height: 30rpx;
  274. text-align: center;
  275. line-height: 30rpx;
  276. color: #FFFFFF;
  277. font-size: 22rpx;
  278. border-radius: 5rpx;
  279. }
  280. .vinNum{
  281. color: #999999;font-size: 24rpx;line-height: 30rpx;padding-left: 10rpx;
  282. }
  283. .mainBox{
  284. background: #FFFFFF;
  285. }
  286. .maintitle{
  287. font-size: 28rpx;
  288. font-family: PingFangSC-Medium, PingFang SC;
  289. font-weight: 500;
  290. color: #333333;
  291. text-align: center;
  292. line-height: 88rpx;
  293. border-bottom: 1px solid #EEEEEE;
  294. }
  295. .mainLineJt{
  296. width: 25rpx;
  297. height: 24rpx;
  298. margin-top: 8rpx;
  299. }
  300. .mainLine{
  301. display: flex;
  302. justify-content: space-between;
  303. border-bottom: 1px solid #EEEEEE;
  304. padding:24rpx;
  305. }
  306. .lineName{
  307. font-size: 28rpx;
  308. font-family: PingFangSC-Regular, PingFang SC;
  309. font-weight: 400;
  310. color: #333333;
  311. line-height: 40rpx;
  312. }
  313. </style>