- 当前 Bug 的表现(可附上截图)
用wx.getImageInfo来获取 wx.canvasToTempFilePath 生成的
http://tmp/wx图片报接口错误
-预期效果:可获取转换图片,传给image标签,解决canvas层级高问题
- 复现路径:必现
- 提供一个最简复现 Demo
wx.canvasToTempFilePath({
canvasId: 'aaa',
quality: 1,
fileType: 'png',
success(res) {
urlPath = res.tempFilePath;
that.setData({ radarImg: urlPath });
wx.getImageInfo({
src: urlPath,//服务器返回的图片地址
success: function (res) {
Path = res.path;
that.setData({
radarImg: Path
})
},
fail: function (res) {
//失败回调
console.log(res)
}
})
},
fail(res){
console.log(res);
}
}, that)
机型基本都可复现
微信版本为6.7.3
基础库2.4.1
代码片段
wx.canvasToTempFilePath({
canvasId: 'lineGraph',
quality: 1,
fileType: 'png',
success(res) {
urlPath = res.tempFilePath;
that.setData({ radarImg: urlPath });
wx.getImageInfo({
src: urlPath,
success: function (res) {
Path = res.path;
that.setData({
radarImg: Path
})
},
fail: function (res) {
console.log(res)
}
})
},
fail(res){
console.log(res);
}
}, that)
麻烦提供一下出现问题的机型和微信版本,并且给个相关的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),我们定位下问题