Selaa lähdekoodia

修改头条分享回调和7天登录

smallqiang 5 vuotta sitten
vanhempi
commit
76ab4b4653

+ 11 - 6
assets/scripts/common/Platform.js

@@ -394,17 +394,22 @@ class Platform {
                 let difference = curTime - onHideTime;
 
                 var isShareOk = false;
-                //判断是否忽略分享的状态
-                if (GameGlobal.isIgnoreShareStatus) {
+                
+                if (window.tt != undefined) {
                     isShareOk = true;
                 } else {
-                    //在分享界面停留了3秒当作分享成功,如果少于3秒即有10%概率当作成功
-                    if (difference > 3000) {
+                    //判断是否忽略分享的状态
+                    if (GameGlobal.isIgnoreShareStatus) {
                         isShareOk = true;
                     } else {
-                        let randomOk = Math.random() <= 0.1 ? true : false;
-                        if (randomOk) {
+                        //在分享界面停留了3秒当作分享成功,如果少于3秒即有10%概率当作成功
+                        if (difference > 3000) {
                             isShareOk = true;
+                        } else {
+                            let randomOk = Math.random() <= 0.1 ? true : false;
+                            if (randomOk) {
+                                isShareOk = true;
+                            }
                         }
                     }
                 }

+ 1 - 1
assets/scripts/game/HomeSideCtrl.js

@@ -77,7 +77,7 @@ cc.Class({
         }
 
         //判断正在审核中的版本隐藏7天登录按钮或已完成7天登录任务
-        if (GameGlobal.isCheck || (GameGlobal.userLoginReward.isLoginReward && GameGlobal.userLoginReward.rewardCount == 7)) {
+        if (GameGlobal.isCheck || GameGlobal.userLoginReward.rewardCount >= 7) {
             this.loginRewardNode.active = false;
             this.moreContentWidth = 225;
             if (window.tt != undefined) {

+ 2 - 2
assets/scripts/net/WeChat.js

@@ -210,7 +210,7 @@ class WeChat {
                 imageUrl: 'https://pub.dwstatic.com/wxgame/taptapstar/share/' + shareObjct.icon,
                 query: 'uid=' + GameGlobal.user.uid + '&shareType=' + ShareAction.INVITE_FRIEND,
                 success: (res) => {
-                    console.log('分享成功');
+                    console.log('头条分享成功');
                     success && success();
                     if (GameGlobal.clickShare) {
                         GameEvent.fire(GameNotificationKey.ShowShareAction, GameGlobal.gameShareType, true);
@@ -225,7 +225,7 @@ class WeChat {
                     }
                 },
                 fail: () => {
-                    console.log('分享失败或取消');
+                    console.log('头条分享失败或取消');
                     fail && fail();
                     if (GameGlobal.clickShare) {
                         GameEvent.fire(GameNotificationKey.ShowShareAction, GameGlobal.gameShareType, false);