Commit 1f29e1c8 authored by haiyoucuv's avatar haiyoucuv

init

parent 8bb139ac
......@@ -2231,7 +2231,7 @@ declare module "cc" {
* 精灵的精灵帧。
*/
get spriteFrame(): SpriteFrame | null;
set spriteFrame(value: SpriteFrame | null);
set spriteFrame(value: SpriteFrame | string | null);
/**
* @en
* The sprite render type.
import Panel from "../../Module/Panel";
import { _decorator, Button, Director, director, game, Label, Node, RenderTexture, Sprite } from "cc";
import { observer } from "../store/decorators";
import store from "../store/store";
const { ccclass, property } = _decorator;
......@@ -17,12 +18,13 @@ export default class GamePosterPanel extends Panel {
@property(Sprite) qrcode: Sprite = null;
onLoad() {
this.lengthTxt.string = `${this.data.score}`;
this.killTxt.string = `${this.data.finalKill}`;
this.qrcode.spriteFrame = store.inviteInfo.qrCode;
}
async start() {
this.lengthTxt.string = `${this.data.score}`;
this.killTxt.string = `${this.data.finalKill}`;
// director.once(Director.EVENT_AFTER_DRAW, this.copyRenderTex);
// director.once(Director.EVENT_END_FRAME, this.copyRenderTex);
this.scheduleOnce(this.copyRenderTex, 0.5);
......
......@@ -105,26 +105,31 @@ class Store {
inviteInfo: {
shareUrl: string,
inviteCode: string,
qrCode: string | SpriteFrame,
} = {
shareUrl: "",
inviteCode: "",
qrCode: "",
};
async genInviteInfo() {
this.inviteInfo.shareUrl = `${location.origin}${location.pathname}`
+ `?appID=${getUrlParams("appID")}`;
const { success: genCodeSuc, data: genCodeData } = await sendWebNet(WebNetName.getInviteCode);
if (!genCodeSuc) {
this.inviteInfo.inviteCode = genCodeData.inviteCode;
}
const activeUrl = `${location.origin}${location.pathname}`
this.inviteInfo.shareUrl = `${location.origin}${location.pathname}`
+ `?appID=${getUrlParams("appID")}`
+ `&inviteCode=${genCodeData.inviteCode}`;
const path = "package/pages/common-activity/index" +
"?webUrl=" + encodeURIComponent(activeUrl);
"?webUrl=" + encodeURIComponent(this.inviteInfo.shareUrl);
const { success: genQrSuc, data: genQrData } = await sendWebNet(WebNetName.genQrCode, {
path: path,
......
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