协议更新
This commit is contained in:
@@ -49,10 +49,10 @@ export class GirlDetailConfig extends BaseConfig {
|
||||
}
|
||||
|
||||
/** 根据 id 获取 commercialImages数量 */
|
||||
public getCommercialImagesCount(id: number): any | null {
|
||||
public getCommercialImagesCount(id: number): number | null {
|
||||
let oneData = this.getCommercialImagesById(id);
|
||||
if (!oneData) return null;
|
||||
return oneData.commercialImages.size;
|
||||
return oneData.length;
|
||||
}
|
||||
|
||||
/** 根据 id 和 index 获取图片类型 */
|
||||
@@ -87,10 +87,10 @@ export class GirlDetailConfig extends BaseConfig {
|
||||
}
|
||||
|
||||
/** 根据 id 获取 commercialVideos数量 */
|
||||
public getCommercialVideosCount(id: number): any | null {
|
||||
public getCommercialVideosCount(id: number): number | null {
|
||||
let oneData = this.getCommercialVideosById(id);
|
||||
if (!oneData) return null;
|
||||
return oneData.commercialVideos.size;
|
||||
return oneData.length;
|
||||
}
|
||||
|
||||
/** 根据 id 和 index 获取视频路径 */
|
||||
|
||||
@@ -234,7 +234,6 @@ export class GirlData extends BaseData {
|
||||
if (!d) return;
|
||||
// 合并简要信息
|
||||
if (d.brief) this.mergeBriefs(categoryId, [d.brief]);
|
||||
|
||||
const oneDetail = this.parseOneGirlDetail(d);
|
||||
const bucket = this.ensureBucket(categoryId);
|
||||
// id
|
||||
|
||||
@@ -137,6 +137,7 @@ export class MockGirlService implements IGirlService {
|
||||
|
||||
let photoData = [];
|
||||
let photoCount = girlDetailConfig.getCommercialImagesCount(girlId);
|
||||
|
||||
for (let i = 0; i < photoCount; i++) {
|
||||
let imagePath = girlDetailConfig.getImagePathById(girlId, i);
|
||||
let isImageRelease = Math.random() < 0.4;
|
||||
@@ -146,7 +147,7 @@ export class MockGirlService implements IGirlService {
|
||||
}
|
||||
|
||||
let detail = this.genDetail(briefData, desc, photoData, isRelease, chatCount);
|
||||
|
||||
// 返回数据
|
||||
return this.ok({ detail });
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,6 +17,10 @@ import Utils from "../../../Main/Common/Utils";
|
||||
import { InnerMsgCode } from "../../../Main/Config/InnerMsgCode";
|
||||
import { SimpleToggle } from "../components/SimpleToggle";
|
||||
import { GirlDetail, purchase } from "../../../schema/schema";
|
||||
import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { GirlService } from "db://assets/Scripts/chat18x/network/services/GirlService";
|
||||
import proto from 'db://assets/Scripts/proto/proto.pb.js';
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@@ -132,12 +136,62 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
nameKey: string;
|
||||
tagKey: string;
|
||||
category;
|
||||
refresh(index: number) {
|
||||
async refresh(index: number) {
|
||||
// TODO,暂时这样获取,修改后从GirlData获取
|
||||
const girlConfig = ConfigManager.tables.TbGirls.get(this.id);
|
||||
this.category = girlConfig.category;
|
||||
// 请求详细数据
|
||||
const reqData = {
|
||||
id: this.id,
|
||||
};
|
||||
// let res = await GirlService.I.reqGetGirlDetail(reqData);
|
||||
// console.log("看看响应数据:", res);
|
||||
// if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
// // 保存数据
|
||||
// const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
// girlData.setGirlDetails(this.category.toString(), res.data);
|
||||
// // 根据数据,刷新界面
|
||||
// this.nameKey = girlData.getGrilName(this.category, this.id);
|
||||
// this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
// this.desc.string = girlData.getGrilDesc(this.category, this.id);
|
||||
|
||||
// let desc = "";
|
||||
// this.tagKey = girlData.getGrilTagKey(this.category, this.id);
|
||||
// const tags = LanguageUtils.getText(this.tagKey).split("|");
|
||||
// for (let i = 0; i < tags.length; i++) {
|
||||
// if (i != 0) desc += "|";
|
||||
// desc += tags[i];
|
||||
// }
|
||||
// this.tags.string = desc;
|
||||
// for (let i = 0; i < 5; i++) {
|
||||
// this.starParent.children[i].active = i < 5;
|
||||
// }
|
||||
// let age = girlData.getGrilAge(this.category, this.id);
|
||||
// this.descAge.string =
|
||||
// LanguageUtils.getText("girldetailpanel.age") + age.toString();
|
||||
|
||||
// // TODO
|
||||
// const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
|
||||
// ResManager.I.changeBundleVideo(
|
||||
// this.avatarVideo,
|
||||
// dataDetail.commercialVideos[0].path,
|
||||
// "Chat18x"
|
||||
// );
|
||||
|
||||
// // 也立即尝试调整(以防已经加载完成)
|
||||
// this.adjustVideoScale();
|
||||
// this.vids = dataDetail.commercialVideos.slice(0);
|
||||
// this.refreshImgs(dataDetail.commercialImages);
|
||||
|
||||
|
||||
// }
|
||||
|
||||
|
||||
const dataDetail = ConfigManager.tables.TbGirlsDetail.get(this.id);
|
||||
console.log(dataDetail);
|
||||
|
||||
const data = ConfigManager.tables.TbGirls.get(this.id);
|
||||
this.category = data.category;
|
||||
this.nameKey = data.nameKey;
|
||||
this.girlName.string = LanguageUtils.getText(data.nameKey);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user