Kaynağa Gözat

修改抽奖和分享游戏

smallqiang 6 yıl önce
ebeveyn
işleme
ac0d47ee27

+ 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);
             });