changeBlob: function(imgPath) {
wx.chooseImage({
success: res => {
// 借鉴:https://blog.csdn.net/qq_36875339/article/details/81086205
// 简写模式:
let imgbase64 = 'data:image/png;base64,' + wx.getFileSystemManager().readFileSync(res.tempFilePaths[0], "base64")
// 详细模式:
// let imgbase64 = wx.getFileSystemManager().readFile({
// filePath: imgPath, //选择图片返回的相对路径
// encoding: 'base64', //编码格式
// success: res => { //成功的回调
// console.log('data:image/png;base64,' + res.data)
// }
// })
this.data.imgList.push(imgbase64)
this.setData(this.data)
}
})
},
06-23
949
10-30
1206
11-03
3856
06-09