twt il y a 2 ans
Parent
commit
90ca5f4d28
1 fichiers modifiés avec 166 ajouts et 31 suppressions
  1. 166 31
      pages/index/byItem.vue

+ 166 - 31
pages/index/byItem.vue

@@ -1,6 +1,6 @@
 <template>
 	<view class="content">
-	  <homenav :iStatusBarHeight="iStatusBarHeight" :title="'选择保养项目'"></homenav>
+	  <homenav :iStatusBarHeight="iStatusBarHeight" :title="'雨刷'"></homenav>
 	  <view class="box">
 		  <view class="historyLine" >
 			  <view class="historyLogoBox">
@@ -17,34 +17,54 @@
 		  </view>
 		 
 	  </view>
-	  
-	  <view class="title">机油推荐</view>
-	  
-	  <view class="lineBox flex">
-	  	<view class="line" @click="goEngineOil">
-			<view class="lineTitle">机油</view>
-			<view class="lineEnglish">Engine Oil</view>
-			<view class="lineImgbox">
-				<image src="../../static/img/icon_jiyou.png" mode="" class="lineImg1"></image>
+	 <view class="cont">
+		 <view class="topBox">
+		 	<view class="topLine" @click="goby">
+		 		<image src="../../static/img/icon_baoyang.png" mode="" class="toplineImg"></image>
+		 		<view class="topName">保养周期</view>
+		 	</view>
+		 	<view class="topsx"></view>
+		 	<view class="topLine" @click="gopz">
+		 		<image src="../../static/img/icon_cheliang.png" mode="" class="toplineImg"></image>
+		 		<view class="topName">车辆配置</view>
+		 	</view>
+		 </view>
+	 </view>
+		  
+	    <view class="listBox">
+			<view class="jiyouBox" v-if="loading">
+				<view class="title">前雨刷</view>
+				<view class="jylineBox">
+					<view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)">
+						<view class="jyimgBox">
+							<image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image>
+							<image v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
+						</view>
+						<view class="jyName">
+							<!-- <span class="best">最佳</span> -->
+							<span class="jyNametxt">{{item.name}} | {{item.specificationModel}} | {{item.partsCode}} </span>
+						</view>
+					</view>
+				</view>
+				<nodata v-if="MaintainPartList.length==0"></nodata>
 			</view>
 		</view>
-		<view class="line" @click="goGearboxOil">
-			<view class="lineTitle">变速箱油</view>
-			<view class="lineEnglish">Gearbox Oil</view>
-			<view class="lineImgbox">
-				<image src="../../static/img/icon_biansuxiang.png" mode="" class="lineImg2"></image>
-			</view>
-		</view>
-	  </view>
+		  
+		
+	 
+	  
+	 
+	
 	  
 	</view>
 </template>
 
 <script>
 	import homenav from "../../components/homenav/nav.vue"
+	import nodata from '../../components/nodata/nodata.vue'
 	export default {
 		components: {
-			homenav
+			homenav,nodata
 		},
 		data() {
 			return {
@@ -53,15 +73,19 @@
 				vin:'',
 				scarid:'',
 				iStatusBarHeight:'',
+				loading:false,
+				MaintainPartList:[],
 			}
 		},
 		onLoad(opt) {
 		   console.log(opt);
 		   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
            this.optdata=opt;
+		    this.queryMaintainPartList()
 		   if(opt.scarid){
 			   this.scarid=opt.scarid;
 			   this.queryCarModelGroupInfo()
+			  
 		   }else{
 			   if(opt.isVin==1){
 				   this.isVin=1;
@@ -90,6 +114,19 @@
 			   		this.saveQueryHistory()
 			   })
 		   },
+		   queryMaintainPartList(){
+		   			 uni.showLoading({ title: '加载中'});
+		   			 this.loading=false;
+		   			 this.$http('partsByOpen/queryMaintainPartList', {
+		   			   groupId:this.optdata.id,
+		   			   componentCode:'007005',
+		   			   
+		   			  },'POST').then(res => {
+		   				  this.loading=true;
+		   				uni.hideLoading();
+		   				this.MaintainPartList=res.data
+		   			 })
+		   },
 		   saveQueryHistory(){
 			   this.$http2('saveQueryHistory', {
 			     nLevelID:this.optdata.nLevelID,
@@ -103,16 +140,21 @@
 			   		
 			   })
 		   },
-           goEngineOil(){
-			   uni.navigateTo({
-			   	url:'/pages/index/engineOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
-			   })
-		   },
-		   goGearboxOil(){
-			   uni.navigateTo({
-			   	url:'/pages/index/gearboxOil?nLevelID='+this.optdata.nLevelID+'&logo='+this.optdata.logo+'&value='+this.optdata.value+'&id='+this.optdata.id+'&isVin='+this.optdata.isVin+'&vin='+this.optdata.vin
-			   })
-		   }
+           goby(){
+				 uni.navigateTo({
+					url:'/pages/index/maintenance?nLevelID='+this.optdata.nLevelID+'&id='+this.optdata.id
+				 })
+           },
+           godetail(e){
+			 uni.navigateTo({
+				url:'/pages/index/goodsDetail?id='+e.id
+			 })
+           },
+           gopz(){
+			 uni.navigateTo({
+				url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
+			 })
+           }
 		}
 	}
 </script>
@@ -145,7 +187,7 @@
 }
 .title{
 	font-weight: 500;font-size: 28rpx;
-	color: #1A1A1A;padding: 30rpx 24rpx;
+	color: #1A1A1A;
 	line-height: 40rpx;
 }
 .lineBox{
@@ -198,5 +240,98 @@ padding: 0 24rpx;
 	font-size: 18rpx;
 	margin-top: 2rpx;
 }
-
+.cont {
+		padding: 30rpx 24rpx;
+	}
+	.toplineImg{
+		width: 35rpx;
+		height: 34rpx;
+	}
+	.topName{
+		line-height: 34rpx;font-weight: 400;
+color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
+	}
+	.topBox{
+		width: 702rpx;
+		height: 98rpx;
+		background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);
+		border-radius: 16rpx;
+		display: flex;justify-content: center;
+	}
+	.topsx{
+		width: 2rpx;background: #ffffff;
+		margin-left: 85rpx;margin-right: 85rpx;
+		height: 54rpx;margin-top: 22rpx;
+	}
+	.topLine{
+		display: flex;padding-top: 34rpx;
+	}
+	.jiyouBox{
+		border-radius: 16rpx;
+		background: #ffffff;padding: 30rpx;
+	}
+	.jiyoutopTitle{
+		font-weight: 500;font-size: 28rpx;
+		color: #1A1A1A;
+		line-height: 40rpx;
+	}
+	.jyzl{
+		font-weight: 400;line-height: 40rpx;
+		color: #666666;font-size: 24rpx;
+	}
+	.jyimg{
+		width: 302rpx;
+		height: 302rpx;
+		border-radius: 10rpx;
+	}
+	.jyline{
+		width: 302rpx;padding-top: 30rpx;
+	}
+	.jyName{
+		font-weight: 400;font-size: 22rpx;
+		color: #1A1A1A;
+		line-height:36rpx ;
+		overflow: hidden; 
+		text-overflow: ellipsis; 
+		display: -webkit-box; 
+		-webkit-box-orient: vertical; 
+		-webkit-line-clamp: 2;
+		padding-top: 10rpx;
+	}
+	.best{
+		color: #FF4F00;border-radius: 6rpx;
+		padding: 0 8rpx;border: 1px solid #FF4F00;
+	}
+	.jylineBox{
+		display: flex;justify-content: space-between;flex-wrap: wrap;
+	}
+	.historyLineVin{
+		display: flex;background: #ffffff;
+	}
+	.historyLineCar{
+		display: flex;justify-content: space-between;
+	}
+	.vinNum{
+		font-weight: 400;font-size: 22rpx;padding-left: 10rpx;
+		color: #999999;line-height: 30rpx;
+	}
+	.vinms{
+		width: 38rpx;
+		height: 26rpx;
+		background: linear-gradient(224deg, #FFDA28 0%, #FFBF35 100%);
+		border-radius: 4rpx;
+		text-align: center;
+		line-height: 26rpx;
+		font-weight: 600;
+		color: #FFFFFF;
+		font-size: 18rpx;
+		margin-top: 2rpx;
+	}
+	.listBox{
+	  padding: 30rpx 24rpx;	
+	  padding-top: 0;
+	}
+	.jyimgBox{
+		border: 1px solid #EEEEEE;    width: 302rpx;border-radius: 10rpx;
+	}
 </style>