Bladeren bron

bug修改

twt 1 maand geleden
bovenliggende
commit
ba0a0b135f

+ 13 - 4
pages/index/goodsDetail.vue

@@ -12,10 +12,12 @@
 				
 			</swiper>
 	  	</view>
-		<view class="name" v-if="loading">{{info.name}} | {{info.specificationModel}} | {{info.partsCode}}</view>
-		<view style="height: 30rpx;background: #F4F5F7;"></view>
-		<view class="detail">
-			<view class="datailTitle">商品详情</view>
+		<view class="name" v-if="loading">{{info.name}} | {{info.specificationModel}} </view>
+		<view class="goodsMs">{{info.factoryNumber}}</view>
+		<view class="goodsMs">{{info.carmodelremark}}</view>
+		<view style="height: 30rpx;background: #F4F5F7;" v-if="html"></view>
+		<view class="detail" v-if="html">
+			<view class="datailTitle" v-if="html">商品详情</view>
 			
 		   <!-- <video style="width:750rpx;" class="edui-faked-video twtcs" src="https://66km.oss-cn-beijing.aliyuncs.com/yanghuziliao/shachepan/%E6%AC%A7%E6%B4%B2%E7%BB%B4%E4%BF%AE%E5%88%B9%E8%BD%A6%E7%9B%98%E7%89%87%E6%A0%87%E5%87%86%E6%9B%B4%E6%8D%A2SOP%E6%B5%81%E7%A8%8B.mp4" width="420" height="280" enable-danmu danmu-btn controls></video> -->
 			<!-- <player-component vid="f3310d4pktb"></player-component> -->
@@ -111,6 +113,7 @@
 	line-height: 40rpx;
 	font-size: 28rpx;
 	padding: 30rpx 24rpx;
+	padding-bottom: 10rpx;
 }
 
 .detail img{
@@ -123,4 +126,10 @@
 /deep/ video{
 	 width: 750rpx;
 }
+.goodsMs{
+		font-size: 24rpx;
+		color: #999999;
+		line-height: 33rpx;
+		padding: 10rpx 24rpx;
+	}
 </style>

+ 41 - 10
pages/index/goodsList.vue

@@ -17,7 +17,7 @@
 				
 			</view>
 			<view class="topBtnBox">
-				<view class="topBtn" @click="goinstallation">电池安装</view>
+				<!-- <view class="topBtn" @click="goinstallation">电池安装</view> -->
 				<view class="topBtn" @click="gopz">车辆详情</view>
 			</view>
 		</view>
@@ -54,15 +54,15 @@
 				</view> -->
 				
 				<view class="jylineBox" v-if="loading">
-					<view class="jyline" v-for="(item,index) in 5" @click="godetail(item)"><!-- MaintainPartList -->
+					<view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)"><!-- MaintainPartList -->
 						<view class="jyimgBox">
 							<!-- <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image> -->
 							<image  src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
 						</view>
 						<view class="lineRgiht">
-							<view class="goodsName">名称 规格型号</view>
-							<view class="goodsMs">出厂编码</view>
-							<view class="goodsMs">长了就换行显示,不要省略,长了就换行显示,不要省略,长了就换行显示,不要省略</view>
+							<view class="goodsName">{{item.name}} {{item.specificationModel}}</view>
+							<view class="goodsMs">{{item.factoryNumber}}</view>
+							<view class="goodsMs">{{item.carmodelremark}}</view>
 						</view>
 						
 					</view>
@@ -123,15 +123,46 @@
 			  console.log(opt)
 			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
               this.optdata=opt;
-			  if(this.optdata.type){
+			  if(this.optdata.type&&this.optdata.type!=undefined&&this.optdata.type!='undefined'){
 				  this.type=this.optdata.type
 				  this.leftIndex=this.type
 				  this.componentCode=this.leftData[this.type].componentCode
 			  }
-			  this.queryMaintainPartList()
-			  this.queryOilInfoByGroupID()
+			  if(opt.scarid){
+				   this.scarid=opt.scarid;
+				   this.queryCarModelGroupInfo()
+			  }else{
+				   if(opt.isVin==1){
+					   this.isVin=1;
+					   this.vin=opt.vin
+				   }
+						 
+				   this.saveQueryHistory()
+				   this.queryMaintainPartList()
+				 //  this.queryOilInfoByGroupID()
+			 }
+			  //this.queryMaintainPartList()
+			  //this.queryOilInfoByGroupID()
 		},
 		methods: {
+			queryCarModelGroupInfo(){
+				   uni.showLoading({ title: '加载中'});
+				   this.$http('matchingByOpen/queryCarModelGroupInfo', {
+					 id:this.scarid,
+					
+					},'POST').then(res => {
+						uni.hideLoading();
+						var data={
+							value:res.data.value,
+							id:res.data.id,
+							nLevelID:res.data.carModelInfo.nLevelID,
+							logo:res.data.carModelInfo.logo,
+						}
+						 this.optdata=data;
+						//this.saveQueryHistory();
+						 this.queryMaintainPartList()
+				   })
+			},
 			leftFn(index,item){
 			  this.leftIndex=index
 			  this.componentCode=item.componentCode
@@ -456,7 +487,7 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 		color: #FF4F00;
 	}
 	.goosLeft{
-		width: 190rpx;
+		width: 170rpx;
 		font-size: 26rpx;
 		color: #3C3C3C;
 		background: #F6F6F6;
@@ -467,7 +498,7 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 	}
 .goodsLefeLine{
 	display: flex;justify-content: center;
-	padding: 22rpx 0;
+	padding: 22rpx 10rpx;
 }
 .glActive{
 	background: #ffffff;

+ 1 - 1
pages/index/history.vue

@@ -44,7 +44,7 @@
 		methods: {
 			goDetail(e){
 				uni.navigateTo({
-					url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
+					url:'/pages/index/goodsList?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
 				}) 
 			},
            queryHistory(){

+ 9 - 3
pages/index/index.vue

@@ -201,14 +201,20 @@
 		   this.aaa= `calc(100vh - ${bb} - ${cc})`
 		},
 		onShow() {
-			
+			this.vincarActiveNum=1
 			if(this.openId){
 				this.queryHistory()
 			}
 		},
 		methods: {
 			vincarActiveFn(num){
+				if(num==3){
+					uni.navigateTo({
+						  url:'sgoodsList'
+					})
+				}
 				this.vincarActiveNum=num
+				
 			},
 			goSgoods(){
 				uni.navigateTo({
@@ -304,13 +310,13 @@
 			 gocarDetail(){
 				  var e=this.byItem
 				 uni.navigateTo({
-				 	url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
+				 	url:'/pages/index/goodsList?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
 				 })
 			 },
 			 gobyItem(e){
 				 var nLevelID=e.nLevelIDs.split(',')[0]
 				 uni.navigateTo({
-				 	url:'/pages/index/byItem?nLevelID='+nLevelID+'&logo='+e.carModelInfo.logo+'&value='+e.title+'&id='+e.ids+'&isVin=1&vin='+this.vinNum
+				 	url:'/pages/index/goodsList?nLevelID='+nLevelID+'&logo='+e.carModelInfo.logo+'&value='+e.title+'&id='+e.ids+'&isVin=1&vin='+this.vinNum
 				 })
 			 },
              gohistory(){

+ 1 - 1
pages/index/installation.vue

@@ -30,7 +30,7 @@
 		methods: {
 			goDetail(e){
 				uni.navigateTo({
-					url:'/pages/index/byItem?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
+					url:'/pages/index/goodsList?nLevelID='+e.nLevelID+'&logo='+e.logo+'&value='+e.title+'&id='+e.groupID+'&isVin='+e.ifVin+'&vin='+e.vin
 				}) 
 			},
            queryHistory(){

+ 10 - 4
pages/index/search.vue

@@ -118,15 +118,21 @@
 			   this.value=''
 		   },
 		   goDetal(e){
-			   uni.navigateTo({
+			  /* uni.navigateTo({
 			   	url:'/pages/index/byItem?nLevelID='+e.carModelInfo.nLevelID+'&logo='+e.carModelInfo.logo+'&isVin='+this.isVin+'&value='+e.value+'&id='+e.ids+'&vin='+this.vin
-			   }) 
+			   }) */
+			    uni.navigateTo({
+			   		url:'/pages/index/goodsList?nLevelID='+e.carModelInfo.nLevelID+'&logo='+e.carModelInfo.logo+'&isVin='+this.isVin+'&value='+e.value+'&id='+e.ids+'&vin='+this.vin
+			   	})
 		   },
 		   goDetalcx(e){
 			   console.log(e)
-			   uni.navigateTo({
+			   /* uni.navigateTo({
 			   	url:'/pages/index/byItem?scarid='+e.id
-			   }) 
+			   }) */
+			   uni.navigateTo({
+			   		url:'/pages/index/goodsList?scarid='+e.id
+			   	}) 
 		   },
 		   carMbtn(e){
 			   this.type=e.type;

+ 43 - 18
pages/index/sgoodsList.vue

@@ -4,7 +4,7 @@
 	<view class="sTopBox">
 			  <view class="searchInputBox" >
 			  	<image src="../../static/img/icon_search.png" mode="" class="simg"></image>
-			  	<input v-model="value" type="text"  placeholder="请输入商品" 
+			  	<input v-model="name" type="text"  placeholder="请输入商品" 
 				placeholder-class="ip" class="ssinput" @confirm="searchFn" focus>
 				<image src="../../static/img/icon_search_del.png" mode="" class="search_del" @click="searchDel"></image>
 			  </view>
@@ -22,17 +22,18 @@
 					<view class="glName">{{item.name}}</view>
 				</view>
 			</view>
-			<view class="jiyouBox" v-if="loading">
+			<view class="jiyouBox">
 				
 				<view class="jylineBox">
-					<view class="jyline" v-for="(item,index) in 5" @click="godetail(item)"><!-- MaintainPartList -->
+					<view class="jyline" v-for="(item,index) in MaintainPartList" @click="godetail(item)"><!-- MaintainPartList -->
 						<view class="jyimgBox">
-							<!-- <image v-if="item.imgs.split(',')[0]" :src="item.imgs.split(',')[0]" mode="aspectFit" class="jyimg"></image> -->
-							<image  src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>
+							<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="lineRgiht">
-							<view class="goodsName">品牌 规格型号</view>
-							<view class="goodsMs">长了就换行显示,不要省略,长了就换行显示,不要省略,长了就换行显示,不要省略</view>
+							<view class="goodsName">{{item.name}} {{item.factoryNumber}}</view>
+							<view class="goodsMs">{{item.specificationModel}}</view>
+							<view class="goodsMs">{{item.modelRemark}}</view>
 						</view>
 						
 					</view>
@@ -70,10 +71,12 @@
 			   componentCode:'',
 			   leftData:[
 				   {name:'全部',componentCode:''},
-				   {name:'点火线圈',componentCode:'003001'},
-				   {name:'火花塞',componentCode:'003003'},
+				   {name:'点火线圈',componentCode:'001006003'},
+				   {name:'火花塞',componentCode:'001006001'},
 			   ],
 			   leftIndex:0,
+			   pageIndex:1,
+			   name:'',
 			}
 		},
 		onLoad(opt) {
@@ -81,9 +84,17 @@
 			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
               this.optdata=opt;
 			  this.queryMaintainPartList()
-			  this.queryOilInfoByGroupID()
+			 // this.queryOilInfoByGroupID()
 		},
 		methods: {
+			leftFn(index,item){
+			  this.pageIndex=1
+			  this.MaintainPartList=[]
+			  this.leftIndex=index
+			  this.componentCode=item.componentCode
+			 // this.componentName=item.name
+			  this.queryMaintainPartList()
+			},
 			goinstallation(){
 			   uni.navigateTo({
 			   	url:'installation?groupIds='+this.optdata.id+'&componentId='
@@ -126,18 +137,27 @@
 					 //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))
 				 }
 			 },
+			 searchFn(){
+				 this.pageIndex=1
+				 this.MaintainPartList=[]
+				 this.queryMaintainPartList()
+			 },
              queryMaintainPartList(){
 				 this.loading=false;
 				 uni.showLoading({ title: '加载中'});
-				 this.$http('partsByOpen/queryMaintainPartList', {
-				   groupId:this.optdata.id,
-				   componentCode:'015001',
+				 this.$http('partsByOpen/queryPartsListV2', {
+				   //groupId:this.optdata.id,
+				   pageSize:20,
+				   pageIndex:this.pageIndex,
+				   categoryCodes:this.componentCode,
+				   name:this.name
 				   
 				  },'POST').then(res => {
 					  this.loading=true;
 				 	  uni.hideLoading();
-				 	  this.MaintainPartList=res.data
-					  this.oldMaintainPartList=res.data
+				 	  //this.MaintainPartList=res.data
+					  this.MaintainPartList=this.MaintainPartList.concat(res.data)
+					 // this.oldMaintainPartList=res.data
 					 // this.modelRemarkTab(1)
 				 })
 			 },
@@ -174,7 +194,12 @@
 				 	url:'/pages/index/carConfiguration?nLevelID='+this.optdata.nLevelID
 				 })
 			 }
-		}
+		},
+		// 上拉加载更多
+		onReachBottom() {
+			this.pageIndex++;
+			this.queryMaintainPartList()
+		},
 	}
 </script>
 
@@ -424,7 +449,7 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 		width: 36rpx;height: 34rpx;margin-top: 23rpx;margin-left:30rpx;
 	}
 .goosLeft{
-		width: 190rpx;
+		width: 170rpx;
 		font-size: 26rpx;
 		color: #3C3C3C;
 		background: #F6F6F6;
@@ -435,7 +460,7 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 	}
 .goodsLefeLine{
 	display: flex;justify-content: center;
-	padding: 22rpx 0;
+	padding: 22rpx 10rpx;
 }
 .glActive{
 	background: #ffffff;

+ 1 - 1
utils/request.js

@@ -1,5 +1,5 @@
  //测试地址
- //const baseURL = 'http://192.168.0.122:8002/' 
+ //const baseURL = 'http://192.168.1.10:19002/' 
  //正式
 const baseURL='https://vzk.66km.cn/' 
 //66正式