BUG issue: wx.chooseImage IOS 这几天突然不能用了?
发布于 6 年前 作者 juan94 19065 次浏览 来自 问答

chooseImg: function () {

let num = this.data.limit - this.data.photos.length;

wx.chooseImage({

count: num,

sizeType: [‘compressed’],

sourceType: [‘album’, ‘camera’],

success: res => {

if (res.tempFilePaths.length == 0) {

wx.showToast({ title: ‘接口故障,暂无法获取图片’, icon: ‘none’ });

return

} else {

this.setData({

photos: this.data.photos.concat(res.tempFilePaths),

}

})

},

返回的图片路径列表及图片列表都为空字符串? IOS存在问题,ios系统 10.3.3。android没问题。

之前可以用的好好的。这几天才有这个问题。

2 回复

解决了吗?

你好 改成这样试试?

chooseImg: function () {

let num = this.data.limit - this.data.photos.length;

var that = this

wx.chooseImage({

count: num,

sizeType: ['compressed'],

sourceType: ['album', 'camera'],

success: res => {

if (res.tempFilePaths.length == 0) {

wx.showToast({ title: '接口故障,暂无法获取图片', icon: 'none' });

return

} else {

that.setData({

photos: that.data.photos.concat(res.tempFilePaths),

}

})

},

回到顶部