- canvas 2d 报错 toTempFilePath:fail invalid viewid?
模拟器没问题,真机一直报 toTempFilePath:fail invalid viewid? 业务是当前页面 需要点击进入别的页面填写内容,然后带参数返回 然后画海报保存 当前页面画直接画海报没问题,返回一直报 toTempFilePath:fail invalid viewid? onReady() { this.drawImage() }, drawImage: function () { let that = this const query = wx.createSelectorQuery() query.select('#myCanvas') .fields({ node: true, size: true }) .exec((res) => { const canvas = res[0].node const canvasRes = res[0] const ctx = canvas.getContext('2d') const dpr = wx.getSystemInfoSync().pixelRatio that.setData({ canvas , canvasRes, ctx, dpr }) }) }, drawImageDetail() { try { let userInfo = this.data.userInfo let canvasRes = this.data.canvasRes let canvas = this.data.canvas let dpr = this.data.dpr let ctx = this.data.ctx let that = this canvas.width = canvasRes.width * dpr canvas.height = canvasRes.height * dpr ctx.scale(dpr, dpr) ctx.fillStyle = 'white' ctx.fillRect(0, 0, canvas.width, canvas.height) ctx.font = '14px DINCondensed-Bold' ctx.fillStyle = '#BEC5CC' ctx.fillText(`生成海报`, 0, 0); setTimeout(() => { wx.canvasToTempFilePath({ canvas: canvas, success(res) { console.log(res.tempFilePath) }, fail(res){ console.log(res) } }) }, 400) } catch (error) { console.log(error) } },
2021-01-20 - 真机上canvasToTempFilePath:fail no image?
[图片]模拟器上走success但是成功的图片是空白的 真机上是好使的 但今天突然真机上一直走fail 报canvasToTempFilePath:fail no image错误
2019-08-23 - 小程序中webview加载h5的速度为什么这么慢?
有人遇到小程序的webview嵌套的h5 加载网页的速度很慢很慢 特别是在安卓手机 看到晚上说有webview对h5资源的限制很大?或者说还是有什么其他的方案
2019-10-23 - input输入框问题
输入框在获取焦点和失去焦点时里面的字为什么会闪一下,有大神知道怎么解决吗
2018-07-27