模拟数据:技师的详细数据

This commit is contained in:
chen wei bo
2025-09-05 09:42:42 +08:00
parent cd05c4d3a8
commit 5088bcce73
2 changed files with 23 additions and 4 deletions
+21
View File
@@ -183,6 +183,27 @@ export class GirlData extends BaseData {
return oneData.category;
}
/** 获取主题枚举,根据 id */
public getGrilCategoryById(girlId: number): number {
const cats = this.ensureCategories();
for (const bucket of cats.values()) {
// 先查简要信息
const brief = bucket.briefs.get(girlId);
if (brief && brief.category) {
return brief.category;
}
// 兜底:若只缓存了详情,也从详情里的 brief 取
const detail = bucket.details.get(girlId);
if (detail?.brief && typeof detail.brief.category) {
return detail.brief.category;
}
}
// 未找到
return 0;
}
/** 获取list头像路径 */
public getGrilListAvatar(categoryId: string, girlId: number): string {
let oneData = this.getGrilBrief(categoryId, girlId);