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

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

@ -133,7 +133,7 @@
<view class="disac mar-s40"> <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 @tap="stayEv(item.title,item.id)" class="disjcac fc width25" v-for="(item,index) in workOrderList" :key="index">
<view class="posir" style="height: 60rpx;"> <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 class="engineer-num" v-if="item.num!=0">{{item.num}}</view>
</view> </view>
<view class="fon24 col3 mar-s10">{{item.title}}</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-overdueSingle.png',title:'逾期单',num:0,id:101},
// {imgsrc:'/static/public/icon-home-overtime.png',title:' ',num:0,id:0}, // {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-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:[ settlementList:[

View File

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

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB