h***@163.com
h***@163.com
  • 发布:2022-06-08 11:44
  • 更新:2022-06-08 11:44
  • 阅读:2014

用uView中u-upload插件,在安卓机上第一次上传点击取消后第二次点击就无效了

分类:uni-app

HTML 部分
<u-form-item
labelWidth="40"
prop="describe"
borderBottom
ref="item1"

<u-upload deletable="false" uploadIcon="plus" fileList="pictureList" @afterRead="afterRead"
ref="upload" multiple="false" maxCount="3" </u-upload>
</u-form-item>

JS 部分
// 新增图片
async afterRead(event) {
// 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
let lists = [].concat(event.file);
let fileListLen = this.pictureList.length;
lists.map((item) => {
this.pictureList.push({
...item,
status: "uploading",
message: "上传中",
});
});
for (let i = 0; i < lists.length; i++) {
const result = await imgFileUrl(lists[i].url, {
projectId: this.userBasicInfo.projectId,
});
let item = this.pictureList[fileListLen];
this.pictureList.splice(
fileListLen,
1,
Object.assign(item, {
status: "success",
message: "",
url: result,
})
);
fileListLen++;
}
},

2022-06-08 11:44 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复