wx.chooseImage 部分手机无法唤起相册
[12:25:48] 日历打卡 - wx.chooseImage异常:{"errMsg":"chooseImage:fail cancel"}
handleChooseImage() {
let self = this;
wx.chooseImage({
count: 1,
sizeType: ["compressed"],
sourceType: ['album'],
success:async (res) => {
const result = await app.upload(res.tempFilePaths[0])
this.setData({image: result.url})
const upload = await app.request({
url: `api/mini/cardReturn/upload/${self.data.periodsId}`,
method: 'post',
data: {
url: result.url,
textbookId: this.data.textbookId
}
})
if (upload.code === 200) {
this.triggerEvent('uploadFinish', result.url)
self.setData({status: true})
app.toast('上传成功!')
app.log.info(`日历打卡 - 上传成功:${result.url}`)
} else {
app.log.error(`日历打卡 - 上传失败:${JSON.stringify(upload)}`)
app.toast('上传失败,请稍后重试!')
}
},
fail(error) {
app.log.error(`日历打卡 - wx.chooseImage异常:${JSON.stringify(error)}`)
}
});
}