dzduole 1 mesiac pred
rodič
commit
566a07d5e8
1 zmenil súbory, kde vykonal 53 pridanie a 25 odobranie
  1. 53 25
      client/laya/src/ui/UIAddProp.ts

+ 53 - 25
client/laya/src/ui/UIAddProp.ts

@@ -76,6 +76,8 @@ export default class UIAddProp extends UIBase {
         if (data >= xGame.common.maxShareDiamondTimes) {
             this.ui.myNode.node1.shareTxt.text = "Available Tomorrow"
             this.ui.myNode.node1.touchable = false;
+
+            xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
         }
         else {
             this.ui.myNode.node1.shareTxt.text = `(${data}/${xGame.common.maxShareDiamondTimes})`
@@ -184,40 +186,66 @@ export default class UIAddProp extends UIBase {
     shareGetDiamond() {
         let times = DataMgr.getShareDiamondTimes();
         if (times >= xGame.common.maxShareDiamondTimes) {
+            console.log('zh: 233333333333 maxShareDiamondTimes')
             xGame.uiMgr.Show(UIMsg, "Come back tomorrow");
         }
         else {
-            if (Moyu.isTT) {
-                let num = cfgTable.moneyData[1].num;
-                Moyu.shareVideo = ''
-                Moyu.shareGame((success) => {
-                    if (success) {
-                        xGame.uiMgr.Show(UIMsg, "分享成功!");
-                        xGame.common.playObjFlyAnim(num, Prop.diamond);
-                        DataMgr.setShareDiamondTimes(1);
-                        this.updateDiamondShare();
-                    }
-                    else {
-                        xGame.uiMgr.Show(UIMsg, "分享失败!");
-                    }
-                })
-            }
-            else {
-                //
-                Moyu.showVideoAd(() => {//分享
-                    let diamond = xGame.common.randomNum(50, 100);
-                    xGame.common.playObjFlyAnim(diamond, Prop.diamond);
-                    DataMgr.setShareDiamondTimes(1);
-                    this.updateDiamondShare();
-                }, EAdType.randomDiamond)
-                //
+            console.log('zh:33333333333333ad')
+            // if (Moyu.isTT) {
+            //     let num = cfgTable.moneyData[1].num;
+            //     Moyu.shareVideo = ''
+            //     Moyu.shareGame((success) => {
+            //         if (success) {
+            //             xGame.uiMgr.Show(UIMsg, "分享成功!");
+            //             xGame.common.playObjFlyAnim(num, Prop.diamond);
+            //             DataMgr.setShareDiamondTimes(1);
+            //             this.updateDiamondShare();
+            //         }
+            //         else {
+            //             xGame.uiMgr.Show(UIMsg, "分享失败!");
+            //         }
+            //     })
+            // }
+            // else {
+            //     //
+            //     Moyu.showVideoAd(() => {//分享
+            //         let diamond = xGame.common.randomNum(50, 100);
+            //         xGame.common.playObjFlyAnim(diamond, Prop.diamond);
+            //         DataMgr.setShareDiamondTimes(1);
+            //         this.updateDiamondShare();
+            //     }, EAdType.randomDiamond)
+            //     //
+            // }
+
+
+            // Moyu.showVideoAd(() => {//分享
+            //     let diamond = xGame.common.randomNum(50, 100);
+            //     xGame.common.playObjFlyAnim(diamond, Prop.diamond);
+            //     DataMgr.setShareDiamondTimes(1);
+            //     this.updateDiamondShare();
+            // }, EAdType.randomDiamond)
+
+            console.log('zh:qjff_AD_for_uiAddProp_shareGetDiamond')
+            // GlobalManager.instance.registerMethod('xxxxx',this.xxxxx);
+            // JSBridgeUtils.instance.showRewardAd('xxxxx');
+            //需要传递参数
+            //Laya.LocalStorage.setItem('temp_qjff_AD_for_uiGameEnd_level', level+'');
+            if (JSBridgeUtils.instance.showRewardAd('qjff_AD_for_uiAddProp_shareGetDiamond')) {
+
+            } else {
+                console.log('zh:AD 失败,直接发放奖励')
+                this.qjff_AD_for_uiAddProp_shareGetDiamond();
             }
+
         }
     }
 
 
     public qjff_AD_for_uiAddProp_shareGetDiamond() {
-
+        let diamond = xGame.common.randomNum(50, 100);
+        xGame.common.playObjFlyAnim(diamond, Prop.diamond);
+        DataMgr.setShareDiamondTimes(1);
+        this.updateDiamondShare();
     }