update PastGirlListPanel.prefab

This commit is contained in:
2025-09-22 19:31:50 +08:00
parent bfa55f52da
commit 556194f24a
8 changed files with 560 additions and 284 deletions
@@ -13,6 +13,7 @@ import { DataManager, DataId } from "../data/DataManager";
import { GirlData } from "../data/GirlData";
import { EnvData } from "../data/EnvData";
import { ChatHistoryManager } from "../manager/ChatHistoryManager";
import { ThemeData } from "../data/ThemeData";
const { ccclass, property } = _decorator;
@@ -29,6 +30,15 @@ export class PastGirlListItem extends Component {
@property(Node)
starParent: Node;
@property(Node)
freeTag: Node;
@property(UITransform)
categoryBg: UITransform;
@property(Label)
categoryTxt: Label;
@property(Node)
loading: Node;
stars: Sprite[];
@@ -83,6 +93,10 @@ export class PastGirlListItem extends Component {
this.girlName.string = LanguageUtils.getText(this.nameKey);
this.tagKey = girlData.getGrilTagKey(this.category.toString(), this.id);
this.freeTag.active = girlData.isGirlFreeType(
this.category.toString(),
this.id
);
// 标签显示
let desc = "";
const tags = LanguageUtils.getText(this.tagKey).split("|");
@@ -121,12 +135,28 @@ export class PastGirlListItem extends Component {
}
}
const themeData = DataManager.I.getDataById<ThemeData>(DataId.Theme);
const cat = girlData.getGrilCategoryById(this.id);
let key = themeData.getLanKeyById(1001 + cat);
this.categoryTxt.string = LanguageUtils.getText(key);
this.scheduleOnce(() => {
const size = this.categoryTxt.getComponent(UITransform).contentSize;
this.categoryBg.setContentSize(
size.x + 60,
this.categoryBg.contentSize.y
);
}, 0);
// 显示最近聊天时间
return this.updateLastChatTime();
}
private getLastChatTime(id: number): number | null {
return ChatHistoryManager.Instance.getLastChatTime(id);
const GirlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
return GirlData.getLatestChatRecordTimestamp(
this.category.toString(),
this.id
);
}
// 更新最近聊天时间显示
@@ -174,7 +204,7 @@ export class PastGirlListItem extends Component {
NavigationManager.Instance.setSelectedGirlId(this.id);
// 通过openSubPanel打开ChatPanel作为子面板
const chatData = { girlId: this.id };
const chatData = { base: this.baseNode };
NavigationManager.Instance.openSubPanel(
"ChatPanel",
this.baseNode,