import { _decorator, Component, Label, Node, Sprite, tween, UIOpacity, } from "cc"; import { ChatController } from "../../core/ChatController"; const { ccclass, property } = _decorator; @ccclass("PayToTalkSubpanel") export class PayToTalkSubpanel extends Component { @property(Label) timeLabel: Label = null; @property(Label) timeBtnLabel: Label = null; @property(Label) vipLabel: Label = null; @property(Label) vipBtnLabel: Label = null; base: UIOpacity; protected onLoad(): void { this.base = this.getComponent(UIOpacity); } show() { this.node.active = true; this.base.opacity = 0; tween(this.base).to(0.3, { opacity: 255 }).start(); } hide() { tween(this.base) .to( 0.3, { opacity: 0 }, { onComplete: () => { this.base.node.active = false; }, } ) .start(); } refresh() {} onClick_BuyTime() { //购买次数 ChatController.Instance.resetChatCount(); this.hide(); } onClick_BuyVip() { //购买VIP console.log("购买vip,未实现功能"); } }