wxml部分
js部分
afterRead:function(event) {
const { file } = event.detail;
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
var obj={}
obj.path=file;
this.uploadimg(obj);
},
uploadimg:function(data) {
wx.showLoading({
title:'上传中...',
mask:true,
})
var that =this,
i = data.i ? data.i :0,
success = data.success ? data.success :0,
fail = data.fail ? data.fail :0;
let userInfo=wx.getStorageSync('userInfo');
let peopleId=userInfo.peopleId;
var picture_list = that.data.picture_list;
wx.uploadFile({
url: baseUrl +'impl/uploadImg',
filePath: data.path[i].path,
name:'file',
formData: {
'type':1,
'p