Commit 4379b6b4 authored by liujiangnan's avatar liujiangnan

feat: 提取方法

parent ca037c18
......@@ -85,21 +85,11 @@ cc.Class({
this.initListener();
this.initPageInfo();
this.hideUI();
// this.showWaitingLetters();
this.showWaitingLetters();
this.initTerminalInfo(() => {
this.getUserStar(); // 获取用户所获得的星星数量
// this.loadGame();
cc.assetManager.loadRemote(`${this.baseApiUrl}v1/wechart/wxacode?user_code=${this.userCode}`,{ext: '.jpeg'}, (err, img) => {
if(err) {
console.log("==远程图片加载错误==");
// TODO 上报错误
} else {
console.log(img);
const spriteFrame = new cc.SpriteFrame(img);
cc.find('middleLayer/qrcode').getComponent(cc.Sprite).spriteFrame = spriteFrame;
}
})
this.getUserQrcode(); // 获取用户动态小程序码
this.loadGame();
});
},
......@@ -136,6 +126,18 @@ cc.Class({
});
},
getUserQrcode() {
cc.assetManager.loadRemote(`${this.baseApiUrl}v1/wechart/wxacode?user_code=${this.userCode}`,{ext: '.jpeg'}, (err, img) => {
if(err) {
console.log("==远程图片加载错误==");
// TODO 上报错误
} else {
const spriteFrame = new cc.SpriteFrame(img);
cc.find('middleLayer/qrcode').getComponent(cc.Sprite).spriteFrame = spriteFrame;
}
})
},
getUserStar() {
this.callNetworkApiGet(this.baseApiUrl, "v1/terminal/user/stars", {
user_code: this.userCode,
......
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