同样遇到这个问题
cover-view使用fiexd定位,滚动页面,fiexd定位的元素会抖动cover-view使用fiexd定位,定位的元素页面滚动过程中会抖动,搜了各种方法,最后使用弹出层里放textarea解决的,但是这个问题可能是新手机新版本的一个bug,均是真机出现的问题,
03-28同问,解决了没,荣耀机型遇到该问题,苹果不会,input就正常摆放
小程序input输入框经常需要点击两次才弹出键盘 ?基础调试库:2.12.0 问题:同一个页面多个input,切换的时候,经常需要点击两次,才弹出键盘。 测试视频:https://v.qq.com/x/page/k3124ymlo83.html
2023-03-29drawBg: function({ canvas, ctx, width, height } = {}, url) { return new Promise((resolve, reject) => { wx.downloadFile({ url: url, success: function(res) { console.log(res); ctx.drawImage(res.tempFilePath, 0, 0, width, height); ctx.draw(true); console.log('drawed bg') resolve(); }, fail: function(res) { console.log(res); reject(); } }); }); },
提示“canvasToTempFilePath: fail canvas is empty”?<view class="story"> <canvas hidden="{{radarImg}}" canvas-id="canvas" type="2d" id="canvas" style="width: 100vw; height: calc(100vw / 750 * 1080);"></canvas> <image hidden="{{!radarImg}}" src="{{radarImg}}" style="width: 100vw; height: calc(100vw / 750 * 1080);" /> </view> openDialog: () => { console.log('openDialog()'); let ctx = wx.createCanvasContext('canvas'); // that.setData({ // radarImg: 'tempFilePath', // show: true // }); // console.log(that); ctx.draw(true, setTimeout(()=>{ wx.canvasToTempFilePath({ canvasId: 'canvas', success: function(res) { console.log(res); let tempFilePath = res.tempFilePath; that.setData({ radarImg: tempFilePath, show: true }); }, fail: function(res) { console.log(res); } }, that); },500)) }, that是在全局里定义的,在onload() 里 赋值 that = this;
2020-09-17没有专门的人员来解答吗?!
wx.canvasToTempFilePath 到底怎么用?一直报这个错:anvasToTempFilePath: fail canvas is empty [代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"Canvas_box"[代码] [代码]wx:if[代码][代码]=[代码][代码]"{{canvasHidden}}"[代码][代码]>[代码][代码] [代码][代码]<[代码][代码]canvas[代码] [代码]class[代码][代码]=[代码][代码]"Canvas"[代码] [代码]canvas-id[代码][代码]=[代码][代码]"myCanvas"[代码] [代码]/>[代码][代码] [代码][代码]<[代码][代码]view[代码] [代码]class[代码][代码]=[代码][代码]"save"[代码] [代码]catch:tap[代码][代码]=[代码][代码]"handSaveImg"[代码][代码]>保存图片</[代码][代码]view[代码][代码]>[代码][代码]</[代码][代码]view[代码][代码]>[代码][代码]createNewImg() {[代码][代码] [代码][代码]var[代码] [代码]that = [代码][代码]this[代码][代码] [代码][代码]var[代码] [代码]context = wx.createCanvasContext([代码][代码]'myCanvas'[代码][代码])[代码][代码] [代码][代码]context.setFillStyle([代码][代码]'#fff'[代码][代码])[代码][代码] [代码][代码]context.fillRect(0, 0, 375, 667)[代码][代码] [代码][代码]var[代码] [代码]path = [代码][代码]'/images/bannerbj.png'[代码][代码] [代码][代码]console.log(path)[代码][代码] [代码][代码]context.drawImage(path, 0, 0, 340, 550)[代码][代码] [代码][代码]context.setFontSize(14)[代码][代码] [代码][代码]context.setFillStyle([代码][代码]'#333333'[代码][代码])[代码][代码] [代码][代码]context.setTextAlign([代码][代码]'center'[代码][代码])[代码][代码] [代码][代码]let name = [代码][代码]this[代码][代码].data.name[代码][代码] [代码][代码]context.fillText(name, 175, 235)[代码][代码] [代码][代码]context.stroke()[代码] [代码] [代码][代码]context.setFontSize(50)[代码][代码] [代码][代码]context.setFillStyle([代码][代码]'#333333'[代码][代码])[代码][代码] [代码][代码]context.setTextAlign([代码][代码]'center'[代码][代码])[代码][代码] [代码][代码]let score = [代码][代码]this[代码][代码].data.score[代码][代码] [代码][代码]context.fillText(score, 162, 180)[代码][代码] [代码][代码]context.stroke()[代码][代码] [代码][代码]// context.draw(false, this.saveCanvasToFile())[代码][代码] [代码][代码]context.draw([代码][代码]false[代码][代码], e => {[代码][代码] [代码][代码]wx.canvasToTempFilePath([代码][代码] [代码][代码]{[代码][代码] [代码][代码]canvasId: [代码][代码]'myCanvas'[代码][代码],[代码][代码] [代码][代码]quality: 1,[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]canvasTemImg: res.tempFilePath,[代码][代码] [代码][代码]canvasHidden: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: res => {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]this[代码][代码] [代码][代码])[代码][代码] [代码][代码]})[代码][代码]},[代码][代码]saveCanvasToFile() {[代码][代码] [代码][代码]let that = [代码][代码]this[代码][代码] [代码][代码]setTimeout(() => {[代码][代码] [代码][代码]console.log([代码][代码]'123123123'[代码][代码])[代码] [代码] [代码][代码]wx.canvasToTempFilePath([代码][代码] [代码][代码]{[代码][代码] [代码][代码]canvasId: [代码][代码]'myCanvas'[代码][代码],[代码][代码] [代码][代码]quality: 1,[代码][代码] [代码][代码]success: res => {[代码][代码] [代码][代码]this[代码][代码].setData({[代码][代码] [代码][代码]canvasTemImg: res.tempFilePath,[代码][代码] [代码][代码]canvasHidden: [代码][代码]true[代码][代码] [代码][代码]})[代码][代码] [代码][代码]},[代码][代码] [代码][代码]fail: res => {[代码][代码] [代码][代码]console.log(res)[代码][代码] [代码][代码]}[代码][代码] [代码][代码]},[代码][代码] [代码][代码]this[代码][代码] [代码][代码])[代码][代码] [代码][代码]}, 2000)[代码][代码]},[代码]
2020-09-16