增加方法:获取 在聊天中,触发技师图片的id

This commit is contained in:
chen wei bo
2025-09-10 20:59:12 +08:00
parent 24b9942110
commit 532a279088
5 changed files with 42 additions and 3 deletions
+16
View File
@@ -386,6 +386,22 @@ export class GirlData extends BaseData {
return false;
}
/** 获取 在聊天中,触发技师图片的id */
public getTriggerGrilPhotoId(categoryId: string, girlId: number): number {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return 0;
// 所有图片 id,展示类型属于在聊天中触发
let allId = oneData.getAllTriggerGrilPhotoId();
// 总聊天次数
let chatTotalCount = this.getChatTotalCount(categoryId, girlId);
// 遍历
for (let id of allId) {
let count = this.getGrilPhotoUnlockCounts(categoryId, girlId, id);
if (chatTotalCount >= count) return id;
}
return 0;
}
/** 获取第一个技师图片的资源路径 */
public getFirstGrilPhotoPath(categoryId: string, girlId: number): string {
let oneData = this.getGrilDetail(categoryId, girlId);