소스 검색

1.车型点选

guo 2 년 전
부모
커밋
336e4717d1
2개의 변경된 파일53개의 추가작업 그리고 154개의 파일을 삭제
  1. 1 1
      pages/mobile/SelectCarModel.vue
  2. 52 153
      pages/mobile/SelectCarTwo.vue

+ 1 - 1
pages/mobile/SelectCarModel.vue

@@ -100,7 +100,7 @@
 				console.log(item)
 				
 				uni.navigateTo({
-					url:'SelectCarTwo?epc_id=' + item.epc_id + '&title=' + item.brand
+					url:'SelectCarTwo?epc_id=' + item.epc_id + '&brand_name=' + item.brand
 				})
 				
 			},

+ 52 - 153
pages/mobile/SelectCarTwo.vue

@@ -6,7 +6,7 @@
 			<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="zdyNavTitle">车型</view>
 				<view class="zdyNavRight" @click="goOemSearch">OEM搜索</view>
 
@@ -29,63 +29,15 @@
 			</view>
 		</view>
 
-		<!-- 年份 -->
-		<view v-if="yearShow" class="cangBox">
-			<view @click="goNext2(item)" class="xingBox" v-for="(item,index) in yearList">
-				<view class="xing">{{item.year}}</view>
-				<image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
-			</view>
-		</view>
-
-		<!-- 型号 -->
-		<view v-if="xinghaoShow" class="cangBox">
-			<view @click="goVinDetail(item)" class="workBox2" v-for="(item,index) in xinghaoList" :key="index">
-				<view class="leftBox">
-					<view class="oneBox">
-						<view class="comtent2">
-							<view class="left2" style="width: 28%;">变速器:</view>
-							<view class="right2">{{item.trans}}</view>
-						</view>
-						<view class="comtent2">
-							<view class="left2">车型:</view>
-							<view class="right2">{{item.model}}</view>
-						</view>
-					</view>
-
-					<view class="oneBox">
-						<view class="comtent2">
-							<view class="left2">级别:</view>
-							<view class="right2">{{item.grade}}</view>
-						</view>
-						<view class="comtent2">
-							<view class="left2" style="width: 35%;">发动机号:</view>
-							<view class="right2">{{item.engine}}</view>
-						</view>
-					</view>
-
-					<view class="oneBox">
-						<view class="comtent2">
-							<view class="left2">装配:</view>
-							<view class="right2">{{item.equip}}</view>
-						</view>
-
-					</view>
-
-
-					<view class="oneBox">
-						<view class="comtent2">
-							<view class="left2" style="width: 35%;">模型代码:</view>
-							<view class="right2">{{item.mdcode}}</view>
-						</view>
-
-					</view>
-
-				</view>
-				<image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
-			</view>
-		</view>
-
-
+		
+		<!-- 配置 -->
+		<view v-if="peizhiShow" class="cangBox">
+			<view @click="goNext2(item)" class="xingBox" v-for="(item,index) in peizhiList">
+				<view class="xing">{{item.combine_cp}}</view>
+				<image src="../../static/img/rightArrow.png" mode="" style="width: 12rpx; height: 20rpx"></image>
+			</view>
+		</view>
+		
 	</view>
 </template>
 
@@ -94,97 +46,87 @@
 		
 		data() {
 			return {
-				epc_id: '',
+				epc_id: '',
+				brand_name:'',
 				title: '',
 				iStatusBarHeight: '',
-				searchValue: '',
+				access_time: '',
+				token:'',
+				param:'',
+				carModelShow:false,
+				peizhiShow:false,
 				xingList: [],
-				access_time: '',
-				yearList: [],
-				yearShow: false,
-				carModelShow: false,
-				xinghaoShow: false,
-				xinghaoList: [],
+				peizhiList:[],
 			}
 		},
 		onLoad(opt) {
 			console.log('opt', opt);
 			this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
-			this.epc_id = opt.epc_id;
-			this.title = opt.title;
+			this.epc_id = opt.epc_id;
+			this.brand_name = opt.brand_name;
+			this.title = opt.brand_name;
 			this.getItemData();
 		},
 		methods: {
 			goNext(item) {
-				if (item.next_restrain == 1) {
+				if (item.next_restrain == 1) {
+					this.token = item.token;
+					this.param = item.param;
 					this.title += ' > ' + item.model_name;
 					this.getYueSuData(item)
 				}
 			},
 			goNext2(item) {
-				if (item.next_restrain == 1) {
+				if (item.next_restrain == 1) {
+					this.token = item.token;
+					this.param = item.param;
 					this.title += ' > ' + item.year;
 					this.getYueSuData(item)
 				}
 			},
 			//获取车型约束列表
 			getYueSuData(item) {
-				let that = this
+				
 				uni.showLoading({
 					title: '加载中'
 				});
 				this.$http('advancedEpc/getRestrain', {
 					epc_id: this.epc_id,
-					token: item.token,
-					param: item.param,
+					token: this.token,
+					param: this.param,
 					access_time: this.access_time,
-					// page: this.page
+					
 				}, 'GET').then(res => {
 					uni.hideLoading();
-					if (res.data.result.caption == '年份') {
-
 
-						that.carModelShow = false;
-						that.yearShow = true;
-
-						that.yearList = res.data.result.list;
-						that.access_time = res.data.result.access_time;
-					}
-					if (res.data.result.next_level.caption == '总组') {
-
-						that.title += ' > ' + res.data.result.caption;
-
-						that.carModelShow = false;
-						that.yearShow = false;
-						that.xinghaoShow = true;
-
-						that.xinghaoList = res.data.result.list;
-						that.access_time = res.data.result.access_time;
-					}
+						this.carModelShow = false;
+						this.peizhiShow = true;
 
+						this.peizhiList = res.data.result.list;
+						this.access_time = res.data.result.access_time;
+					
 
 				});
 			},
 			//获取车型
 			getItemData() {
-				let that = this
+				
 				uni.showLoading({
 					title: '加载中'
 				});
 				this.$http('advancedEpc/getModel', {
 					epc_id: this.epc_id,
-					// token: this.token,
-					// param: this.param,
-					// access_time: this.access_time,
-					// page: this.page
+					
 				}, 'GET').then(res => {
 					uni.hideLoading();
-
-					if (res.data.result.caption == '车型') {
-						that.xingList = res.data.result.list;
-						that.access_time = res.data.result.access_time;
-						that.carModelShow = true;
-					}
+					
+					
+						this.xingList = res.data.result.list;
+						this.access_time = res.data.result.access_time;
+						this.carModelShow = true;
+						this.token = res.data.result.list[0].models[0].token;
+						this.param = res.data.result.list[0].models[0].param;
+					
 				});
 			},
 			
@@ -196,14 +138,14 @@
 
 			goOemSearch() {
 				uni.navigateTo({
-					url: 'OemSearch'
+					url: 'OemSearch?brand=' + this.brand_name + '&epc_id=' + this.epc_id + '&param=' + this.param +
+						'&token=' + this.token + '&access_time=' + this.access_time
 				})
 			},
 			goback() {
-				console.log('返回');
-				this.carModelShow = true;
-				this.yearShow = false;
-				// uni.navigateBack({})
+				console.log('返回');
+				uni.navigateBack({})
+				
 			},
 		}
 	}
@@ -278,48 +220,5 @@
 		border-bottom: 1rpx solid #eeeeee;
 	}
 
-	.oneBox {
-		display: flex;
-		justify-content: space-between;
-		align-items: baseline;
-		font-size: 26rpx;
-		padding-bottom: 20rpx;
-	}
-
-	.comtent2 {
-		display: flex;
-		align-items: baseline;
-		font-size: 26rpx;
-		width: 50%;
-	}
-
-	.workBox2 {
-
-		background: #FFFFFF;
-		border-bottom: 1rpx solid #EEEEEE;
-		padding: 20rpx 24rpx 0rpx;
-
-		display: flex;
-		align-items: center;
-	}
-
-	.leftBox {
-		width: calc(100vw - 20rpx);
-	}
-
-	.rightBox {
-		width: 20rpx;
-	}
-
-	.left2 {
-		width: 20%;
-		color: #999999;
-		white-space: nowrap;
-	}
-
-	.right2 {
-		width: 80%;
-		color: #333333;
-		margin-right: 20rpx;
-	}
+	
 </style>