Browse Source

1.车型详情

guo 2 years ago
parent
commit
ead855671a

+ 13 - 56
pages/mobile/CarDetail.vue

@@ -2,33 +2,16 @@
 	<view class="box">
 		<view class="mainBox">
 			
-			<view class="workBox2" v-for="(item,index) in itemList" :key="index">
+			<view class="workBox2" v-for="(item,index) in chexingMesList" :key="index">
 					
-					<view class="titleBox">分组1</view>
-					<view class="comtent2">
-						<view class="left2">标题</view>
-						<view class="right2"></view>
+					<view class="titleBox">{{item.title}}</view>
+					<view v-for="(v,index2) in item.content" :key="index2">
+						<view class="comtent2">
+							<view class="left2">{{v.k}}</view>
+							<view class="right2">{{v.v}}</view>
+						</view>
 					</view>
-					<view class="comtent2">
-						<view class="left2">零件编号</view>
-						<view class="right2">{{mesData.partsnum}}</view>
-					</view>
-					
-					<view class="comtent2">
-						<view class="left2">名称</view>
-						<view class="right2">{{mesData.caption}}</view>
-					</view>
-					<view class="comtent2">
-						<view class="left2">位置</view>
-						<view class="right2">{{weizhi}}</view>
-					</view>
-					
-					<view class="comtent2">
-						<view class="left2">用量</view>
-						<view class="right2">{{yongliang}}</view>
-					</view>
-					
-								
+						
 				
 			</view>
 		</view>
@@ -39,43 +22,17 @@
 	export default {
 		data() {
 			return {
-				epc_id: '',
-				partsnum: '',
-				weizhi: '',
-				yongliang: '',
-				model_id:'',
-				mesData:{}
+				
+				chexingMesList:[],
 			}
 		},
 		onLoad(opt) {
-			console.log('opt+',opt);
-			this.epc_id = opt.epc_id;
-			this.partsnum = opt.partsnum;
-			this.weizhi = opt.weizhi;
-			this.yongliang = opt.yongliang;
-			this.model_id = opt.model_id;
-			this.getItemData();
+			var list = uni.getStorageSync('chexingMesList');
+			this.chexingMesList = list[0].views;
+			console.log('list',this.chexingMesList);
 		},
 		methods: {
 			
-			// 配件信息
-			getItemData() {
-				uni.showLoading({
-					title: '加载中'
-				});
-				this.$http('advancedEpc/findApplicableModels', {
-					model_id: this.model_id,
-					
-			
-				}, 'GET').then(res => {
-					uni.hideLoading();
-			
-					this.mesData = res.data.result;
-			
-			
-			
-				});
-			},
 		}
 	}
 </script>

+ 7 - 1
pages/mobile/OemSearch.vue

@@ -114,7 +114,13 @@
 					else if (list.length != 0) {
 						this.itemList = this.itemList.concat(list)
 					}
-					
+					if (this.itemList.length == 0) {
+						uni.showToast({
+							title: '暂无符合要求的配件',
+							icon: 'none',
+							duration: 2000
+						});
+					}
 					
 
 				});

+ 2 - 2
pages/mobile/SonGroup.vue

@@ -2,10 +2,10 @@
 	<view class="box">
 		<view class="mainBox">
 
-			<view class="workBox2" v-for="(item,index) in itemList" :key="index">
+			<view @click="goModelThree(item)"  class="workBox2" v-for="(item,index) in itemList" :key="index">
 				<view class="leftBox">
 					<view class="name">{{item.caption}}</view>
-					<view @click="goModelThree(item)" class="code">{{item.partnum}}</view>
+					<view class="code">{{item.partnum}}</view>
 					<view class="comment">{{item.name}}</view>
 					<view class="comment">{{item.group}}</view>
 				</view>

+ 30 - 11
pages/mobile/group.vue

@@ -11,8 +11,8 @@
 
 				</view>
 				<view class="zdyNavTitle">车型件</view>
-				<view class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
-				<!-- <view v-else style="width: 50rpx;"></view> -->
+				<view v-if="param.length != 0" class="zdyNavRight" @click="goOemSearch()">OEM搜索</view>
+				<view v-else style="width: 50rpx;"></view>
 			</view>
 		</view>
 		<view class="status_bar" :style="{height: iStatusBarHeight + 'px'}"></view>
@@ -31,7 +31,7 @@
 						<view class="vinB">VIN</view>
 						<view class="vinNum">{{vin}}</view>
 					</view>
-					<view  v-if="chexingMes.length != 0" class="vinBox2">
+					<view  v-if="chexingMesList.length != 0" class="vinBox2">
 						<view class="detail" @click="goCarDetail()">车型详情</view>
 						<image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
 					</view>
@@ -75,7 +75,7 @@
 				param: '',
 				token: '',
 				epc_id: '',
-				chexingMes:[],
+				chexingMesList:[],
 			}
 		},
 		onLoad(opt) {
@@ -103,7 +103,8 @@
 				
 						if (res.data.result.restrains.length > 0) {
 							this.restrains = res.data.result.restrains;
-							this.restrainShow = true;
+							this.restrainShow = true;
+							
 						} else {
 							this.zzTime = res.data.result.access_time;
 							this.zlist = res.data.result.list;
@@ -111,6 +112,9 @@
 							this.groupShow = true;
 							this.token = res.data.result.list[0].token;
 							this.param = res.data.result.list[0].param;
+						}
+						if (Object.keys(res.data.result.vehicle).length != 0)  {
+							this.chexingMesList = res.data.result.vehicle.tree
 						}
 					} else {
 
@@ -128,7 +132,8 @@
 				this.token = item.token;
 				
 				this.getcarVinGroup()
-			},
+			},
+			
 			getcarVinGroup() {
 				uni.showLoading({
 					title: '加载中'
@@ -147,7 +152,9 @@
 						this.caption = res.data.result.caption
 						if (res.data.result.restrains.length > 0) {
 							this.restrains = res.data.result.restrains;
-							this.restrainShow = true;
+							this.restrainShow = true;
+							this.token = res.data.result.restrains[0].token;
+							this.param = res.data.result.restrains[0].param;
 						} else {
 							this.token = res.data.result.list[0].token;
 							this.param = res.data.result.list[0].param;
@@ -155,6 +162,10 @@
 							this.zlist = res.data.result.list;
 							this.restrainShow = false;
 							this.groupShow = true;
+						}
+						
+						if (Object.keys(res.data.result.vehicle).length != 0) {
+							this.chexingMesList = res.data.result.vehicle.tree
 						}
 					} else {
 						uni.showToast({
@@ -166,10 +177,18 @@
 
 				});
 			},
-			goCarDetail() {
-				uni.navigateTo({
-					url: 'CarDetail'
-				})
+			goCarDetail() {
+				var that = this;
+				uni.setStorage({
+					key: 'chexingMesList',
+					data: that.chexingMesList,
+					success: function() {
+						uni.navigateTo({
+							url: 'CarDetail'
+						})
+					}
+				});
+				
 			},
 			goOemSearch() {
 				uni.navigateTo({

+ 6 - 5
pages/mobile/modelTwo.vue

@@ -30,10 +30,10 @@
 						<view class="vinB">VIN</view>
 						<view class="vinNum">{{vin}}</view>
 					</view>
-					<!-- <view class="vinBox2">
+					<view class="vinBox2">
 						<view class="detail" @click="goCarDetail()">车型详情</view>
 						<image src="../../static/img/icon_arrow_blue_r@2x.png" mode="" style="width: 24rpx; height: 24rpx"></image>
-					</view> -->
+					</view>
 				</view>
 			</view>
 		</view>
@@ -96,7 +96,7 @@
 				list: '',
 				restrainShow1: false,
 				restrainList1: '',
-				restrainShow1: false,
+				restrainShow2: false,
 				restrainList1: '',
 				lastShow: false,
 				childrenList: '',
@@ -310,7 +310,8 @@
 	}
 
 	.searchBox {
-		padding-top: 24rpx;
+		padding-top: 24rpx;
+		width: 100vw;
 	}
 
 	.inputBox {
@@ -509,7 +510,7 @@
 
 	.mainLine {
 		display: flex;
-		width: 100vw;
+		width: calc(100vw - 48rpx);
 		border-bottom: 1px solid #EEEEEE;
 		padding: 29rpx 24rpx;
 	}