twt hace 1 semana
padre
commit
ce759146b9

+ 89 - 9
pages/index/correction.vue

@@ -24,7 +24,12 @@
 			<view class="line" style="border: none;">
 				<view class="lineTitle">上传图片</view>
 				<view class="lineCont lineImgBox">
-					<image class="lineImg" src="/static/img/noimg.png" mode=""></image>
+					<view class="imgLine" v-for="(item,index) in imgArr" >
+						<image class="lineImg" :src="item.path" mode="widthFix"></image>
+					    <image src="../../static/img/icon_close.png" mode="" class="delImg" @click="delimg(imgindex)">
+					    </image>
+					</view>
+					
 					<image @click="uploadImg" class="lineImg" src="/static/img/scimg.png" mode=""></image>
 				</view>
 			</view>
@@ -64,7 +69,25 @@
 			 
 		},
 		methods: {
+			delimg(index) {
+				this.imgArr.splice(index, 1)
+			},
 			saveVIN(){
+				if(this.imgArr.length){
+					var imgs=[]
+					this.imgArr.forEach(item=>{
+						imgs.push(item.path)
+					})
+					this.imgs=imgs.splice(',')
+				}
+				if(!this.comment){
+					uni.showToast({
+					  title: '请填写错误说明',
+					  icon: 'none',
+					  duration: 3000
+					});
+					return false
+				}
 				uni.showLoading({ title: '加载中'});
 				this.$http3('errcheckapi/saveVIN', {
 				 carId:this.jcData.id,
@@ -75,17 +98,44 @@
 				},'POST').then(res => {
 					uni.hideLoading();
 					if(res.code==0){
-						uni.showToast({
+						/* uni.showToast({
 						  title: '操作成功',
 						  icon: 'none',
-						  duration: 2000
+						  duration: 3000
+						}); */
+						uni.showModal({
+							title: '提示',
+							content: '操作成功',
+							showCancel:false,
+							success: function (res) {
+								if (res.confirm) {
+									uni.navigateBack(-1)
+								} else if (res.cancel) {
+									console.log('用户点击取消');
+								}
+							}
 						});
 					}
 				})
 			},
 			SaveMatching(){
+				if(this.imgArr.length){
+					var imgs=[]
+					this.imgArr.forEach(item=>{
+						imgs.push(item.path)
+					})
+					this.imgs=imgs.splice(',')
+				}
+				if(!this.comment){
+					uni.showToast({
+					  title: '请填写错误说明',
+					  icon: 'none',
+					  duration: 3000
+					});
+					return false
+				}
 				uni.showLoading({ title: '加载中'});
-				this.$http3('errcheckapi/saveVIN', {
+				this.$http('errcheckapi/SaveMatching', {
 				 goods:this.jcData.goods,
 				 carmodel:this.jcData.value,
 				 comment:this.comment,
@@ -95,7 +145,18 @@
 				 partId:this.jcData.partId
 				},'POST').then(res => {
 					uni.hideLoading();
-					
+					uni.showModal({
+						title: '提示',
+						content: '操作成功',
+						showCancel:false,
+						success: function (res) {
+							if (res.confirm) {
+								uni.navigateBack(-1)
+							} else if (res.cancel) {
+								console.log('用户点击取消');
+							}
+						}
+					});
 				})
 			},
 		
@@ -123,15 +184,17 @@
 						//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://openapi.db.66km.cn/uploadapi/uploadImgBatch?timestamp='+Date.now()+'&type=errorcorrection',
+							//url:'http://192.168.1.8:20134/uploadapi/uploadImgBatch?timestamp='+Date.now()+'&type=errorcorrection',
 							header:{
-								timestamp:Date.now()
+								timestamp:Date.now(),
+								appId:'0d3f11e4-3344-4d59-a11e-06a8acc4b1bf'
 							},
 							//url:'http://api.dms.66km.com.cn/tuhuUploadFile',
 							filePath: v,
 							name: 'file',
 							formData: {
-								'user': 'test'
+								'type': 'errorcorrection'
 							},
 							success: (uploadFileRes) => {
 								var res=JSON.parse(uploadFileRes.data)
@@ -205,8 +268,25 @@
 	line-height: 80rpx;
 	color: #fff;
 	font-size: 32rpx;
-    background: #FF4F00;
+    background: #254A90;
 	border-radius: 16rpx;
 
 }
+.delImg {
+		width: 32rpx;
+		height: 32rpx;
+		position: absolute;
+		right: 20rpx;
+		top: 0rpx;
+	}
+.imgLine {
+		position: relative;
+		/* display: inline-block; */
+		display: flex;
+		    /* justify-items: center ; */
+		align-items: center;
+	}
+.lineImgBox{
+	display: flex;flex-wrap: wrap;
+}
 </style>

+ 1 - 1
pages/index/goodsDetail.vue

@@ -19,7 +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 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>

+ 16 - 5
pages/index/goodsList.vue

@@ -20,8 +20,12 @@
 				
 			</view>
 			<view class="topBtnBox">
-				<view class="topBtn" @click="goinstallation">电池安装</view>
-				<view class="topBtn" @click="gopz">车辆详情</view>
+				<view class="" style="display: flex;">
+					<view class="topBtn" @click="goinstallation">电池安装</view>
+					<view class="topBtn" @click="gopz">车辆详情</view>
+				</view>
+				
+				<view class="vinJc" @click="vinJc">纠错</view>
 			</view>
 		</view>
 		<view class="goodscont">
@@ -73,10 +77,10 @@
 							<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 class="lineBottom">
 								 <view></view>
 								 <view class="correction" @click.stop="gojc(item)">纠错</view> 
-							</view> -->
+							</view> 
 						</view>
 						
 					</view>
@@ -177,6 +181,13 @@
 				url:'adaptationsMore?partsId='+item.id+'&title='+title+'&title2='+title2
 			  })	
 			},
+			vinJc(){
+				var jcData=this.optdata
+				uni.setStorageSync('jcData',jcData)
+				uni.navigateTo({
+					url:'correction?type=1'
+				})
+			},
 			gojc(item){
 				var goods=item.name+'-'+item.brand+'-'+item.factoryNumber
 				console.log(goods)
@@ -591,7 +602,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;

BIN
static/img/icon_close.png


+ 2 - 2
utils/request.js

@@ -1,5 +1,5 @@
  //测试地址
- //const baseURL = 'http://192.168.1.10:19001/' 
+ //const baseURL = 'http://192.168.1.8:19001/' 
  //正式
 const baseURL='https://jujiang.66km.cn/' 
 //66正式
@@ -133,7 +133,7 @@ const http3 = (url = '', date = {}, type = 'POST', header = {
 		//console.log(that.$store)
 		//header['token']='98A9FED8814B457288166BDF623F33D1';
 		header['openId']=openId; 
-		header['userid']="1"; 
+		//header['userid']="1"; 
 		header['Content-Type']='application/x-www-form-urlencoded';
 		console.log(baseURL + url)
         uni.request({