twt 1 viikko sitten
vanhempi
commit
132721f7e4

+ 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

+ 51 - 10
pages/index/adaptationsMore.vue

@@ -2,15 +2,20 @@
 	<view class="content">
 		<homenav :iStatusBarHeight="iStatusBarHeight" :title="'更多适配'"></homenav>
 		<view class="box">
-			<view class="lineBox" v-for="(item,index) in 4">
+			<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>适用车型列表{{index}}</span>
+						<span>{{item.brand}}</span>
 					</view>
-					<image class="jtImg" src="/static/img/icon_arrow.png" mode=""></image>
+					<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 class="line2" v-for="(item,i) in 4">
-					适用车型列表二级{{i}}
+				<view v-if="item.ck">
+				   <view class="spcarline" v-for="(v,i) in item.list">{{v.title}}</view>
 				</view>
 			</view>
 			
@@ -32,22 +37,38 @@
 			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;
 }
@@ -55,15 +76,35 @@
 	font-size: 30rpx;
 	display: flex;
 	justify-content: space-between;
-	
-	
 	color: #22222;
 }
 .lineBox{
-	padding: 24rpx;
+/* 	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>

+ 112 - 10
pages/index/correction.vue

@@ -4,33 +4,35 @@
 		<view class="box">
 			<view class="line">
 				<view class="lineTitle">纠错类型</view>
-				<view class="lineCont">VIN解析纠错</view>
+				<view class="lineCont" v-if="optdata.type==1">VIN解析纠错</view>
+				<view class="lineCont" v-if="optdata.type==2">匹配关系纠错</view>
 			</view>
-			<view class="line">
+			<view class="line" v-if="optdata.type==1">
 				<view class="lineTitle">VIN</view>
-				<view class="lineCont">VIN222222222222</view>
+				<view class="lineCont">{{jcData.vin}}</view>
 			</view>
 			<view class="line">
 				<view class="lineTitle">车型</view>
-				<view class="lineCont">奥迪奥迪奥迪奥迪奥迪奥迪奥迪奥迪CCCC奥迪奥迪奥迪奥迪奥迪奥迪奥迪奥迪1019</view>
+				<view class="lineCont">{{jcData.value}}</view>
 			</view>
 			<view class="line">
 				<view class="lineTitle">错误说明</view>
 				<view class="lineCont">
-					<textarea class="lineConttextarea" placeholder="请输入" name="" id=""></textarea>
+					<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 class="lineImg" src="/static/img/scimg.png" mode=""></image>
+					<image @click="uploadImg" class="lineImg" src="/static/img/scimg.png" mode=""></image>
 				</view>
 			</view>
 			
 
         <view class="btnBox">
-			<view class="btn">提交</view>
+			<view class="btn"  v-if="optdata.type==1" @click="saveVIN">提交</view>
+			<view class="btn"  v-if="optdata.type==2" @click="SaveMatching">提交</view>
 		</view>
 		</view>
 
@@ -48,18 +50,118 @@
 			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(),
+							
+							//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>
 

+ 46 - 22
pages/index/goodsList.vue

@@ -22,6 +22,7 @@
 			<view class="topBtnBox">
 				<!-- <view class="topBtn" @click="goinstallation">电池安装</view> -->
 				<view class="topBtn" @click="gopz">车辆详情</view>
+				<view class="vinJc" @click="vinJc">纠错</view>
 			</view>
 		</view>
 		<view class="goodscont">
@@ -70,8 +71,8 @@
 							<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="goSp">更多适配</view>
-								<view class="correction" @click="gojc">纠错</view>
+								<view class="gengduosp" @click="goSp(item)">更多适配</view>
+								<view class="correction" @click.stop="gojc(item)">纠错</view>
 							</view>
 						</view>
 						
@@ -135,7 +136,7 @@
 			   ],
 			   leftIndex:0,
 			   messageText:'',
-			   componentName:'全部',
+			   componentName:'',
 			   isVin:'',
 			   vin:'',
 			}
@@ -166,31 +167,50 @@
 			  //this.queryOilInfoByGroupID()
 		},
 		methods: {
-			goSp(){
+			goSp(item){
+			  var title=item.brand+item.name
+			  var title2=item.partsCode+" | "+item.specificationModel
 			  uni.navigateTo({
-			  	url:'adaptationsMore'
+			  	url:'adaptationsMore?partsId='+item.id+'&title='+title+'&title2='+title2
 			  })	
 			},
-			gojc(){
+			gojc(item){
+				var goods=this.componentName+"-"+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'
-				})	
+					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('复制失败');
-									
-								   }
-								 });
+					   data: e,
+					   success: function () {
+						 uni.showToast({
+						   title: '复制成功',
+						   icon: 'success',
+						   duration: 2000
+						 });
+					   },
+					   fail: function () {
+						 console.log('复制失败');
+						
+					   }
+					 });
 			},
 			modelRemarkFn(txt){
 				this.messageText=txt
@@ -503,7 +523,7 @@ color: #FFFFFF;font-size: 28rpx;padding-left: 16rpx;
 	}
 	.topBtnBox{
 		display: flex;padding-bottom: 30rpx;
-		padding-left: 90rpx;
+		padding-left: 90rpx;justify-content: space-between;
 	}
 	.topBtn{
 		font-weight: 400;
@@ -646,4 +666,8 @@ color: #E60006;
 .gengduosp{
 	color: #E60006;
 }
+.vinJc{
+	line-height: 60rpx;color: #ffffff;
+	font-size: 26rpx;
+}
 </style>

+ 11 - 3
pages/index/history.vue

@@ -9,10 +9,14 @@
 				</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>
@@ -103,4 +107,8 @@
 .historyLogoBox{
 		display: flex;align-items: center;
 	}
+.time{
+	font-size: 24rpx;
+	color: #999;
+}
 </style>

BIN
static/img/icon_arrow_down.png


BIN
static/img/icon_arrow_up.png


+ 44 - 1
utils/request.js

@@ -118,6 +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({
@@ -148,5 +191,5 @@ function refresh(url,date,type,header){
 }
 
 export default {
-	http,baseURL,ajax,http2
+	http,baseURL,ajax,http2,http3
 }