之前選擇圖片上傳一直沒問題,突然發(fā)現(xiàn)安卓調(diào)出現(xiàn) fail cancle
//圖片選擇
showAction:function(){
var that=this;
wx.showActionSheet({
itemList: ['拍照', '從手機相冊選擇'],
success: function(res) {
console.log(res);
if(res.tapIndex == 0){
that.setData({
sourceType:['camera']
})
}else if(res.tapIndex == 1){
that.setData({
sourceType:['album']
})
}
that.choice();
},
fail: function(res) {
}
})
},
choice: function () {
var that = this;
var sourceType=this.data.sourceType;
wx.showModal({
content:'3'
});
wx.chooseImage({
count: 1, // 默認9
sizeType: ['original', 'compressed'], // 可以指定是原圖還是壓縮圖,默認二者都有
sourceType:sourceType, // 可以指定來源是相冊還是相機,默認二者都有
success: function (res) {
// 返回選定照片的本地文件路徑列表,tempFilePath可以作為img標(biāo)簽的src屬性顯示圖片
var tempFilePaths = res.tempFilePaths;
wx.showModal({
content:JSON.stringify(res)
});
that.setData({
image_photo: tempFilePaths
});
wx.showModal({
content:tempFilePaths[0]
});
that.uploadPhoto();
},
fail:function(res){
wx.showModal({
content:JSON.stringify(res)
});
},
complete:function(res){
wx.showModal({
content:JSON.stringify(res)
});
}
})
},
網(wǎng)友回復(fù):
如***:
突然好了,好莫名
如***:系統(tǒng)記錄