Files
18xchat/assets/Scripts/chat18x/ui/panels/PayToTalkSubpanel.ts
T

65 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-08-27 16:12:19 +08:00
import {
_decorator,
Component,
Label,
Node,
Sprite,
tween,
UIOpacity,
} from "cc";
import { ChatController } from "../../core/ChatController";
2025-08-25 20:15:42 +08:00
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;
2025-08-27 16:12:19 +08:00
base: UIOpacity;
2025-08-25 20:15:42 +08:00
2025-08-27 16:12:19 +08:00
protected onLoad(): void {
this.base = this.getComponent(UIOpacity);
}
2025-08-25 20:15:42 +08:00
2025-08-27 16:12:19 +08:00
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();
}
2025-08-25 20:15:42 +08:00
refresh() {}
onClick_BuyTime() {
//购买次数
2025-08-27 16:12:19 +08:00
ChatController.Instance.resetChatCount();
this.hide();
2025-08-25 20:15:42 +08:00
}
onClick_BuyVip() {
//购买VIP
console.log("购买vip,未实现功能");
}
}