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没问题。
之前可以用的好好的。这几天才有这个问题。
你好 改成这样试试?
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),
}
})
},