Files
18xchat/assets/Scripts/chat18x/ui/panels/PayToTalkSubpanel.ts
T
xionglijia e57818d498 - MVP架构重构聊天逻辑
- 优化聊天气泡体验
- 修复prompt bug
- 实现聊天次数限制功能(未接服务端)
- 实现情绪切视频功能
2025-08-27 16:12:19 +08:00

65 lines
1.1 KiB
TypeScript

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,未实现功能");
}
}