import { AppKernel } from '@scripts/app/AppKernel'; import { UIViewID } from '@scripts/define/UIDefine'; import { UIPopup } from '@scripts/framework/ui/UIPopup'; import { formatGoodsNum } from '@scripts/utils/Helper'; import { addBtnClick } from '@scripts/utils/UIHelper'; import { _decorator, Component, Label, Node } from 'cc'; const { ccclass, property } = _decorator; @ccclass('UIBirthdayGift') export class UIBirthdayGift extends UIPopup { readonly viewId: UIViewID = UIViewID.UIBirthdayGift; @property(Node) btnClose: Node; @property(Node) btnReceive: Node; @property(Label) lblSC: Label; @property(Label) lblGC: Label; @property(Label) lblPoint: Label; @property(Label) lblTimes: Label; protected onCreate() { addBtnClick(this.btnClose, this.closeSelf, this); addBtnClick(this.btnReceive, this.onBtnReceiveClick, this); } private async onBtnReceiveClick() { AppKernel.ui.loading(true); const res = await AppKernel.stores.vipStore.reqVipClaim('birthday_gift'); if (res) { } AppKernel.ui.loading(false); } protected onOpen(_params: unknown): void | Promise { const vipConfig = AppKernel.stores.vipStore.vipConfig; const birthday_gift = vipConfig.rewards.birthday_gift; this.lblSC.string = formatGoodsNum(birthday_gift.reward.sc); this.lblGC.string = formatGoodsNum(birthday_gift.reward.gc); this.lblPoint.string = formatGoodsNum(birthday_gift.reward.clubpoint); } }