Jelajahi Sumber

修改抽奖和分享游戏

smallqiang 6 tahun lalu
induk
melakukan
ac0d47ee27
2 mengubah file dengan 25 tambahan dan 13 penghapusan
  1. 24 12
      assets/scripts/common/Platform.js
  2. 1 1
      assets/scripts/draw/DrawContent.js

+ 24 - 12
assets/scripts/common/Platform.js

@@ -37,19 +37,31 @@ class Platform {
             this.handelOnShow();
         })
 
-        BK.onGameShare( () => {
-            BK.Script.log('分享事件,点击分享按钮触发');
-            let shareInfo = {
-                summary: '猜猜他是谁?',
-                picUrl: 'https://pub.dwstatic.com/wxgame/taptapstar_qq/share/qq_share.png',
-                extendInfo: ''
-            };
-            return shareInfo;
-        })
+        // BK.onGameShare( () => {
+        //     BK.Script.log('分享事件,点击分享按钮触发');
+        //     let shareInfo = {
+        //         summary: '猜猜他是谁?',
+        //         picUrl: 'https://pub.dwstatic.com/wxgame/taptapstar_qq/share/qq_share.png',
+        //         extendInfo: ''
+        //     };
+        //     return shareInfo;
+        // })
 
-        BK.onGameShareComplete( () => {
-            BK.Script.log('分享结果,分享事件完成');
-        })
+        new BK.Game({
+            onShare() {
+                BK.Script.log('分享事件,点击分享按钮触发');
+                let shareInfo = {
+                    summary: '猜猜他是谁?',
+                    picUrl: 'https://pub.dwstatic.com/wxgame/taptapstar_qq/share/qq_share.png',
+                    extendInfo: ''
+                };
+                return shareInfo;
+            }
+        });
+
+        // BK.onGameShareComplete( () => {
+        //     BK.Script.log('分享结果,分享事件完成');
+        // })
         // BK.Game.onNetworkChange( () => {
         //     console.log('网络情况改变');
         // })

+ 1 - 1
assets/scripts/draw/DrawContent.js

@@ -163,7 +163,7 @@ cc.Class({
     /// 看广告抽奖
     adNodeAction() {
         GameModule.audioMng.playClickButton();
-        if (CC_WECHATGAME) {
+        if (CC_WECHATGAME || CC_QQPLAY) {
             GameEvent.on(GameNotificationKey.ShowShareAction, this, (type) => {
                 this.shareActionCallback(type);
             });