用canvas 画了个东西,真机调试的时候闪退
const query = wx.createSelectorQuery()
query.select('#controlStripCanvas')
.fields({ node: true, size: true })
.exec((res) => {
var width = 414*0.05 , height = 896*0.2;
// wx.getSystemInfo({
// success: (result) => {
// height = result.screenHeight*0.2
// width = result.screenWidth*0.05
// console.log("result",result);
// },
// })
const canvas = res[0].node
const ctx = canvas.getContext('2d')
ctx.beginPath();
ctx.arc(0.5*width,0.125*height,0.25*width,0, 1*Math.PI,true);
ctx.arc(0.5*width,0.875*height,0.05*width,1*Math.PI, 2*Math.PI,true);
ctx.closePath();
ctx.stroke();
ctx.fillStyle="#1B1727";
ctx.fill();
ctx.beginPath();
ctx.arc(0.5*width,0.3*height,0.2*width,0, 1*Math.PI,true);
ctx.arc(0.5*width,0.875*height,0.05*width,1*Math.PI, 2*Math.PI,true);
ctx.closePath();
ctx.stroke();
ctx.fillStyle="#40F2F9";
ctx.fill();
你好,麻烦提供出现问题的具体机型、微信版本号、系统版本号,以及能复现问题的代码片段(https://developers.weixin.qq.com/miniprogram/dev/devtools/minicode.html),是小程序闪退跳到手机桌面吗?