update
This commit is contained in:
@@ -13,7 +13,10 @@ import { DataManager, DataId } from "../../data/DataManager";
|
||||
import { WalletData } from "../../data/WalletData";
|
||||
import { ShopData } from "../../data/ShopData";
|
||||
import { GirlData } from "../../data/GirlData";
|
||||
import proto from 'db://assets/Scripts/proto/proto.pb.js';
|
||||
import proto from "db://assets/Scripts/proto/proto.pb.js";
|
||||
import { ConfigId, ConfigManager } from "../../manager/ConfigManager";
|
||||
import { PurchaseConfig } from "../../config/PurchaseConfig";
|
||||
import LanguageUtils from "../../../Main/Common/LanguageUtils";
|
||||
const { ccclass, property } = _decorator;
|
||||
|
||||
@ccclass("PayToTalkSubpanel")
|
||||
@@ -42,6 +45,13 @@ export class PayToTalkSubpanel extends Component {
|
||||
this.base.opacity = 0;
|
||||
this.categoryId = Number(categoryId);
|
||||
this.girlId = girlId;
|
||||
|
||||
const cfg = ConfigManager.I.getDataById<PurchaseConfig>(ConfigId.Purchase);
|
||||
const count = cfg.getCountById(cfg.getChatIds()[0]);
|
||||
|
||||
this.timeBtnLabel.string =
|
||||
count + LanguageUtils.getText("chatpanel.buy10times");
|
||||
|
||||
tween(this.base).to(0.3, { opacity: 255 }).start();
|
||||
}
|
||||
|
||||
@@ -93,12 +103,16 @@ export class PayToTalkSubpanel extends Component {
|
||||
const resData = res.data;
|
||||
// 保存数据
|
||||
const girlData = DataManager.I.getDataById<GirlData>(DataId.Girl);
|
||||
girlData.setChatRemainCount(this.categoryId.toString(), girlId, resData.chatRemainCount);
|
||||
girlData.setChatRemainCount(
|
||||
this.categoryId.toString(),
|
||||
girlId,
|
||||
resData.chatRemainCount
|
||||
);
|
||||
const walletData = DataManager.I.getDataById<WalletData>(DataId.Wallet);
|
||||
walletData.balance = Number(resData.balance);
|
||||
walletData.vipExpire = Number(resData.vipExpire);
|
||||
// 刷新界面
|
||||
this.hide();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user