|
@@ -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('用户点击取消');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
})
|
|
|
},
|
|
|
|
|
@@ -120,16 +181,20 @@
|
|
|
const tempFilePaths = chooseImageRes.tempFilePaths;
|
|
|
console.log(tempFilePaths)
|
|
|
tempFilePaths.forEach(v => {
|
|
|
- console.log(that.$baseURL + '/search?action=uploadapi/uploadImgBatch');
|
|
|
+ //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(),
|
|
|
+ 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)
|
|
@@ -203,8 +268,25 @@
|
|
|
line-height: 80rpx;
|
|
|
color: #fff;
|
|
|
font-size: 32rpx;
|
|
|
- background: #FF4F00;
|
|
|
+ background: #E60006;
|
|
|
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>
|