chooseAlbum() {
var that = this;
let imgArr = [];
uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['album'], //从相册选择、摄像头
success: function(res) {
uni.showLoading({
title: '上传中'
})
console.log('在这',JSON.stringify(res.tempFilePaths));
let path = JSON.stringify(res.tempFilePaths);
pathToBase64(path)
.then(base64 => {
console.log(base64)
})
.catch(error => {
console.error(error)
})
for (let i in res.tempFilePaths) {
imgArr = res.tempFilePaths[i];
}
that.photo_list = imgArr;
let url = that.photo_list;
uni.showModal({
content: '调取成功上传前url:' + url,
showCancel: false
});
that.urlTobase64(url);
uni.hideLoading();
},
fail: function(res) {
uni.showModal({
content: '调取失败',
showCancel: false
});
}
});
},
总是报错{"code":12,"message":"路径不存在"} at pages\merchantsSettled\merchantsSettled.vue:360
0 个回复