| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673 | <template>	<view class="content">		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'适配产品'"></homenav>		<view class="box">			<view class="historyLine">				<view class="historyLogoBox">					<image :src="optdata.logo" mode="" class="historylinecarImg"></image>				</view>				<view>					<view class="historylinecar">{{optdata.value}}</view>					<view class="historyLineVin" v-if="optdata.isVin==1"><!--  -->						<view style="display: flex;">							<view class="vinms">VIN:</view>							<view class="vinNum">{{optdata.vin}}</view>						</view>												<view class="copyVin" @click="copy(optdata.vin)">复制</view>					</view>				</view>							</view>			<view class="topBtnBox">				<!-- <view class="topBtn" @click="goinstallation">电池安装</view> -->				<view class="topBtn" @click="gopz">车辆详情</view>				<view class="vinJc" v-if="optdata.isVin==1" @click="vinJc">纠错</view>			</view>		</view>		<view class="goodscont">			<!-- <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 class="goosLeft">				<view class="goodsLefeLine" :class="{glActive:leftIndex==index}"				 @click="leftFn(index,item)" v-for="(item,index) in leftData">					<view class="leftKK" v-if="leftIndex==index"></view>					<view v-else  class="leftKK2"></view>					<view class="glName">{{item.name}}</view>				</view>			</view>			<view class="jiyouBox" >				 <!-- <view class="modelRemarkBox">					<view class="modelRemarkLine" @click="modelRemarkTab(1)" :class="{activeMr:modelRemarkNum==1}">0-10万公里</view>					<view class="modelRemarkLine" @click="modelRemarkTab(2)" :class="{activeMr:modelRemarkNum==2}">10万公里以上</view>				</view> -->				<!-- <view class="brandBox">					<view class="brandBtn" :class="{brandActive:type==1}" @click="ckBrand(1)">阿诺德</view>					<view class="brandBtn" :class="{brandActive:type==2}" @click="ckBrand(2)">鸿雁</view>					<view class="brandBtn" :class="{brandActive:type==3}" @click="ckBrand(3)">三冠</view>					<view class="brandBtn" :class="{brandActive:type==4}" @click="ckBrand(4)">威斯康</view>				</view> -->								<view class="jylineBox" v-if="loading">					<!-- <view class="ckName">					{{componentName}}					</view> -->					<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 v-else src="../../static/img/noimg.png" mode="aspectFit" class="jyimg"></image>						</view>						<view class="lineRgiht">							<view class="goodsName">{{item.name}} </view>							<view class="goodsMs">型号:{{item.specificationModel}}<span class="factoryNumber" v-if="item.factoryNumber">{{item.factoryNumber}}</span></view>							<view class="goodsMs modelRemark" @click.stop="modelRemarkFn(item.carmodelremark)">适用车型:{{item.carmodelremark}}</view>						    <view class="lineBottom">								<view class="gengduosp" @click.stop="goSp(item)">更多适配</view>								<view class="correction" @click.stop="gojc(item)">纠错</view>							</view>						</view>											</view>				</view>				<view v-if="MaintainPartList.length==0" style="padding-top: 200rpx;">						<nodata ></nodata>				</view>						</view>						<!-- <view class="jiyouBox"  v-if="loading">				<view class="jiyouTop">					<view class="jiyoutopTitle">原厂售后推荐</view>				</view>				<view class="salesLine">					<view class="salesLeft">建议加注量</view>					<view class="salesRight">{{oilusage}}</view>				</view>				<view class="salesLine">					<view class="salesLeft">规格型号</view>					<view class="salesRight">{{spec}}</view>				</view>			</view> -->		</view><uni-popup ref="popup"  background-color="#fff"><!-- <uni-popup-message type="center" :message="messageText" :duration="2000"></uni-popup-message> --> <view class="popup-content" ><text						class="text">{{messageText}}</text></view></uni-popup>	</view></template><script>	import nodata from '../../components/nodata/nodata.vue'	import homenav from "../../components/homenav/nav.vue"	export default {		components: {            nodata,homenav		},		data() {			return {               optdata:'',			   MaintainPartList:[],			   oilusage:'',			   iStatusBarHeight:'',			   loading:false,			   spec:'',			   modelRemarkNum:1,			   oldMaintainPartList:'',			   type:'',			   componentCode:'003001,003003',			   leftData:[				   {name:'全部',componentCode:'003001,003003'},				   {name:'点火线圈',componentCode:'003001'},				   {name:'火花塞',componentCode:'003003'},			   ],			   leftIndex:0,			   messageText:'',			   componentName:'',			   isVin:'',			   vin:'',			}		},		onLoad(opt) {			  console.log(opt)			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;              this.optdata=opt;			  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			  }			  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: {			goSp(item){			  var title=item.brand+item.name			  var title2=item.partsCode+" | "+item.specificationModel			  uni.navigateTo({			  	url:'adaptationsMore?partsId='+item.id+'&title='+title+'&title2='+title2			  })				},			gojc(item){				var goods=item.name+'-'+item.brand+'-'+item.factoryNumber/* this.componentName+"-"+ */				console.log(goods)				var jcData={					goods:goods,					carGroupId:this.optdata.id,					value:this.optdata.value,					partId:item.id,					vin:this.optdata.vin				}				uni.setStorageSync('jcData',jcData)				uni.navigateTo({					url:'correction?type=2'				})	 			},			vinJc(){				var jcData=this.optdata				uni.setStorageSync('jcData',jcData)				uni.navigateTo({					url:'correction?type=1'				})			},			copy(e){				uni.setClipboardData({					   data: e,					   success: function () {						 uni.showToast({						   title: '复制成功',						   icon: 'success',						   duration: 2000						 });					   },					   fail: function () {						 console.log('复制失败');											   }					 });			},			modelRemarkFn(txt){				this.messageText=txt				this.$refs.popup.open('center')			},			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			  this.componentName=item.name			  this.queryMaintainPartList()			},		    ckBrand(num){			  this.type=num				},			goinstallation(){			   uni.navigateTo({			   	url:'installation?groupIds='+this.optdata.id+'&componentId='			   })				},			 modelRemarkTab(num){				 this.modelRemarkNum=num				 if(num == 1){					 var name='0-10万公里'					 var arr=[]					 this.oldMaintainPartList.forEach(item=>{						 var state=false						 item.ruleList.forEach(v=>{							 if(v.version == name){								 state=true							 }						 })						 if(state){						 	 arr.push(item)						 }					 })										 this.MaintainPartList=arr					  //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))				 }else{					 var name='10万公里以上'					 var arr=[]					this.oldMaintainPartList.forEach(item=>{						 var state=false						 item.ruleList.forEach(v=>{							 if(v.version == name){								 state=true							 }						 })						 if(state){							 arr.push(item)						 }					})					 this.MaintainPartList=arr 					 //this.MaintainPartList= this.oldMaintainPartList.filter(item => item.modelRemark.includes(name))				 }			 },             queryMaintainPartList(){				 this.loading=false;				 uni.showLoading({ title: '加载中'});				 this.$http('partsByOpen/queryMaintainPartList', {				   groupId:this.optdata.id,				   componentCode:this.componentCode,				   				  },'POST').then(res => {					  this.loading=true;				 	  uni.hideLoading();				 	  this.MaintainPartList=res.data					  this.oldMaintainPartList=res.data					 // this.modelRemarkTab(1)				 })			 },			 saveQueryHistory(){			   this.$http2('saveQueryHistory', {				 nLevelID:this.optdata.nLevelID,				 logo:this.optdata.logo,				 title:this.optdata.value,				 groupId:this.optdata.id,				 isVin:this.isVin,				 vin:this.vin				},'POST').then(res => {															   })			 },			 queryOilInfoByGroupID(){				 var that=this;				 this.$http('matchingByOpen/queryOilInfoByGroupID', {				  // mileage:'30000',				   groupId:this.optdata.id,				   				  },'POST').then(res => {				 		var arr = res.data						arr.forEach(item=>{							if(item[0]=='机油'){								that.oilusage=item[2]								that.spec=item[1]							}													})						console.log(that.oilusage)				 })			 },			 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><style scoped>.salesLine{	display: flex;	font-size: 24rpx;	line-height: 30rpx;	padding: 20rpx 0;}.salesLeft{	width: 200rpx;	color: #999999;}	.content {		min-height: 100vh;		background: #F4F5F7;	}    .jyimgBox{		border: 1px solid #EEEEEE;    width: 90rpx;border-radius: 10rpx;		height: 90rpx;	}	.box {		padding: 0 24rpx;		background: #E60006;	}	.historylinecarImg{		width: 80rpx;		height: 80rpx;	}	.historyLogoBox{			display: flex;align-items: center;			padding-right: 14rpx;		}	.historylinecar {		font-weight: 500;		font-size: 32rpx;		color: #FFF;		line-height: 46rpx;		width: 616rpx;	}	.historyLine {		 display: flex;		padding: 30rpx 0;		/* border-top: 1rpx solid #EEEEEE; */		padding-bottom: 16rpx;	}	.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;	}	.jiyouTop{		display: flex;justify-content: space-between;	}	.jiyouBox{		/* margin-top: 30rpx; */		background: #ffffff;	/* 	padding: 30rpx; */		width: 590rpx;		/* padding-top: 0rpx; */	}	.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: 90rpx;		height: 90rpx;		border-radius: 10rpx;	}	.jyline{		padding-top: 26rpx;		display: flex;		border-bottom: 1px solid #EEEEEE;		    padding-bottom: 26rpx;			padding-left: 24rpx;	}	.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; */justify-content: space-between;		padding-top: 10rpx;	}	.historyLineCar{		display: flex;justify-content: space-between;	}	.vinNum{		font-weight: 400;font-size: 26rpx;padding-left: 10rpx;		color: #FFF;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; */		font-weight: 400;		font-size: 26rpx;		color: #FFF;		line-height: 30rpx;	}	.ruleListSpan{		font-weight: 400;		font-size: 22rpx;		color: #999999;		    line-height: 36rpx;			padding-right: 6rpx;	}	.modelRemarkBox{		display: flex;padding-bottom: 20rpx;	}	.modelRemarkLine{		background: #eee;		padding: 6rpx 20rpx;		border-radius: 6rpx;		margin-right: 30rpx;		font-size: 26rpx;	}	.activeMr{		background: #FFFFFF linear-gradient(132deg, #FF8635 0%, #FF4828 100%);		color: #FFF;	}	.topBtnBox{		display: flex;padding-bottom: 30rpx;		padding-left: 90rpx;justify-content: space-between;	}	.topBtn{		font-weight: 400;		font-size: 26rpx;		color: #FFF;		width: 180rpx;		height: 56rpx;		border-radius: 28rpx;		border: 1px solid #FFF;		line-height: 56rpx;		text-align: center;		margin-right: 30rpx;	}	.copyVin{		font-weight: 400;		font-size: 26rpx;		color: #FFF;		width: 62rpx;		height: 34rpx;	/* 	background: #F4F5F7;		border-radius: 4rpx; */		line-height: 30rpx;		text-align: center;		margin-left: 16rpx;	}	.brandBox{		display: flex;	}	.brandBtn{		font-size: 26rpx;		color: #3C3C3C;		padding: 10rpx 20rpx;		background: #F6F6F6;		border-radius: 6rpx;		margin-right: 20rpx;	}	.lineRgiht{		padding-left: 16rpx;	}	.goodsName{		font-size: 30rpx;		color: #222;		line-height: 40rpx;	}	.goodsMs{		font-size: 26rpx;		color: #3C3C3C;		line-height: 33rpx;		padding-top: 6rpx;	}	.brandActive{		background: rgba(255,79,0,0.08);		border-radius: 6rpx;		color: #FF4F00;	}	.goosLeft{		width: 170rpx;		font-size: 26rpx;		color: #3C3C3C;		background: #F6F6F6;	}	.goodscont{		display: flex;margin-top: 20rpx;		min-height: calc(100vh - 450rpx);	}.goodsLefeLine{	display: flex;justify-content: center;	padding: 30rpx 10rpx;}.glActive{	background: #ffffff;}.glActive .glName{font-weight: 500;font-size: 30rpx;color: #E60006;/* border-left:4rpx solid #E60006; */}.leftKK{	background: #E60006;	width: 6rpx ;	height: 24rpx;	border-radius: 4rpx;	margin-top: 8rpx;	overflow: hidden;}.leftKK2{	width: 4rpx ;}.glName{	width: 170rpx;text-align: center;	font-size: 30rpx;}.modelRemark{	overflow: hidden;	  text-overflow: ellipsis;	  white-space: nowrap; /* 防止文本换行 */	width: 430rpx;}.popup-content {		display: flex;		align-items: center;		justify-content: center;		padding: 15px;				background-color: #fff;		max-height: 50vh;		overflow: scroll;	}.ckName{	width: 532rpx;	height: 60rpx;	background: #F6F6F6;	border-radius: 4rpx;	font-size: 26rpx;	color: #3C3C3C;	line-height: 60rpx;	margin-left: 20rpx;	padding-left: 20rpx;	font-weight: 600;}.factoryNumber{	    padding: 0 10rpx;		border-radius: 8rpx;		 border:1px solid #E60006; 		margin-left: 10rpx;		display: inline-block;		/* background: #E60006; */		font-size: 26rpx;		color: #E60006;}.lineBottom{	display: flex;justify-content: space-between;	font-size: 26rpx;	padding-top: 10rpx;}.correction{	color: #999999;padding-right: 4rpx;padding-left: 20rpx;}.gengduosp{	color: #E60006;}.vinJc{	line-height: 60rpx;color: #ffffff;	font-size: 26rpx;}</style>
 |