group.vue 7.2 KB

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