在开发者工具上正常显示,但是在真机或者手机预览的时候不显示。
解决方法
首先把你的网络路径改成临时路径
wx.downloadFile({
url: that.data.bgImgPath,//网络路径
success: function (res) {
//背景图
that.setData({
bgImgPath: res.tempFilePath
})
console.log(res.tempFilePath)
console.log(‘开始绘制图片‘)
that.drawImage();//绘图的函数(如果你的图 没出来可以加个延迟这里)
}
})
然后这个取消后,在工具上再看

如果工具上不显示,那去配置你的域名,

原文:https://www.cnblogs.com/caoyuna/p/14475766.html