修改:协议和配置表
This commit is contained in:
@@ -145,7 +145,7 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
let res = await GirlService.I.reqGetGirlDetail(reqData);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
// 保存数据
|
||||
girlData.setGirlDetails(this.category.toString(), res.data);
|
||||
girlData.setGirlDetailData(this.category.toString(), res.data);
|
||||
// 根据数据,刷新界面
|
||||
this.nameKey = girlData.getGrilName(this.category.toString(), this.id);
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
@@ -173,39 +173,41 @@ export class GirlDetailPanel extends li_BaseView {
|
||||
"Chat18x"
|
||||
);
|
||||
|
||||
let allPhotoDataCount = girlData.getAllGrilPhotoDataCount(this.category.toString(), this.id);
|
||||
let resIds = girlData.getAllGrilPhotoDataId(this.category.toString(), this.id);
|
||||
// 也立即尝试调整(以防已经加载完成)
|
||||
this.adjustVideoScale();
|
||||
this.refreshImgs(1, this.category, this.id, allPhotoDataCount);
|
||||
this.refreshImgs(1, this.category, this.id, resIds);
|
||||
}
|
||||
}
|
||||
|
||||
bindImgToggle() {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
let allPhotoDataCount = girlData.getAllGrilPhotoDataCount(this.category.toString(), this.id);
|
||||
this.refreshImgs(1, this.category, this.id, allPhotoDataCount);
|
||||
let resIds = girlData.getAllGrilPhotoDataId(this.category.toString(), this.id);
|
||||
this.refreshImgs(1, this.category, this.id, resIds);
|
||||
}
|
||||
|
||||
bindVideoToggle() {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
let allVideoDataCount = girlData.getAllGrilVideoDataCount(this.category.toString(), this.id);
|
||||
this.refreshImgs(2, this.category, this.id, allVideoDataCount);
|
||||
let resIds = girlData.getAllGrilVideoDataId(this.category.toString(), this.id);
|
||||
this.refreshImgs(2, this.category, this.id, resIds);
|
||||
}
|
||||
|
||||
refreshImgs(
|
||||
type: number,
|
||||
category: number,
|
||||
id: number,
|
||||
count: number
|
||||
resIds: number[]
|
||||
) {
|
||||
for (let i = this.imgsLayout.children.length - 1; i >= 0; i--) {
|
||||
this.imgsLayout.children[i].destroy();
|
||||
}
|
||||
|
||||
let count = resIds.length;
|
||||
for (let i = 0; i < count; i++) {
|
||||
let newNode = instantiate(this.imgItemInst.node);
|
||||
let item = newNode.getComponent(DetailImageItem);
|
||||
item.refresh(this, type, category, id, i);
|
||||
let resId = resIds[i];
|
||||
item.refresh(this, type, category, id, resId);
|
||||
newNode.active = true;
|
||||
this.imgsLayout.addChild(newNode);
|
||||
}
|
||||
|
||||
@@ -50,7 +50,7 @@ export class GirlListPanel extends li_BaseView {
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
// 保存数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
girlData.setGirlBriefs(category.toString(), res.data);
|
||||
girlData.setGirlList(category.toString(), res.data);
|
||||
// 根据数据,刷新界面
|
||||
const allId = girlData.getGirlIds(category.toString());
|
||||
for (let id of allId) {
|
||||
|
||||
@@ -95,9 +95,9 @@ export class ThemePanel extends li_BaseView {
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
girlData.setDailyRecommend(res2.data);
|
||||
// 根据数据,刷新界面
|
||||
this.recId = girlData.getRecommendGrilId(0);
|
||||
this.rectNameKey = girlData.getRecommendGrilName(0);
|
||||
let avatarPath = girlData.getRecommendGrilAvatar(0);
|
||||
this.recId = girlData.getRecommendGirlId();
|
||||
this.rectNameKey = girlData.getRecommendGrilName();
|
||||
let avatarPath = girlData.getRecommendGrilAvatar();
|
||||
//this.recName.string = LanguageUtils.getText(this.rectNameKey);
|
||||
ResManager.I.changeBundleSpriteFrame(
|
||||
this.recSprite,
|
||||
|
||||
Reference in New Issue
Block a user