增加方法:获取 在聊天中,触发技师图片的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
@@ -107,7 +107,21 @@ export class GirlDetailData extends BaseData {
}
return allId;
}
/** 获取所有技师图片数据的id,展示类型属于在聊天中触发 */
public getAllTriggerGrilPhotoId(): number[] {
if (!this.photoData) return [];
// 筛选出类型为 2 的图片
let triggerPhotos = this.photoData.filter(photo => photo.imageType === 2);
// 按 unlockCounts 从大到小排序
triggerPhotos.sort((a, b) => b.unlockCounts - a.unlockCounts);
// 返回排序后的 id 数组
return triggerPhotos.map(photo => photo.id);
}
/** 获取技师图片数据,通过 id */
private getGrilPhotoData(id: number): proto.cs.IPurchaseCommercialImage | null {
if (!this.photoData) return null;