Merge branch 'main' of 47.107.44.202:xionglijia/18xchat
This commit is contained in:
@@ -418,18 +418,14 @@ export class GirlData extends BaseData {
|
|||||||
public isGirlPhotoShowInList(categoryId: string, girlId: number, id: number): boolean {
|
public isGirlPhotoShowInList(categoryId: string, girlId: number, id: number): boolean {
|
||||||
let oneData = this.getGrilDetail(categoryId, girlId);
|
let oneData = this.getGrilDetail(categoryId, girlId);
|
||||||
if (!oneData) return false;
|
if (!oneData) return false;
|
||||||
// 展示类型
|
return oneData.isGirlPhotoShowInList(id);
|
||||||
const showType = oneData.getGrilPhotoType(id);
|
|
||||||
return showType === 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 图片展示类型:在聊天触发 */
|
/** 图片展示类型:在聊天触发 */
|
||||||
public isGirlPhotoShowInChat(categoryId: string, girlId: number, id: number): boolean {
|
public isGirlPhotoShowInChat(categoryId: string, girlId: number, id: number): boolean {
|
||||||
let oneData = this.getGrilDetail(categoryId, girlId);
|
let oneData = this.getGrilDetail(categoryId, girlId);
|
||||||
if (!oneData) return false;
|
if (!oneData) return false;
|
||||||
// 展示类型
|
return oneData.isGirlPhotoShowInChat(id);
|
||||||
const showType = oneData.getGrilPhotoType(id);
|
|
||||||
return showType === 2;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** 图片是否免费 */
|
/** 图片是否免费 */
|
||||||
|
|||||||
@@ -108,16 +108,24 @@ export class GirlDetailData extends BaseData {
|
|||||||
return allId;
|
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,展示类型属于在聊天中触发 */
|
/** 获取所有技师图片数据的id,展示类型属于在聊天中触发 */
|
||||||
public getAllTriggerGrilPhotoId(): number[] {
|
public getAllTriggerGrilPhotoId(): number[] {
|
||||||
if (!this.photoData) return [];
|
if (!this.photoData) return [];
|
||||||
|
|
||||||
// 筛选出类型为 2 的图片
|
// 筛选出类型为 2 的图片
|
||||||
let triggerPhotos = this.photoData.filter(photo => photo.imageType === 2);
|
let triggerPhotos = this.photoData.filter(photo => photo.imageType === 2);
|
||||||
|
|
||||||
// 按 unlockCounts 从大到小排序
|
// 按 unlockCounts 从大到小排序
|
||||||
triggerPhotos.sort((a, b) => b.unlockCounts - a.unlockCounts);
|
triggerPhotos.sort((a, b) => b.unlockCounts - a.unlockCounts);
|
||||||
|
|
||||||
// 返回排序后的 id 数组
|
// 返回排序后的 id 数组
|
||||||
return triggerPhotos.map(photo => photo.id);
|
return triggerPhotos.map(photo => photo.id);
|
||||||
}
|
}
|
||||||
@@ -141,6 +149,18 @@ export class GirlDetailData extends BaseData {
|
|||||||
return oneData.imageType;
|
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 {
|
public getGrilPhotoUnlockCounts(id: number): number {
|
||||||
let oneData = this.getGrilPhotoData(id);
|
let oneData = this.getGrilPhotoData(id);
|
||||||
|
|||||||
Reference in New Issue
Block a user