import { _decorator, Button, Component, Node, Sprite } from 'cc'; import ch_sign from '../../ch/sign/sign'; const { ccclass, property } = _decorator; @ccclass('Sign_Reward') export class Sign_Reward extends Component { @property(Node) private mask:Node=null; @property(Node) private gift:Node=null; @property(Node) private hadSign:Node=null; @property(Button) private sign_btn:Button=null; onLoad() { this.mask=this.node.getChildByName("Mask"); this.gift=this.node.getChildByName("Gift"); this.hadSign=this.node.getChildByName("HadSign"); this.sign_btn=this.node.getComponent(Button); this.sign_btn.node.on(Button.EventType.CLICK,this.show,this); } update(deltaTime: number) { } async show(day:number){ let state=await ch_sign.getInstance().checkSigineState(day); // 0未签到 1已签到 2失效等待补签 this.mask.active=state==1; this.hadSign.active=state==1; } }