Pārlūkot izejas kodu

Merge branch 'master' of http://47.98.226.240:3000/twt/epc

* 'master' of http://47.98.226.240:3000/twt/epc:
  111
  总组

# Conflicts:
#	pages/mobile/SelectCarTwo.vue
guo 2 gadi atpakaļ
vecāks
revīzija
a47f04940f

+ 7 - 1
common/request.js

@@ -1,7 +1,13 @@
 import { getHashQuery } from '../utils/index.js'
 var url='http://'+getHashQuery('url')+'/'
 //const baseUrl = url
-const baseUrl = 'http://api.dms.66km.com.cn/'
+console.log(getHashQuery('url'))
+if(getHashQuery('url')){
+	var baseUrl =url
+}else{
+   var baseUrl = 'http://api.dms.66km.com.cn/'	
+}
+
 const burl2=url 
 import md5 from './MD5.js'
 var token=getHashQuery('token')

+ 34 - 15
pages/mobile/SelectCarTwo.vue

@@ -4,9 +4,11 @@
 		<view class="zdyNavBox">
 			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 			<view class="zdyNav">
-				<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
-						style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
-				
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					
+				</view>
 				<view class="zdyNavTitle">车型</view>
 				<view class="zdyNavRight" @click="goOemSearch">OEM搜索</view>
 
@@ -29,6 +31,7 @@
 			</view>
 		</view>
 
+
 		
 		<!-- 配置 -->
 		<view v-if="peizhiShow" class="cangBox">
@@ -38,6 +41,7 @@
 			</view>
 		</view>
 		
+
 	</view>
 </template>
 
@@ -56,7 +60,9 @@
 				carModelShow:false,
 				peizhiShow:false,
 				xingList: [],
-				peizhiList:[],
+				peizhiList:[],
+				modelname:'',
+
 			}
 		},
 		onLoad(opt) {
@@ -68,20 +74,31 @@
 			this.getItemData();
 		},
 		methods: {
-			goNext(item) {
+			goNext(item) {
+				this.token = item.token;
+				this.param = item.param;
+				
+				
 				if (item.next_restrain == 1) {
-					this.token = item.token;
-					this.param = item.param;
-					this.title += ' > ' + item.model_name;
+					this.title += ' > ' + item.model_name;
+					this.modelname=item.model_name
 					this.getYueSuData(item)
+				}
+				else{
+					this.gogroup(item);
 				}
 			},
-			goNext2(item) {
+			goNext2(item) {
+				this.token = item.token;
+				this.param = item.param;
+				
+				
 				if (item.next_restrain == 1) {
-					this.token = item.token;
-					this.param = item.param;
-					this.title += ' > ' + item.year;
+					this.title += ' > ' + item.combine_cp;
 					this.getYueSuData(item)
+				}
+				else{
+					this.gogroup(item);
 				}
 			},
 			//获取车型约束列表
@@ -130,9 +147,9 @@
 				});
 			},
 			
-			goVinDetail() {
+			gogroup(item) {
 				uni.navigateTo({
-					url: 'VinDetail'
+					url: 'group?type=2&token='+item.token+'&param='+item.param+'&access_time='+this.access_time+'&epc_id='+this.epc_id+'&modelname='+this.modelname
 				})
 			},
 
@@ -175,7 +192,9 @@
 		align-items: center;
 		padding: 14rpx 6rpx;
 	}
-
+	.zdyNavLeft{
+		width: 120rpx;
+	}
 
 	.zdyNavTitle {
 		background: #FFFFFF;

+ 72 - 5
pages/mobile/group.vue

@@ -5,8 +5,11 @@
 		<view class="zdyNavBox">
 			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 			<view class="zdyNav">
-				<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>
-				
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					
+				</view>
 				<view class="zdyNavTitle">车型件</view>
 				<view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
 				<view v-else style="width: 120rpx;"></view>
@@ -77,14 +80,76 @@
 				chexingMesList:[],
 				chexing:'',
 				description:'',
+				type:'',
 			}
 		},
 		onLoad(opt) {
-			this.vin = opt.vin
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-			this.getData()
+			if(opt.type==2){
+				this.type=2
+				this.token=opt.token;
+				this.param=opt.param;
+				this.access_time=opt.access_time;
+				this.epc_id=opt.epc_id;
+				this.description=opt.modelname;
+				//车型点选
+				this.getModelGroup()
+			}else{
+				this.vin = opt.vin
+				this.getData()
+			}
+			
 		},
 		methods: {
+			getModelGroup(){
+				uni.showLoading({
+					title: '加载中'
+				});
+				this.$http('advancedEpc/getModelGroup', {
+					token: this.token,
+				    param: this.param,
+					epc_id:this.epc_id,
+					access_time:this.access_time
+				}, 'GET').then(res => {
+					uni.hideLoading();
+					//console.log(res.data.number);
+					if (res.data.number == 200 || res.data.number == 5212) {
+						this.brand_name = res.data.result.brand_name;
+						this.brand_id = res.data.result.brand_id;
+						this.access_time = res.data.result.access_time;
+						this.caption = res.data.result.caption
+						this.epc_id = res.data.result.epc_id;
+				
+						if (res.data.result.restrains.length > 0) {
+							this.restrains = res.data.result.restrains;
+							this.restrainShow = true;
+							
+						} else {
+							this.zzTime = res.data.result.access_time;
+							this.zlist = res.data.result.list;
+							this.restrainShow = false;
+							this.groupShow = true;
+							this.token = res.data.result.list[0].token;
+							this.param = res.data.result.list[0].param;
+							if(res.data.result.vehicle.description){
+								this.description=res.data.result.vehicle.description
+							}
+						}
+						if (Object.keys(res.data.result.vehicle).length != 0)  {
+							this.chexingMesList = res.data.result.vehicle.tree;
+							this.chexing = res.data.result.vehicle.description;
+						}
+					} else {
+				
+						uni.showToast({
+							title: res.data.message,
+							icon: 'none',
+							duration: 3000
+						});
+					}
+				
+				});
+			},
 			getData() {
 				uni.showLoading({
 					title: '加载中'
@@ -267,7 +332,9 @@
 		padding: 14rpx 6rpx;
 	}
 	
-	
+	.zdyNavLeft{
+		width: 120rpx;
+	}
 	.zdyNavTitle {
 		background: #FFFFFF;
 		text-align: center;

+ 8 - 3
pages/mobile/homePage.vue

@@ -4,8 +4,11 @@
 		<view class="zdyNavBox">
 			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 			<view class="zdyNav">
-				<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon" style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
-				
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					
+				</view>
 				<view class="zdyNavTitle">车型件</view>
 				<view class="zdyNavRight"></view>
 				
@@ -126,7 +129,9 @@
 		align-items: center;
 		padding: 14rpx 6rpx;
 	}
-
+	.zdyNavLeft{
+		
+	}
 	
 	.zdyNavTitle {
 		background: #FFFFFF;

+ 14 - 7
pages/mobile/modelTwo.vue

@@ -4,8 +4,11 @@
 		<view class="zdyNavBox">
 			<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
 			<view class="zdyNav">
-				<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>
-				
+				<view class="zdyNavLeft">
+					<div @click="goback" class="uni-page-head-btn"><i class="uni-btn-icon"
+							style="color: rgb(0, 0, 0); font-size: 27px;"></i></div>
+					
+				</view>
 				<view class="zdyNavTitle">车型件</view>
 				<view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
 				<view v-else style="width: 120rpx;"></view>
@@ -28,7 +31,7 @@
 						<view class="vinB">VIN</view>
 						<view class="vinNum">{{vin}}</view>
 					</view>
-					<view class="vinBox2">
+					<view class="vinBox2"  v-if="chexingMesList.length != 0">
 						<view class="detail" @click="goCarDetail()">车型详情</view>
 						<image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
 					</view>
@@ -103,6 +106,7 @@
 				iStatusBarHeight: '',
 				epc_id:'',
 				description:'',
+				chexingMesList:[],
 			}
 		},
 		onLoad(opt) {
@@ -114,6 +118,7 @@
 			this.description=opt.description;
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
 			this.getData()
+			this.chexingMesList = uni.getStorageSync('chexingMesList');
 		},
 		methods: {
 			goOemSearch(){
@@ -225,8 +230,8 @@
 					vin: this.vin,
 					access_time: this.zzTime,
 					param: this.param,
-					token: this.token
-
+					token: this.token,
+                    epc_id:this.epc_id,
 				}, 'GET').then(res => {
 					uni.hideLoading();
 					//console.log(res.data.number);
@@ -272,7 +277,7 @@
 					success: function() {
 						uni.navigateTo({
 							url: 'vinDetail?vin=' + that.vin + '&token=' + item.token + '&param=' +
-								item.param + '&access_time=' + that.access_time + '&tabIndex=' + index
+								item.param + '&access_time=' + that.access_time + '&tabIndex=' + index+'&epc_id='+that.epc_id
 						})
 					}
 				});
@@ -360,7 +365,9 @@
 		align-items: center;
 		padding: 14rpx 6rpx;
 	}
-	
+	.zdyNavLeft{
+		width: 120rpx;
+	}
 	
 	.zdyNavTitle {
 		background: #FFFFFF;

+ 4 - 1
pages/mobile/vinDetail.vue

@@ -74,7 +74,8 @@
 				bannerArr: [],
 				tabIndex: 1,
 				page: 1,
-				total_page: 1
+				total_page: 1,
+				epc_id:'',
 			}
 		},
 		onLoad(opt) {
@@ -85,6 +86,7 @@
 			this.token = opt.token;
 			this.param = opt.param;
 			this.access_time = opt.access_time;
+			this.epc_id=opt.epc_id
 			this.getItemData();
 
 
@@ -126,6 +128,7 @@
 					token: this.token,
 					param: this.param,
 					access_time: this.access_time,
+					epc_id:this.epc_id
 				}, 'GET').then(res => {
 					uni.hideLoading();
 					this.epc_id = res.data.result.epc_id;