协议调试

This commit is contained in:
chen wei bo
2025-09-09 15:15:34 +08:00
parent 54321458eb
commit d72728c1b7
4 changed files with 80 additions and 18 deletions
+67 -9
View File
@@ -285,19 +285,52 @@ export class GirlData extends BaseData {
return oneData.getAllGrilPhotoDataCount();
}
/** 获取所有技师图片数据的id */
public getAllGrilPhotoDataId(categoryId: string, girlId: number): number[] {
/** 获取所有技师图片的id */
public getAllGrilPhotoId(categoryId: string, girlId: number): number[] {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return [];
return oneData.getAllGrilPhotoDataId();
}
return oneData.getAllGrilPhotoId();
}
/** 获取所有用来展示在列表的技师图片的id */
public getAllDisplayGrilPhotoId(categoryId: string, girlId: number): number[] {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return [];
// 所有id
let allId = oneData.getAllGrilPhotoId();
// 总聊天次数
let chatTotalCount = this.getChatTotalCount(categoryId, girlId);
// 用来展示的id
let displayIds = [];
for (let id of allId) {
let unlockCounts = oneData.getGrilPhotoUnlockCounts(id);
let price = oneData.getGrilPhotoPrice(id);
if (price <= 0) {
// 价格为0,代表免费
displayIds.push(id);
} else {
// 价格大于0,代表付费
let isUnlock = this.isImageUnlock(categoryId, girlId, id);
if (isUnlock) {
// 已经解锁
displayIds.push(id);
} else {
// 总聊天次数 大于等于 触发次数
if (chatTotalCount >= unlockCounts) {
displayIds.push(id);
}
}
}
}
return displayIds;
}
/** 获取第一个技师图片的资源路径 */
public getFirstGrilPhotoPath(categoryId: string, girlId: number): string {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return "";
// 第一个 id
const ids = this.getAllGrilPhotoDataId(categoryId, girlId);
const ids = this.getAllGrilPhotoId(categoryId, girlId);
const length = ids.length;
if (length <= 0) return "";
// 返回数据
@@ -339,19 +372,44 @@ export class GirlData extends BaseData {
return oneData.getAllGrilVideoDataCount();
}
/** 获取所有技师视频数据的id */
public getAllGrilVideoDataId(categoryId: string, girlId: number): number[] {
/** 获取所有技师视频的id */
public getAllGrilVideoId(categoryId: string, girlId: number): number[] {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return [];
return oneData.getAllGrilVideoDataId();
return oneData.getAllGrilVideoId();
}
/** 获取所有用来展示在列表的技师视频的id */
public getAllDisplayGrilVideoId(categoryId: string, girlId: number): number[] {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return [];
// 所有id
let allId = oneData.getAllGrilVideoId();
// 用来展示的id
let displayIds = [];
for (let id of allId) {
let price = oneData.getGrilVideoPrice(id);
if (price <= 0) {
// 价格为0,代表免费
displayIds.push(id);
} else {
// 价格大于0,代表付费
let isUnlock = this.isVideoUnlock(categoryId, girlId, id);
if (isUnlock) {
// 已经解锁
displayIds.push(id);
}
}
}
return displayIds;
}
/** 获取第一个技师视频的资源路径 */
public getFirstGrilVideoPath(categoryId: string, girlId: number): string {
let oneData = this.getGrilDetail(categoryId, girlId);
if (!oneData) return "";
// 第一个 id
const ids = this.getAllGrilVideoDataId(categoryId, girlId);
const ids = this.getAllGrilVideoId(categoryId, girlId);
const length = ids.length;
if (length <= 0) return "";
// 返回数据