收藏
回答

上传图片突然出现重大BUG,不能上传了

以前一直好好地突然从相册里面选择图片不行了,选完点击确定,图片没有进入预览,拍照可以

,机型苹果

6.5.21 

11.5.3

iPhone 6s

其它苹果5S相同IOS系统和微信系统是没问题的

代码

<view class="add-images" bindtap="chooseImageTap" hidden='{{array.length >= 9}}'>

<view class="add_bt">上传照片</view>

</view>

chooseImageTap: function () {//产品信息图片选择

var that = this;

wx.showActionSheet({

itemList: ['从相册中选择', '拍照'],

itemColor: "#f7982a",

success: function (res) {

if (!res.cancel) {

if (res.tapIndex == 0) {

that.chooseWxImage('album')

} else if (res.tapIndex == 1) {

that.chooseWxImage('camera')

}

}

}

})

},

chooseWxImage: function (type) {//图片处理最多九张

var that = this;

var array = that.data.array

wx.chooseImage({

count: 9,

sizeType: ['original', 'compressed'],

sourceType: [type],

success: function (res) {

array = array.concat(res.tempFilePaths);

if (array.length > 9) {

array = array.slice(0, 9)

}

that.setData({

array: array

})

}

})

},


回答关注问题邀请回答
收藏
登录 后发表内容