* Bug 手机已经打开调试了,
wx.downloadFile({
url: recordID, //url :"https://ss0.bdstatic.com/94oJfD_bAAcT8t7mm9GUKT-xh_/timg?image&quality=100&size=b4000_4000&sec=1516172737&di=e4e57ce1976abd980e6807c672312071&src=http://imgsrc.baidu.com/imgad/pic/item/e1fe9925bc315c600dce09d386b1cb13495477b6.jpg“ 如果是这个的话,手机和编辑器都可以,
//url:“192.168.41.163:8888”+后端返回的路径的话 编辑器可以正常显示,手机不可以
success: function (res) {
wx.hideLoading()
var tempFilePath = res.tempFilePath;
var ctx = wx.createCanvasContext(“canvas”);
ctx.drawImage(tempFilePath, 0,
0
120, 120);
wx.drawCanvas({
canvasId: “canvas”,
actions: ctx.getActions()
})
}
})
downloadTask.onProgressUpdate(function (downloadTask){
调用了报错
wx.drawCanvas({
canvasId: “canvas”,
actions: ctx.getActions()
})
})
context.setFontSize(20)
context.fillText(name, width / 2 + 6, “50”)
context.drawImage(“https://dl1.loveq.cn/animated_favicon.gif”, width / 2 - 64, 12, 50, 50)
wx.canvasToTempFilePath({
x: 0,
y: 0,
width: width,
height: height,
destWidth: width,
destHeight: height,
canvasId: ‘1’,
success: function (res) {
console.log(res.tempFilePath)
wx.saveImageToPhotosAlbum({
filePath: res.tempFilePath,
success(res) {
console.log(res)
}
})
}
模拟器的界面正常,控制台都出现了地址,但是手机开发者版本预览,还是显示不了图片,是什么原因?