瀏覽代碼

update coin update

zy_1995 6 月之前
父節點
當前提交
0038755874
共有 2 個文件被更改,包括 15 次插入4 次删除
  1. 6 2
      assets/Module/Store/Script/Store.ts
  2. 9 2
      assets/Scene/Script/Lobby.js

+ 6 - 2
assets/Module/Store/Script/Store.ts

@@ -182,9 +182,13 @@ export default class Store extends cc.Component {
         this.gotNode.active = false;
         this.gotNode.active = false;
     }
     }
 
 
-    private buyGoodReturn() {
+    private buyGoodReturn(newCoin: number = 0) {
         // this.paying = false;
         // this.paying = false;
-        this.updateCoin();
+        if (!!newCoin) {
+            this.coinLab.string = "" + newCoin;
+        } else {
+            this.updateCoin();
+        }
         this.showBoughtCoin(this.buyIndex);
         this.showBoughtCoin(this.buyIndex);
         this.buyIndex = 0;
         this.buyIndex = 0;
     }
     }

+ 9 - 2
assets/Scene/Script/Lobby.js

@@ -1001,6 +1001,14 @@ cc.Class({
         this.orderCallback = callback;
         this.orderCallback = callback;
     },
     },
 
 
+    onBurSuccessUpdate(info) {
+        this.orderCallback && this.orderCallback(info.UserMedal);
+        if (!info.UserMedal) {
+            return;
+        }
+        this.m_RoomCard.string = info.UserMedal;
+    },
+
     onBuyGoodCallback(payData) {
     onBuyGoodCallback(payData) {
         if (0 == this.orderId) {
         if (0 == this.orderId) {
             return cc.error("buy good receip No OrderId!");
             return cc.error("buy good receip No OrderId!");
@@ -1019,9 +1027,8 @@ cc.Class({
             if ("0" != info.return && 0 != info.return) {
             if ("0" != info.return && 0 != info.return) {
                 return cc.error("post buy good receip Error!");
                 return cc.error("post buy good receip Error!");
             }
             }
-            this.OnBtRefeshRoomCard();
+            this.onBurSuccessUpdate(info);
             this.orderId = 0;
             this.orderId = 0;
-            this.orderCallback && this.orderCallback();
             ThirdPartyReturnPayReceiptVerification(info.transaction_id);
             ThirdPartyReturnPayReceiptVerification(info.transaction_id);
         });
         });
     },
     },