小程序
小游戏
企业微信
微信支付
扫描小程序码分享
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
已知问题,后续修复
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
我也遇到这个问题了,IDE和真机都正常,就是PC端不行,出来的图片空白,调高了线上基础库还是这样,而且PC端微信登录还能获取到用户头像和昵称,明显是基础库或是其它组件还比较旧导致的,怎么这么久了还没修复?
compressImage: function(path, width, height,picwidth,picheight,pathhd) {//2d画板等比缩小图片 let that = this; const query = wx.createSelectorQuery().in(that); query.select('#compress-canvas').fields({ node: true, size: true }).exec((res) => { try { const canvas = res[0].node; const ctx = canvas.getContext('2d'); let dpr = wx.getSystemInfoSync().pixelRatio; that.setData({canvasWidth: picwidth / dpr,canvasHeight: picheight / dpr}) canvas.width = picwidth; canvas.height = picheight; const img = canvas.createImage() img.src = path; img.onload = () => { setTimeout(function () { ctx.drawImage(img, 0, 0, width, height, 0, 0, picwidth, picheight); wx.canvasToTempFilePath({ x: 0,y: 0,width:width,height:height,destWidth:picwidth,destHeight:picheight, canvas: canvas,quality:0.7,fileType:"jpg", success: function (res) { wx.compressImage({ src:res.tempFilePath, // 图片路径 quality: 80, // 压缩质量 success: function (res) { pathhd(res.tempFilePath); } }) }, fail(err) { app.setShowModal('格式不支持!请用网页版jm189.cn',false); that.setData({[itemsarr]:picarr}); } }) },50) } } catch (e) { app.setShowModal('优化图片异常!请用网页版jm189.cn',false); that.setData({[itemsarr]:picarr}); } }) }
都快十一月了,请问修复了吗
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
已知问题,后续修复
我也遇到这个问题了,IDE和真机都正常,就是PC端不行,出来的图片空白,调高了线上基础库还是这样,而且PC端微信登录还能获取到用户头像和昵称,明显是基础库或是其它组件还比较旧导致的,怎么这么久了还没修复?
compressImage: function(path, width, height,picwidth,picheight,pathhd) {//2d画板等比缩小图片 let that = this; const query = wx.createSelectorQuery().in(that); query.select('#compress-canvas').fields({ node: true, size: true }).exec((res) => { try { const canvas = res[0].node; const ctx = canvas.getContext('2d'); let dpr = wx.getSystemInfoSync().pixelRatio; that.setData({canvasWidth: picwidth / dpr,canvasHeight: picheight / dpr}) canvas.width = picwidth; canvas.height = picheight; const img = canvas.createImage() img.src = path; img.onload = () => { setTimeout(function () { ctx.drawImage(img, 0, 0, width, height, 0, 0, picwidth, picheight); wx.canvasToTempFilePath({ x: 0,y: 0,width:width,height:height,destWidth:picwidth,destHeight:picheight, canvas: canvas,quality:0.7,fileType:"jpg", success: function (res) { wx.compressImage({ src:res.tempFilePath, // 图片路径 quality: 80, // 压缩质量 success: function (res) { pathhd(res.tempFilePath); } }) }, fail(err) { app.setShowModal('格式不支持!请用网页版jm189.cn',false); that.setData({[itemsarr]:picarr}); } }) },50) } } catch (e) { app.setShowModal('优化图片异常!请用网页版jm189.cn',false); that.setData({[itemsarr]:picarr}); } }) }
都快十一月了,请问修复了吗