新增首页状态、个人中心多图上传

master
chen 2022-08-25 09:19:27 +08:00
parent 54d53d5634
commit dfc4a926a2
4 changed files with 30 additions and 22 deletions

View File

@ -220,7 +220,7 @@
})
}, 1000)
this.$requst.post('/universal/api.login/signout').then(res => {})
},
},
//
tel(tel="0000000000") {
const telNum = tel.toString();

View File

@ -133,7 +133,7 @@
<view class="disac mar-s40">
<view @tap="stayEv(item.title,item.id)" class="disjcac fc width25" v-for="(item,index) in workOrderList" :key="index">
<view class="posir" style="height: 60rpx;">
<image :style="{width: [59,56,58,58][index]+'rpx',height:[49,58,60,54][index] + 'rpx'}" style="width: 58rpx;height: 53rpx;" :src="item.imgsrc" mode="widthFix"></image>
<image :style="{width: [59,56,58,51][index]+'rpx',height:[49,58,60,58][index] + 'rpx'}" style="width: 58rpx;height: 53rpx;" :src="item.imgsrc" mode="widthFix"></image>
<view class="engineer-num" v-if="item.num!=0">{{item.num}}</view>
</view>
<view class="fon24 col3 mar-s10">{{item.title}}</view>
@ -297,7 +297,7 @@
{imgsrc:'/static/public/icon-home-overdueSingle.png',title:'逾期单',num:0,id:101},
// {imgsrc:'/static/public/icon-home-overtime.png',title:' ',num:0,id:0},
{imgsrc:'/static/public/icon-home-workOrderPool.png',title:'工单池',num:0,id:0},
// {imgsrc:'/static/public/icon-home-stayCollection.png',title:'',num:0,id:5},
{imgsrc:'/static/public/icon-home-completed.png',title:'已完成',num:0,id:5},
],
//
settlementList:[

View File

@ -237,18 +237,27 @@
},
//
uploadImgEv(index){
if(index==0 || index==1){
var countNum = 1;
}
uni.chooseImage({
count:1,
count:countNum,
sourceType:['album'],
success: (res) => {
let tempImg = res.tempFilePaths[0];
uploadImg({path:tempImg}).then(res=>{
if(res.code) {
this.$toolAll.tools.showToast('上传成功');
this.imgList[index] = tempImg;
this.temporaryImg[index] = res.data.id;
}
})
for(let i=0;i<res.tempFilePaths.length;i++){
let tempImg = res.tempFilePaths[i];
uploadImg({path:tempImg}).then(res=>{
if(res.code) {
this.$toolAll.tools.showToast('上传成功');
if(this.imgList[index]==''){
this.imgList[index] = tempImg;
}else{
this.imgList[index] =this.imgList[index] + ',' + tempImg;
}
this.temporaryImg[index] = res.data.id;
}
})
}
},fail:(err)=> {
this.$toolAll.tools.checkQx(err.code);
}
@ -259,18 +268,17 @@
let arr = [];
//
this.imgList.forEach((item,index)=>{
if(current==index) arr.push(item);
if(current==index){
arr = item.split(',');
console.log(arr,33333)
};
})
if(arr.length) {
if(arr[0]) {
uni.previewImage({
current:current,
urls: arr,
success() {}
})
} else {
this.$toolAll.tools.showToast('请上传,再查看')
}
uni.previewImage({
current:current,
urls: arr,
success() {}
})
} else {
this.$toolAll.tools.showToast('请上传,再查看')
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB