update
This commit is contained in:
@@ -25,12 +25,14 @@ import { ImagePopup } from "../components/ImagePopup";
|
||||
import ResManager from "db://assets/Scripts/Main/Manager/ResManager";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
import { UITransitionHelper } from "../../utils/UITransitionHelper";
|
||||
import { VideoEmotion, purchase } from "../../../schema/schema";
|
||||
import { PriceType, VideoEmotion, purchase } from "../../../schema/schema";
|
||||
import { PayToTalkSubpanel } from "./PayToTalkSubpanel";
|
||||
import { DataId, DataManager } from "../../data/DataManager";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import { SceneBgVideoLayer } from "../../../Sub/UI/SceneBgVideoLayer";
|
||||
import { NavigationManager, PanelType } from "../../manager/NavigationManager";
|
||||
import { GirlService } from "../../network/services/GirlService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("ChatPanel")
|
||||
@@ -143,15 +145,33 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
this.chatController = null;
|
||||
}
|
||||
}
|
||||
refresh() {
|
||||
async refresh() {
|
||||
const newRoleId = NavigationManager.Instance.getSelectedGirlId();
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
|
||||
// 检查是否是切换角色
|
||||
const isRoleSwitch = this.id && this.id !== newRoleId;
|
||||
|
||||
this.id = newRoleId;
|
||||
this.categoryId =
|
||||
NavigationManager.Instance.getSelectedThemeId().toString();
|
||||
NavigationManager.Instance.getSelectedCategoryId().toString();
|
||||
|
||||
const isFree =
|
||||
girlData.getGrilPriceType(this.categoryId.toString(), this.id) ==
|
||||
PriceType.free;
|
||||
const isRelease = girlData.getIsRelease(
|
||||
this.categoryId.toString(),
|
||||
this.id
|
||||
);
|
||||
if (!isFree && !isRelease) {
|
||||
//未解锁
|
||||
ViewManager.I.openBundlesPopupView("GirlListPopupPanel", {
|
||||
base: this,
|
||||
category: this.categoryId,
|
||||
id: this.id,
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 获取ChatController单例并绑定当前Panel
|
||||
this.chatController = ChatController.Instance;
|
||||
@@ -177,9 +197,19 @@ export class ChatPanel extends li_BaseView implements IChatPanelCallback {
|
||||
}
|
||||
}
|
||||
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
|
||||
this.nameKey = girlData.getGrilName(this.categoryId, this.id);
|
||||
if (this.nameKey == "") {
|
||||
const reqData = {
|
||||
id: this.id,
|
||||
};
|
||||
let res = await GirlService.I.reqGetGirlDetail(reqData);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
// 保存数据
|
||||
girlData.setGirlDetailData(this.categoryId.toString(), res.data);
|
||||
this.nameKey = girlData.getGrilName(this.categoryId, this.id);
|
||||
}
|
||||
}
|
||||
|
||||
this.girlName.string = LanguageUtils.getText(this.nameKey);
|
||||
|
||||
// 通过ChatController获取商业视频数据
|
||||
|
||||
Reference in New Issue
Block a user