- 关于分包的一些疑问?
[图片] 目前分包路径大致是这样的,想问下api的接口这些该怎么去放,放主包里会提示主包没用,分包用的,但是怕某些接口后期主包会用到,但是主包好像不能引用分包的js文件吧,所以想问一下大家是怎么分的
04-14 - canvasToTempFilePath这个Api在Canvas里转的文件不能显示吗?
https://developers.weixin.qq.com/community/develop/doc/000206085a81e05fef1e87ec851400 看见之前反馈过 ios安卓开发者工具都正常,真机模拟(pc小程序)和pc小程序时候都空白,看显示wxfile://temp/地址
2024-05-15 - canvas一般有时候正常有时候异常什么原因?
const drawCanvas = (canvasId, _this, dataObj) => { // 处理数据 const data = JSON.parse(JSON.stringify(dataObj)) demoList[0].value = data.levelOne ?? 0 demoList[1].value = data.levelTwo ?? 0 demoList[2].value = data.levelThree ?? 0 uni.createSelectorQuery().select(canvasId).fields({ node: true, size: true }).exec(res => { const { devicePixelRatio, screenWidth } = uni.getSystemInfoSync() const rpx = devicePixelRatio const canvas = res[0].node let ctx = canvas.getContext('2d') // 初始化画布大小 canvas.width = res[0].width * rpx canvas.height = res[0].height * rpx // 获取结束 const x = res[0].width / 2 * rpx; const y = res[0].height / 2 * rpx; const lineWidth = 20 * rpx; const radius = (res[0].height / 2) * rpx - (lineWidth / 2) // 半径 const sumResult = canvasId === '#chart' ? data.errorTotal : data.alertTotal; let startAngle = 0; demoList.map(item => { // 绘制数组中的百分比 ctx.beginPath(); console.log('sum',sumResult) let angle = (item.value / sumResult) * 2 * Math.PI ctx.arc(x, y, radius, startAngle, startAngle + angle); ctx.lineWidth = lineWidth; ctx.strokeStyle = item.color; ctx.stroke(); startAngle += angle }) // 文字颜色 ctx.fillStyle = "#1D2129" ctx.font = `${30 * rpx}px sans-serif` ctx.textAlign = 'center' // // 文字位置 // // 插入文字 ctx.fillText(sumResult, canvas.width / 2, y) // // 文字大小 ctx.fillStyle = "#86909C" ctx.font = `${12 * rpx}px sans-serif` ctx.textAlign = 'center' // // 文字颜色 // // 插入文字 ctx.fillText('故障总计(台)', canvas.width / 2, y + (20 * rpx)) uni.canvasToTempFilePath({ canvas: canvas, success: function(res) { if (canvasId === '#chart') { canvasSrc1.value = res.tempFilePath; } else { canvasSrc2.value = res.tempFilePath; } }, fail: function(res) { console.log(222, res) } }) }) }
2024-05-14 - tabbar切换时a切换到b,a页面能销毁嘛,b再切换回a,a重新加载?
tabbar切换时a切换到b,a页面能销毁嘛,b再切换回a,a重新加载?
2024-05-13