update
This commit is contained in:
@@ -21,6 +21,9 @@ import LanguageUtils, {
|
||||
} from "../../../Main/Common/LanguageUtils";
|
||||
import AudioManager from "../../../Main/Manager/AudioManager";
|
||||
import { NavigationManager } from "../../manager/NavigationManager";
|
||||
import { PlayerDataService } from "../../network/services/PlayerDataService";
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PersonalPanel")
|
||||
@@ -82,14 +85,25 @@ export class PersonalPanel extends li_BaseView {
|
||||
}
|
||||
}
|
||||
|
||||
private refresh(): void {
|
||||
private async refresh() {
|
||||
const reqData = {};
|
||||
let res = await PlayerDataService.I.reqMyInfo(reqData);
|
||||
console.log("个人信息响应数据:", res);
|
||||
if (res && res.code === proto.cs.EnmRetCode.SUCCESS) {
|
||||
const resData = res.data;
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
walletData.balance = Number(resData.balance);
|
||||
walletData.vipExpire = Number(resData.vipExpire);
|
||||
}
|
||||
|
||||
this.updateUserInfo();
|
||||
this.updateBalance();
|
||||
this.updateVipStatus();
|
||||
}
|
||||
|
||||
private updateUserInfo(): void {
|
||||
private updateUserInfo() {
|
||||
// 更新用户名
|
||||
|
||||
if (this.userNameLabel && this.playerData) {
|
||||
const userName = this.playerData.name || "未设置";
|
||||
this.userNameLabel.string = userName;
|
||||
|
||||
Reference in New Issue
Block a user