小程序
小游戏
企业微信
微信支付
扫描小程序码分享
wetchastlib:2.24.3
system:iphone ios 14.4.2
wetchat 8.0.20
3 个回答
加粗
标红
插入代码
插入链接
插入图片
上传视频
用开发者工具推一下 2.24.2 看看是否正常呢,再麻烦提供下 appid 和复现路径
你好,麻烦通过点击下方“反馈信息”按钮,提供出现问题的。
const query = wx.createSelectorQuery().in(this); //将选择器的选取范围更改为自定义组件 component 内
query
.select("#myCanvasKiVi")
.fields({
node: true,
size: true,
})
.exec(async (res) => {
const canvas = res[0].node;
const ctx = canvas.getContext("2d"); //上下文
const dpr = this.data.dpr;
canvas.width = res[0].width * dpr; //750
canvas.height = res[0].height * dpr; //1353
let width = res[0].width * dpr;
let height = res[0].height * dpr;
let px = (number) => {
return number * 0.01 * this.data.windowWidth * dpr;
};
let canvasImageFun = (url) => {
return new Promise((resolve) => {
wx.getImageInfo({
src: url,
success: (res) => {
console.log(res, "res");
let image = canvas.createImage();
image.src = url;
image.onload = function () {
image.width = res.width;
image.height = res.height;
resolve(image);
image.onerror = function () {
imageErrorFun();
},
});
let sharePhotoImage = await canvasImageFun(takePhotoImage);
let sharelogoImage = await canvasImageFun(sharelogopicImage);
let scancodeImage = await canvasImageFun(scancode);
let shareguestimage = await canvasImageFun(guestimage);
let factorylogoImage = await canvasImageFun(factorylogopic);
let postermarkImage = await canvasImageFun(postermarkpic);
是否是在 image.onload 中读写了 image._listeners ? 建议规避一下使用 _listeners 这个参数名呢
我们发现这两天微信在灰度2.24.3的版本,导致我们的小程序二维码没法正常显示
小程序id: wxbd30792a1f4d46e2
复现步骤:微信小程序搜索【交大一附院患者服务】,登录后首页二维码无法展示
关注后,可在微信内接收相应的重要提醒。
请使用微信扫描二维码关注 “微信开放社区” 公众号
用开发者工具推一下 2.24.2 看看是否正常呢,再麻烦提供下 appid 和复现路径
const query = wx.createSelectorQuery().in(this); //将选择器的选取范围更改为自定义组件 component 内
query
.select("#myCanvasKiVi")
.fields({
node: true,
size: true,
})
.exec(async (res) => {
const canvas = res[0].node;
const ctx = canvas.getContext("2d"); //上下文
const dpr = this.data.dpr;
canvas.width = res[0].width * dpr; //750
canvas.height = res[0].height * dpr; //1353
let width = res[0].width * dpr;
let height = res[0].height * dpr;
let px = (number) => {
return number * 0.01 * this.data.windowWidth * dpr;
};
let canvasImageFun = (url) => {
return new Promise((resolve) => {
wx.getImageInfo({
src: url,
success: (res) => {
console.log(res, "res");
let image = canvas.createImage();
image.src = url;
image.onload = function () {
image.width = res.width;
image.height = res.height;
resolve(image);
};
image.onerror = function () {
imageErrorFun();
};
},
});
});
};
let sharePhotoImage = await canvasImageFun(takePhotoImage);
let sharelogoImage = await canvasImageFun(sharelogopicImage);
let scancodeImage = await canvasImageFun(scancode);
let shareguestimage = await canvasImageFun(guestimage);
let factorylogoImage = await canvasImageFun(factorylogopic);
let postermarkImage = await canvasImageFun(postermarkpic);
是否是在 image.onload 中读写了 image._listeners ? 建议规避一下使用 _listeners 这个参数名呢
const query = wx.createSelectorQuery().in(this); //将选择器的选取范围更改为自定义组件 component 内
query
.select("#myCanvasKiVi")
.fields({
node: true,
size: true,
})
.exec(async (res) => {
const canvas = res[0].node;
const ctx = canvas.getContext("2d"); //上下文
const dpr = this.data.dpr;
canvas.width = res[0].width * dpr; //750
canvas.height = res[0].height * dpr; //1353
let width = res[0].width * dpr;
let height = res[0].height * dpr;
let px = (number) => {
return number * 0.01 * this.data.windowWidth * dpr;
};
let canvasImageFun = (url) => {
return new Promise((resolve) => {
wx.getImageInfo({
src: url,
success: (res) => {
console.log(res, "res");
let image = canvas.createImage();
image.src = url;
image.onload = function () {
image.width = res.width;
image.height = res.height;
resolve(image);
};
image.onerror = function () {
imageErrorFun();
};
},
});
});
};
let sharePhotoImage = await canvasImageFun(takePhotoImage);
let sharelogoImage = await canvasImageFun(sharelogopicImage);
let scancodeImage = await canvasImageFun(scancode);
let shareguestimage = await canvasImageFun(guestimage);
let factorylogoImage = await canvasImageFun(factorylogopic);
let postermarkImage = await canvasImageFun(postermarkpic);
我们发现这两天微信在灰度2.24.3的版本,导致我们的小程序二维码没法正常显示
小程序id: wxbd30792a1f4d46e2
复现步骤:微信小程序搜索【交大一附院患者服务】,登录后首页二维码无法展示