Przeglądaj źródła

纠错 适配车型 VIN失败bug

twt 2 dni temu
rodzic
commit
c52cfe5f0d

+ 1 - 0
main.js

@@ -10,6 +10,7 @@ import request from 'utils/request.js'
 Vue.prototype.$http = request.http
 Vue.prototype.$ajax = request.ajax
 Vue.prototype.$http2 = request.http2
+Vue.prototype.$http3 = request.http3
 Vue.prototype.$baseURL = request.baseURL
 const app = new Vue({
   ...App

+ 14 - 0
pages.json

@@ -145,6 +145,20 @@
 				"navigationStyle": "custom"
 				
 			}
+		},
+		{
+			"path": "pages/index/adaptationsMore",
+			"style": {
+				"navigationBarTitleText": "更多适配",
+				"navigationStyle": "custom"
+			}
+		},
+		{
+			"path": "pages/index/correction",
+			"style": {
+				"navigationBarTitleText": "纠错",
+				"navigationStyle": "custom"
+			}
 		}
 	],
 	/* "tabBar": {

+ 110 - 0
pages/index/adaptationsMore.vue

@@ -0,0 +1,110 @@
+<template>
+	<view class="content">
+		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'适配车型'"></homenav>
+		<view class="box">
+			<!-- <view class="detail-container">
+				<view class="title1">{{optdata.title}}</view>
+				<view class="title2">{{optdata.title2}}</view>
+			</view> -->
+			<view class="lineBox" v-for="(item,index) in list" @click="Ick(item)">
+				<view class="line" >
+					<view class="lineTitle">
+						<span>{{item.brand}}</span>
+					</view>
+					<image class="jtImg" v-if="item.ck" src="/static/img/icon_arrow_up.png" mode=""></image>
+					<image class="jtImg" v-if="!item.ck" src="/static/img/icon_arrow_down.png" mode=""></image>
+				</view>
+				<view v-if="item.ck">
+				   <view class="spcarline" v-for="(v,i) in item.list">{{v.title}}</view>
+				</view>
+			</view>
+			
+
+
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import nodata from '../../components/nodata/nodata.vue'
+	import homenav from "../../components/homenav/nav.vue"
+	export default {
+		components: {
+            nodata,homenav
+		},
+		data() {
+			return {
+              iStatusBarHeight:'',
+			  optdata:'',
+			  list:'',
+			}
+		},
+		onLoad(opt) {
+			  console.log(opt)
+			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
+              this.optdata=opt;
+			 uni.showLoading({ title: '加载中'});
+			 this.$http('partsByOpen/queryCarModelGroupByPartsID', {
+			    partsId:opt.partsId
+			 },'POST').then(res => {
+			 	uni.hideLoading();
+			 	res.data.forEach(item=>{
+			 	  item.ck=false
+			 	})
+			 	 this.list = res.data
+			 })
+		},
+		methods: {
+			Ick(item){
+			      item.ck=!item.ck
+			},
+			
+		}
+	}
+</script>
+
+<style scoped>
+.content{
+	min-height: 100vh;
+	background:#f4f5f7 ;
+}
+.jtImg{
+	width: 26rpx;height: 26rpx;
+}
+.line{
+	font-size: 30rpx;
+	display: flex;
+	justify-content: space-between;
+	color: #22222;
+}
+.lineBox{
+/* 	padding: 24rpx; */
+	border-bottom: 1px solid #eaeaea;
+}
+.line2{
+	padding: 10rpx;color: #999;
+}
+.spcarline{
+	font-weight: 400;
+	color: #666;
+	font-size: 24rpx;
+	padding: 24rpx;	
+}
+.line{
+	padding: 24rpx;
+	background: #fff;
+}
+.detail-container{
+	background: #ffffff;
+	margin-bottom: 20rpx;
+	padding: 24rpx;
+}
+.title1{
+	font-weight: 600;    color: #333;font-size: 30rpx;
+}
+.title2{
+	color: #999;font-size: 26rpx;
+	padding-top: 10rpx;
+}
+</style>

+ 212 - 0
pages/index/correction.vue

@@ -0,0 +1,212 @@
+<template>
+	<view class="content">
+		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'纠错'"></homenav>
+		<view class="box">
+			<view class="line">
+				<view class="lineTitle">纠错类型</view>
+				<view class="lineCont" v-if="optdata.type==1">VIN解析纠错</view>
+				<view class="lineCont" v-if="optdata.type==2">匹配关系纠错</view>
+			</view>
+			<view class="line" v-if="optdata.type==1">
+				<view class="lineTitle">VIN</view>
+				<view class="lineCont">{{jcData.vin}}</view>
+			</view>
+			<view class="line">
+				<view class="lineTitle">车型</view>
+				<view class="lineCont">{{jcData.value}}</view>
+			</view>
+			<view class="line">
+				<view class="lineTitle">错误说明</view>
+				<view class="lineCont">
+					<textarea v-model="comment" class="lineConttextarea" placeholder="请输入" name="" id=""></textarea>
+				</view>
+			</view>
+			<view class="line" style="border: none;">
+				<view class="lineTitle">上传图片</view>
+				<view class="lineCont lineImgBox">
+					<image class="lineImg" src="/static/img/noimg.png" mode=""></image>
+					<image @click="uploadImg" class="lineImg" src="/static/img/scimg.png" mode=""></image>
+				</view>
+			</view>
+			
+
+        <view class="btnBox">
+			<view class="btn"  v-if="optdata.type==1" @click="saveVIN">提交</view>
+			<view class="btn"  v-if="optdata.type==2" @click="SaveMatching">提交</view>
+		</view>
+		</view>
+
+	</view>
+</template>
+
+<script>
+	import nodata from '../../components/nodata/nodata.vue'
+	import homenav from "../../components/homenav/nav.vue"
+	export default {
+		components: {
+            nodata,homenav
+		},
+		data() {
+			return {
+              iStatusBarHeight:'',
+			  optdata:'',
+			  jcData:'',
+			  comment:'',
+			  imgs:'',
+			  imgArr:[],
+			}
+		},
+		onLoad(opt) {
+			 this.jcData= uni.getStorageSync("jcData")
+			  console.log(opt)
+			   this.iStatusBarHeight = uni.getSystemInfoSync().statusBarHeight;
+              this.optdata=opt;
+			 
+		},
+		methods: {
+			saveVIN(){
+				uni.showLoading({ title: '加载中'});
+				this.$http3('errcheckapi/saveVIN', {
+				 carId:this.jcData.id,
+				 carmodel:this.jcData.value,
+				 comment:this.comment,
+				 imgs:this.imgs,
+				 vin:this.jcData.vin
+				},'POST').then(res => {
+					uni.hideLoading();
+					if(res.code==0){
+						uni.showToast({
+						  title: '操作成功',
+						  icon: 'none',
+						  duration: 2000
+						});
+					}
+				})
+			},
+			SaveMatching(){
+				uni.showLoading({ title: '加载中'});
+				this.$http3('errcheckapi/saveVIN', {
+				 goods:this.jcData.goods,
+				 carmodel:this.jcData.value,
+				 comment:this.comment,
+				 imgs:this.imgs,
+				 vin:this.jcData.vin,
+				 carGroupId:this.jcData.carGroupId,
+				 partId:this.jcData.partId
+				},'POST').then(res => {
+					uni.hideLoading();
+					
+				})
+			},
+		
+		uploadImg() {
+		
+			var that = this;
+			var length = this.imgArr.length;
+			var num = 9;
+			if (length > 8) {
+				uni.showToast({
+					title: '最多上传9张',
+					icon: 'none',
+					duration: 2000,
+				});
+				return false;
+			}
+			uni.chooseImage({
+				sourceType: ['album', 'camera'],
+				count: num - length,
+				sizeType:['compressed'],
+				success: (chooseImageRes) => {
+					const tempFilePaths = chooseImageRes.tempFilePaths;
+					console.log(tempFilePaths)
+					tempFilePaths.forEach(v => {
+						//console.log(that.$baseURL + '/search?action=uploadapi/uploadImgBatch');
+						uni.uploadFile({
+							//url: that.$baseURL + '/search?action=uploadapi/uploadImgBatch',
+							url:'http://openapi.db.66km.cn/uploadapi/uploadImgBatch?timestamp='+Date.now(),
+							header:{
+								timestamp:Date.now()
+							},
+							//url:'http://api.dms.66km.com.cn/tuhuUploadFile',
+							filePath: v,
+							name: 'file',
+							formData: {
+								'user': 'test'
+							},
+							success: (uploadFileRes) => {
+								var res=JSON.parse(uploadFileRes.data)
+		                        if(res.code==0){
+									console.log(JSON.parse(uploadFileRes.data).data);
+									that.imgArr = that.imgArr.concat(JSON.parse(
+										uploadFileRes.data).data);
+									console.log('imgArr--',that.imgArr);
+								}else{
+									console.log(res)
+									uni.showToast({
+										title: res.msg,
+										icon: 'none',
+										duration: 3000,
+									});
+								}
+								
+							},
+							fail(err) {
+								uni.showToast({
+									title: err.msg,
+									icon: 'none',
+									duration: 3000,
+								});
+							}
+						});
+					})
+					
+				}
+			});
+		},
+		},
+	}
+</script>
+
+<style scoped>
+.jtImg{
+	width: 26rpx;height: 26rpx;
+}
+.line{
+	padding: 20rpx 24rpx;
+	border-bottom: 1px solid #eaeaea;
+	display: flex;font-size: 28rpx;
+	color: #333;
+}
+.lineTitle{
+	width: 150rpx;
+}
+.lineCont{
+	color: #666;
+	width: 550rpx;
+}
+.lineConttextarea{
+	height: 180rpx;width: 520rpx;
+	border: 1px solid #eaeaea;
+	padding: 16rpx;
+}
+.lineImg{
+	width: 160rpx;
+	height: 160rpx;
+	margin-right: 20rpx;
+}
+.btnBox{
+	padding-top: 200rpx;
+	display: flex;justify-content: center;
+}
+.btn{
+	width: 600rpx;
+	height: 80rpx;
+	text-align: center;
+	line-height: 80rpx;
+	color: #fff;
+	font-size: 32rpx;
+    background: #FF4F00;
+	border-radius: 16rpx;
+
+}
+</style>

+ 1 - 0
pages/index/goodsDetail.vue

@@ -19,6 +19,7 @@
 			<view class="goodsMs"> <span class="dian"></span> 电池型号:{{info.specificationModel}}</view>
 			<view class="goodsMs"> <span class="dian"></span> 系列:{{info.brand}} {{info.GeneralpurposeName}}  <span class="englishname" v-if="info.englishname">{{info.englishname}}</span> </view>
 			<view class="goodsMs" v-if="info.carmodelremark"><span class="dian"></span> 适用车型:{{info.carmodelremark}}</view>
+		    <view class="goodsMs" v-for="(item,index) in info.extendDatas">{{item.key}}:{{item.value}}</view>
 		</view>
 		
 		<view style="height: 30rpx;background: #F4F5F7;" v-if="html"></view>

+ 56 - 3
pages/index/goodsList.vue

@@ -58,16 +58,25 @@
 				</view> -->
 				<view class="jylineBox"  v-if="loading">
 					<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 class="lineLeft">
+							<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="gengduosp" @click="goSp(item)">更多适配</view>
 						</view>
+						
 						<view class="lineRgiht">
 							<!-- <view class="goodsName">{{item.name}}| {{item.partsCode}}</view> -->
 							<view class="goodsName">附属型号:{{item.factoryNumber}} </view>
 							<view class="goodsMs">电池型号:{{item.specificationModel}} </view>
 							<view class="goodsMs">系列:{{item.brand}} <span>{{item.GeneralpurposeName}}</span> <span class="englishname" v-if="item.englishname">{{item.englishname}}</span>  </view>
 							<view class="goodsMs" v-if="item.carmodelremark">适用车型:{{item.carmodelremark}} </view>
+						     <!-- <view class="lineBottom">
+								 <view></view>
+								 <view class="correction" @click.stop="gojc(item)">纠错</view> 
+							</view> -->
 						</view>
 						
 					</view>
@@ -161,6 +170,28 @@
 			 
 		},
 		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
+				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'
+				})	 
+			},
 			queryCarModelGroupInfo(){
 			   uni.showLoading({ title: '加载中'});
 			   this.$http('matchingByOpen/queryCarModelGroupInfo', {
@@ -403,6 +434,9 @@
 		border: 1px solid #EEEEEE;    width: 120rpx;border-radius: 10rpx;
 		height: 120rpx;
 	}
+	.lineLeft{
+		 width: 120rpx;
+	}
 	.box {
 		padding: 0 24rpx;
 		background: #254A90;
@@ -660,4 +694,23 @@ color: #E60006;
 	font-size: 22rpx;
 	color: #ffffff;
 }
+.lineBottom{
+	display: flex;justify-content: space-between;
+	font-size: 26rpx;
+	padding-top: 10rpx;
+}
+.correction{
+	color: #254A90;
+}
+.gengduosp{
+	color: #254A90;font-size: 26rpx;
+	padding-top: 10rpx;
+}
+.vinJc{
+	line-height: 60rpx;color: #ffffff;
+	font-size: 26rpx;
+}
+.lineRgiht{
+	width: 550rpx;
+}
 </style>

+ 4 - 1
pages/index/history.vue

@@ -103,5 +103,8 @@
 .historyLogoBox{
 		display: flex;align-items: center;
 }
-
+.time{
+	font-size: 24rpx;
+	color: #999;
+}
 </style>

+ 53 - 1
pages/index/index.vue

@@ -7,7 +7,7 @@
 		    <view class="ssBox"  v-if="bIndex==2">
 				<view class="ssTab">
 					<view class="ssTableLine" :class="{sstabActive:ssType==1}" @click="sstabFn(1)">按车型</view>
-					<view class="ssTableLine" :class="{sstabActive:ssType==2}" @click="sstabFn(2)">编号</view>
+					<view class="ssTableLine" :class="{sstabActive:ssType==2}" @click="sstabFn(2)">按商品</view>
 				</view>
 		    	<view class="ssView" @click="goSearch">
 					<image class="newSImg" src="/static/img/newS.png" mode=""></image>
@@ -41,6 +41,21 @@
 			 </view>
 			
 		 </view>
+		 <!-- 选择车型 -->
+		 		<view class="ckcarBox" v-if="ckCarShow" >
+		 			<view class="ckcar" @click.stop="">
+		 				<view class="ckcarTop flex">
+		 					<view class="ckcarTitle">请选择车型</view>
+		 					<image src="../../static/img/icon_quxiao.png" mode="" class="ckcarClose" @click="ckcarClose"></image>
+		 				</view>
+		 				<view class="ckcarlineBox"  v-for="(item,index) in moreVinList" @click="gobyItem(item)">
+		 					<view class="ckcarline flex">
+		 						<view class="ckcarLeft">{{item.title}}</view>
+		 						<image src="../../static/img/icon_arrow.png" mode="" class="ckcarJtimg"></image>
+		 					</view>
+		 				</view>
+		 			</view>
+		 		</view>
 	</view>
 </template>
 
@@ -210,6 +225,7 @@
 				/* uni.navigateTo({
 				 	url:'/pages/index/byItem?nLevelID='+nLevelID+'&logo='+e.carModelInfo.logo+'&value='+e.title+'&id='+e.ids+'&isVin=1&vin='+this.vinNum
 				 }) */
+				 this.ckCarShow=false
 				 uni.navigateTo({
 				 	url:'/pages/index/goodsList?nLevelID='+nLevelID+'&logo='+e.carModelInfo.logo+'&value='+e.title+'&id='+e.ids+'&isVin=1&vin='+this.vinNum
 				 })
@@ -729,4 +745,40 @@ margin-top: 20rpx;
 .sstabActive{
 	background: #254A90;
 }
+.ckcarJtimg{
+	width: 26rpx;height: 26rpx;margin-top: 4rpx;
+}
+.ckcarlineBox{
+  padding:24rpx ;	
+  border-bottom: 1px solid #EEEEEE;
+}
+.ckcarLeft{
+	font-weight: 400;line-height: 36rpx;
+	color: #1A1A1A;font-size: 26rpx;
+}
+.ckcarBox{
+	width: 100vw;height: 100vh;
+	background:rgba(0, 0, 0, 0.4) ;
+	position: fixed;top: 0;left: 0;
+}
+.ckcar{
+	width: 750rpx;
+	height: 772rpx;
+	background: #FFFFFF;
+	border-radius: 24rpx 24rpx 0rpx 0rpx;
+	position: absolute;
+	left: 0;
+	bottom: 0;
+}
+.ckcarClose{
+	width: 30rpx;height: 30rpx;
+}
+.ckcarTitle{
+	font-weight: 500;font-size: 28rpx;
+	color: #1A1A1A;
+	line-height: 40rpx;
+}
+.ckcarTop{
+	padding: 40rpx 26rpx 20rpx 24rpx;
+}
 </style>

+ 10 - 3
pages/index/search.vue

@@ -30,9 +30,12 @@
 			</view>
 			<view>
 				<view class="historylinecar">{{item.title}}</view>
-				<view class="historyLineVin" v-if="item.ifVin">
-					<view class="vinms">VIN</view>
-					<view class="vinNum">{{item.vin}}</view>
+				<view style="display: flex;justify-content: space-between;">
+					<view class="historyLineVin">
+						<view class="vinms"  v-if="item.ifVin">VIN</view>
+						<view class="vinNum"  v-if="item.ifVin">{{item.vin}}</view>
+					</view>
+					<view class="time">{{item.createTime.slice(0,10)}}</view>
 				</view>
 			</view>
 		</view>
@@ -472,4 +475,8 @@
 .historybox .historyLogoBox{
 	padding-right: 10rpx;
 }
+.time{
+	font-size: 24rpx;
+	color: #999;
+}
 </style>

+ 31 - 3
pages/index/sgoodsList.vue

@@ -20,10 +20,14 @@
 				</view>
 				<view class="jylineBox" >
 					<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 class="lineLeft">
+							<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="gengduosp" @click="goSp(item)">更多适配</view>
 						</view>
+						
 						<view class="lineRgiht">
 							<!-- <view class="goodsName">{{item.name}}| {{item.partsCode}}</view> -->
 							<view class="goodsName">附属型号:{{item.factoryNumber}} </view>
@@ -83,6 +87,13 @@
 			 // 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
+			  })	
+			},
 			queryMaintainPartList(){
 				 this.loading=false;
 				 uni.showLoading({ title: '加载中'});
@@ -481,4 +492,21 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 	font-size: 22rpx;
 	color: #ffffff;
 }
+.lineLeft{
+		 width: 120rpx;
+}
+.correction{
+	color: #254A90;
+}
+.gengduosp{
+	color: #254A90;font-size: 26rpx;
+	padding-top: 10rpx;
+}
+.vinJc{
+	line-height: 60rpx;color: #ffffff;
+	font-size: 26rpx;
+}
+.lineRgiht{
+	width: 550rpx;
+}
 </style>

BIN
static/img/icon_arrow_down.png


BIN
static/img/icon_arrow_up.png


BIN
static/img/scimg.png


+ 44 - 2
utils/request.js

@@ -118,7 +118,49 @@ const http2 = (url = '', date = {}, type = 'POST', header = {
     });
 }
 
-
+const http3 = (url = '', date = {}, type = 'POST', header = {
+}) => {
+    return new Promise((resolve, reject) => {
+		header={};
+		
+		if(uni.getStorageSync("wxdata")){
+			//console.log(uni.getStorageSync("wxdata"))
+			var openId = uni.getStorageSync("wxdata").openid;
+		}else{
+			var openId = '';
+		}
+		
+		//console.log(that.$store)
+		//header['token']='98A9FED8814B457288166BDF623F33D1';
+		header['openId']=openId; 
+		header['userid']="1"; 
+		header['Content-Type']='application/x-www-form-urlencoded';
+		console.log(baseURL + url)
+        uni.request({
+            method: type,
+            url: baseURL+'search?action=' + url,
+            data: date,
+            header: header,
+            dataType: 'json',         
+        }).then((response) => {
+            //console.log(response)
+            //let [error, res] = response;
+			if(response.data.code!=0){
+				//console.log('??')
+				uni.showToast({
+				    title: response.data.msg,
+					 icon:'none',
+				     duration: 4000,
+				});
+			}
+		 resolve(response.data);
+           // resolve(res.data);
+        }).catch(error => {
+            let [err, res] = error;
+            reject(err)
+        }) 
+    });
+}
 function refresh(url,date,type,header){
 	uni.request({
 	    method: type,
@@ -148,5 +190,5 @@ function refresh(url,date,type,header){
 }
 
 export default {
-	http,baseURL,ajax,http2
+	http,baseURL,ajax,http2,http3
 }