|
@@ -32,12 +32,15 @@ export class ExchangeItemRenderScript extends Component {
|
|
|
|
|
|
private data: any;
|
|
|
|
|
|
+ private gold:number;
|
|
|
UpdateItemRender(data: any): void {
|
|
|
this.data = data;
|
|
|
let time: number = data.time / 60 / 60;
|
|
|
+ this.gold=GameModel.single.fullEarnings * data.time;
|
|
|
+
|
|
|
this.timeLabel.string = time + "小时枪械收益";
|
|
|
this.timeLabel1.string = "立即获得" + time + "小时枪械收益!";
|
|
|
- this.goldLabel.string = StringUtils.numberUtilsEn(GameModel.single.fullEarnings * data.time);
|
|
|
+ this.goldLabel.string = StringUtils.numberUtilsEn(this.gold);
|
|
|
this.diamondLabel.string = StringUtils.numberUtilsEn(data.useDiamond, 0);
|
|
|
}
|
|
|
|
|
@@ -49,6 +52,7 @@ export class ExchangeItemRenderScript extends Component {
|
|
|
NoticeManager.ShowPrompt("钻石不足!");
|
|
|
} else {
|
|
|
GameModel.single.diamond -= this.data.useDiamond;
|
|
|
+ GameModel.single.gold+=this.gold;
|
|
|
let weChat = PlatformManager.impl as WeChatPlatform;
|
|
|
if (weChat instanceof WeChatPlatform) {
|
|
|
weChat.branchAnalytics(branchIdType.GoldExchange, String(this.data.useDiamond))
|