话不多说,直接上代码
// 批量上传图片
upload() {
wx.chooseImage({
count: 9,
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success(res) {
// tempFilePath可以作为img标签的src属性显示图片
const tempFilePaths = res.tempFilePaths
let promise = [],
fileIDs = [] // 记录存储文件成功后返回的fileID
tempFilePaths.forEach(item <