This commit is contained in:
2025-09-10 21:49:39 +08:00
parent 6a9e1ebe57
commit eb2e1857dc
6 changed files with 509 additions and 392 deletions
+21 -4
View File
@@ -148,7 +148,14 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
this,
this.onEmotionInitialized
);
Utils.addInnerEL(
InnerMsgCode.ChatTotalCountChange,
this,
this.onChatCountChange
);
}
onDestroy(): void {
Utils.removeInnerEL(
InnerMsgCode.Chat_DialogRefresh,
@@ -160,7 +167,11 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
this,
this.onLanguageChangeCallback
);
Utils.removeInnerEL(
InnerMsgCode.ChatTotalCountChange,
this,
this.onChatCountChange
);
Utils.removeInnerEL(
InnerMsgCode.Chat_EmotionInitialized,
this,
@@ -193,8 +204,6 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
//const dataDetail = roleData.detail;
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
this.nameKey = girlData.getGrilName(this.categoryId, this.id);
this.girlName.string = LanguageUtils.getText(this.nameKey);
// ResManager.I.changeBundleSpriteFrame(
@@ -279,6 +288,14 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
}, 0.1);
}
}
onChatCountChange() {
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
let triggerId = girlData.getTriggerGrilPhotoId(this.categoryId, this.id);
if (triggerId == 0) triggerId = 100040103;
this.popUpImage.refresh(this.categoryId, this.id, triggerId);
}
setVideoEnable(enable: boolean) {
if (!this.girlVideo) return;
@@ -433,7 +450,7 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
}
onChatLimitReached(): void {
this.payToTalkPanel.show(this.categoryId,this.id);
this.payToTalkPanel.show(this.categoryId, this.id);
}
/**
* 情绪状态更新回调 (实现IChatPanelCallback接口)
@@ -9,6 +9,7 @@ import { GirlData } from "../../data/GirlData";
import { WalletData } from "../../data/WalletData";
import proto from "db://assets/Scripts/proto/proto.pb.js";
import LanguageUtils from "../../../Main/Common/LanguageUtils";
import { ImagePopup } from "../components/ImagePopup";
const { ccclass, property } = _decorator;
@ccclass("PopupGirlDetailPanel")
@@ -19,7 +20,7 @@ export class PopupGirlDetailPanel extends li_BaseView {
private girlId: number;
private resId: number;
private type: proto.cs.EnmResType;
private base: DetailImageItem;
private base: DetailImageItem | ImagePopup;
private desc: Label;
openUIDataCT(data) {
@@ -96,7 +97,11 @@ export class PopupGirlDetailPanel extends li_BaseView {
walletData.balance = Number(resData.balance);
walletData.vipExpire = Number(resData.vipExpire);
// 刷新界面
this.base.refreshVideoBuy(true);
if (this.base instanceof DetailImageItem) {
this.base.refreshVideoBuy(true);
} else {
this.base.refreshSelf();
}
this.close();
}
}