chooseImage
接口拍摄图片后上传未压缩;
chooseMedia
接口写了sizeType: 'compressed',
没有压缩,并且选择图片时有原图选项
wx.chooseMedia({
count: this.data.count,
mediaType: ['image'],
sourceType: ['album', 'camera'],
sizeType: 'compressed',
maxDuration: 10,
camera: 'back',
success: (res) => {
console.log(res)
console.log(res.tempFiles.tempFilePath)
console.log(res.tempFiles.size)
const tempFilePath =res.tempFiles.map(item => item.tempFilePath)
console.log(tempFilePath)
this.setData({
tempFilePaths:[...this.data.tempFilePaths,...tempFilePath]
})
}
})
改成数组试试