Jelajahi Sumber

金币兑换 未增加钱的BUG

greg 4 tahun lalu
induk
melakukan
116b4a8115

+ 5 - 1
assets/scripts/games/ui/exchanges/ExchangeItemRenderScript.ts

@@ -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))