Commit 5f8689e5 authored by liujiangnan's avatar liujiangnan

feat: 二维码显示

parent 9ca09b25
...@@ -122,7 +122,8 @@ export default class NewClass extends middleLayerBase { ...@@ -122,7 +122,8 @@ export default class NewClass extends middleLayerBase {
const statusWin = cc.find(`middleLayer/androidActiveLayer/buy_status_win`); const statusWin = cc.find(`middleLayer/androidActiveLayer/buy_status_win`);
cc.find(`buy_result_text`, statusWin).getComponent(cc.Label).string = `请使用微信扫码二维码付款`; cc.find(`buy_result_text`, statusWin).getComponent(cc.Label).string = `请使用微信扫码二维码付款`;
// 生成二维码 // 生成二维码
let icon = cc.find(`qrcode`, statusWin).getComponent(cc.Sprite); const qrcode = cc.find(`qrcode`, statusWin);
qrcode.active = false;
// 加载远程网络图片 // 加载远程网络图片
const kidInfo = await this.getUserBaseInfo(); const kidInfo = await this.getUserBaseInfo();
const userId = kidInfo.parent_id; const userId = kidInfo.parent_id;
...@@ -132,7 +133,8 @@ export default class NewClass extends middleLayerBase { ...@@ -132,7 +133,8 @@ export default class NewClass extends middleLayerBase {
const baseUrl = await this.getBaseUrl(); const baseUrl = await this.getBaseUrl();
cc.loader.load({url: `${baseUrl}/api/wxpay/v1/oxfordlite/qrcode?productid=${productid}&puid=${puid}&payuuid=${payuuid}`, type: "png"}, (err, text) => { cc.loader.load({url: `${baseUrl}/api/wxpay/v1/oxfordlite/qrcode?productid=${productid}&puid=${puid}&payuuid=${payuuid}`, type: "png"}, (err, text) => {
icon.spriteFrame = new cc.SpriteFrame(text); qrcode.getComponent(cc.Sprite).spriteFrame = new cc.SpriteFrame(text);
qrcode.active = true;
}); });
statusWin.active = true; statusWin.active = true;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment