PC端小程序运行环境与手机端的有差异,这个需要开发人员进行适配,如果没有适配就有可能出现这种情况。
PC端打开小程序 触发到点击事件后有的时候正常有的时候崩掉,手机上正常?[图片]
2020-04-18这个样式修改不了,升级微信试试吧
一次性订阅消息通知窗口怎么改呈现样式?我的怎么就这么丑: [图片] 而不是这样的: [图片]
2020-04-18对象的属性操作符是“.”不可能是“:”,上面那个带“:”的注释掉再看看
wx.showToast(Object object) 的 . 是不是需要改为:https://developers.weixin.qq.com/miniprogram/dev/api/ui/interaction/wx.showToast.html [图片]
2020-04-15这是什么手机,上面怎么还有关闭窗口按钮[图片]
微信小程序 web-view 加载的HTML页面 顶部时间不显示是什么原因?[图片]
2020-04-14给你聊天的不一定是微信,有可能是模拟微信环境的web系统,然后对你的聊天信息,个人信息进行了劫持,或许你不同意付钱后就进行了一些恶意操作。
已解决已解决
2020-04-14重新编译一下,不行就重启,重装
页面出现黑色字体提示渲染层错误,打印不好用,怎么办?[图片]
2020-04-14应该是微信的限制,如果在授权弹窗前就能让你处理,那授权弹窗的作用是不是就没有意义了
小程序授权按钮是否不能同时监听授权和点击如获取手机号的按钮 需要打开opentype 并监听手机号获取事件 open-type="getPhoneNumber" bindgetphonenumber="getPhoneNumber" 但是获取手机号的按钮点击后先会弹出弹窗询问,弹窗结束后才会触发回调函数 但是希望点授权按钮一瞬间也能被监听 如果绑定了bindgetphomenumber 就不能在继续bindtap 否则授权后也不会触发授权回调 而且我尝试给授权按钮父级绑定点击 依然会导致授权按钮不可用 也就是授权和点击只能监听一个 这是什么原因?
2020-04-14应该是时区问题吧
微信小程序苹果8 new Date()获取时间与安卓和苹果6不一样 多8小时?countDown(key, endTimeList, that,) {//倒计时函数 /** * key 是setData 的属性名字 * endTimeList 是结束时间列表 */ // 获取当前时间,同时得到活动结束时间数组 let newTime = new Date().getTime(); let countDownArr = []; // 对结束时间进行处理渲染到页面 endTimeList.forEach(o => { let endTime = new Date(o).getTime(); let obj = null; // 如果活动未结束,对时间进行处理 if (endTime - newTime > 0) { let time = (endTime - newTime) / 1000; // 获取天、时、分、秒 let day = parseInt(time / (60 * 60 * 24)); let hou = parseInt(time % (60 * 60 * 24) / 3600); let min = parseInt(time % (60 * 60 * 24) % 3600 / 60); let sec = parseInt(time % (60 * 60 * 24) % 3600 % 60); obj = this.timeFormat(day)+':'+this.timeFormat(hou)+':'+this.timeFormat(min)+':'+this.timeFormat(sec) } else {//活动已结束,全部设置为'00' obj = "00:00:00" } countDownArr.push(obj); }) // 渲染,然后每隔一秒执行一次倒计时函数 that.setData({ [key]: countDownArr }); // 函数内调用自身,,重复使用setTimeout 就每隔一秒调用一次了 that.data.toTime= setTimeout(() => { this.countDown(key, endTimeList, that) }, 1000); }
2020-04-14[图片] 去掉id试试吧
canvas type=2d putimagedata报错 canvas is empty?我之前用的老版本canvas putimagedata能够将数据绘制出来,但是现在我用了type=2d之后,一直报错 "canvasPutImageData: fail canvas is empty" 我这个canvasPutImageData是在其他文件里调用的 wx.canvasPutImageData({ canvasId: this.ctx.canvasId, data: this.data, height: this.width, width: this.height, x: 0, y: 0, },page).then((res)=>{ console.log("success",res)}) .catch(reson=>{ console.log("fail") console.log(reson) }) 这个page参数是我把页面的this传过来的.一直就是报错,找不到canvas. 这是canvasputimagedata需要传递canvasId, [图片] 但是type=2d时 [图片] 如果定义了type则无需指定canvas-id,是不是说明定义了type=2d,则该属性无效?
2020-04-14把res=>{ this.drawCanvas(this.data.canvasWidth,this.data.canvasHigth); } 放到this.setData({ canvasHigth:res.height, canvasWidth:res.width }) 的回调中去,再试试
体验版 canvas真机环境,一直显示一个黑色加载中弹窗,求解决?基础库版本号2.9.5 代码: wml : <view class="mainTwo"> <canvas type="2d" id="myCanvas" class="secondView" > </canvas </view> </view> js: //获取第二个view宽高 wx.createSelectorQuery().select('.secondView').boundingClientRect(res=> { this.setData({ canvasHigth:res.height, canvasWidth:res.width }) }).exec(res=>{ this.drawCanvas(this.data.canvasWidth,this.data.canvasHigth); }); drawCanvas: function (canvasWidth,canvasHigth){ wx.createSelectorQuery().select('#myCanvas').fields({ node: true, size: true }).exec(res => { const canvas = res[0].node; const ctx = canvas.getContext('2d'); canvas.width=canvasWidth; canvas.height=canvasHigth; let cicleCenterX=canvasWidth/8*5; let cicleCenterY=canvasHigth*4/6; //绘制字体 ctx.beginPath(); ctx.fillStyle='#ff8300'; ctx.textAlign='center'; ctx.font='normal normal 16px 微软雅黑'; ctx.fillText('88,888元', cicleCenterX, cicleCenterY); ctx.stroke(); ctx.closePath(); //绘制背景底盘 ctx.beginPath(); //阴影 ctx.shadowOffsetX='1'; ctx.shadowOffsetY='2'; ctx.shadowColor='#9e9e9e'; ctx.shadowBlur='3'; ctx.arc(cicleCenterX, cicleCenterY, cicleCenterX/2, 0.8* Math.PI, 2.2* Math.PI); //上色 ctx.strokeStyle = '#888df5'; ctx.lineWidth = 4; ctx.setLineDash([0]); ctx.stroke(); ctx.closePath(); //绘制填充颜色部分 ctx.beginPath(); const grd = ctx.createLinearGradient(0, 0, 200, 0) grd.addColorStop(0, '#fea75c'); grd.addColorStop(1, '#fea75c'); ctx.arc(cicleCenterX, cicleCenterY, cicleCenterX/2, 0.8* Math.PI, 1.6* Math.PI); ctx.strokeStyle = grd; ctx.lineWidth = 5; ctx.setLineDash([0]); ctx.stroke(); ctx.closePath(); }); } 真机显示: [图片]
2020-04-14