修改数据

This commit is contained in:
chen wei bo
2025-09-10 21:30:26 +08:00
parent 532a279088
commit 131c66f742
2 changed files with 25 additions and 9 deletions
+23 -3
View File
@@ -108,16 +108,24 @@ export class GirlDetailData extends BaseData {
return allId;
}
/** 获取所有技师图片数据的id,展示类型属于在详情页展示 */
public getAllListGrilPhotoId(): number[] {
if (!this.photoData) return [];
// 筛选出类型为 1 的图片
let listPhotos = this.photoData.filter(photo => photo.imageType === 1);
// 按 id 从小到大排序
listPhotos.sort((a, b) => a.id - b.id);
// 返回排序后的 id 数组
return listPhotos.map(photo => photo.id);
}
/** 获取所有技师图片数据的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);
}
@@ -141,6 +149,18 @@ export class GirlDetailData extends BaseData {
return oneData.imageType;
}
/** 图片展示类型:在详情页展示 */
public isGirlPhotoShowInList(id: number): boolean {
let type = this.getGrilPhotoType(id);
return type === 1;
}
/** 图片展示类型:在聊天触发 */
public isGirlPhotoShowInChat(id: number): boolean {
let type = this.getGrilPhotoType(id);
return type === 2;
}
/** 获取技师图片的聊天触发次数 */
public getGrilPhotoUnlockCounts(id: number): number {
let oneData = this.getGrilPhotoData(id);