Pārlūkot izejas kodu

Merge branch 'dev' into dev2

smallqiang 5 gadi atpakaļ
vecāks
revīzija
447d8f420d

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

+ 91 - 6
assets/scripts/utils/AudioMng.js

@@ -141,7 +141,21 @@ cc.Class({
      */
     playClickButton () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.buttonClickAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.playClickButtonAudioContext != null && this.playClickButtonAudioContext != undefined) {
+            //     // this.playClickButtonAudioContext.destory();
+            // }
+            this.playClickButtonAudioContext = tt.createInnerAudioContext();
+            this.playClickButtonAudioContext.autoplay = false;
+            this.playClickButtonAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/buttonClick.mp3';
+            this.playClickButtonAudioContext.play();
+            // this.playClickButtonAudioContext.onEnded(() => {
+            //     this.playClickButtonAudioContext.destory();
+            //     this.playClickButtonAudioContext = null;
+            // })
+        } else {
+            cc.audioEngine.play(this.buttonClickAudio, false, this.volume);
+        }
     },
 
     /**
@@ -149,7 +163,22 @@ cc.Class({
      */
     playGetAward () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.getAwardAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.playGetAwardAudioContext != null && this.playGetAwardAudioContext != undefined) {
+            //     // this.playGetAwardAudioContext.destory();
+            // }
+            this.playGetAwardAudioContext = tt.createInnerAudioContext();
+            this.playGetAwardAudioContext.autoplay = false;
+            this.playGetAwardAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/getAward.mp3';
+            this.playGetAwardAudioContext.play();
+            // this.playGetAwardAudioContext.onEnded(() => {
+            //     this.playGetAwardAudioContext.destory();
+            //     this.playGetAwardAudioContext = null;
+            // })
+        } else {
+            cc.audioEngine.play(this.getAwardAudio, false, this.volume);
+
+        }
     },
 
     /**
@@ -157,7 +186,21 @@ cc.Class({
      */
     playUpdateBuilding () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.updateBuildingAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.updateBuildingAudioContext != undefined && this.updateBuildingAudioContext != null) {
+            //     // this.updateBuildingAudioContext.destory();
+            // }
+            this.updateBuildingAudioContext = tt.createInnerAudioContext();
+            this.updateBuildingAudioContext.autoplay = false;
+            this.updateBuildingAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/updateBuilding.mp3';
+            this.updateBuildingAudioContext.play();
+            // this.updateBuildingAudioContext.onEnded(() => {
+            //     this.updateBuildingAudioContext.destory();
+            //     this.updateBuildingAudioContext = null;
+            // })
+        } else {
+            cc.audioEngine.play(this.updateBuildingAudio, false, this.volume);
+        }
     },
 
     /**
@@ -165,7 +208,21 @@ cc.Class({
      */
     playClickCat () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.clickCatAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.innerAudioContext != undefined && this.innerAudioContext != null) {
+            //     // this.innerAudioContext.destory();
+            // }
+            this.innerAudioContext = tt.createInnerAudioContext();
+            this.innerAudioContext.autoplay = false;
+            this.innerAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/clickCat.mp3';
+            this.innerAudioContext.play();
+            // this.innerAudioContext.onEnded(() => {
+            //     this.innerAudioContext.destory();
+            //     this.innerAudioContext = null;
+            // })
+        } else {
+            cc.audioEngine.play(this.clickCatAudio, false, this.volume)
+        }
     },
 
     /**
@@ -173,7 +230,21 @@ cc.Class({
      */
     playGetDraw () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.getDrawAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.getDrawAudioContext != undefined && this.getDrawAudioContext != null) {
+            //     // this.getDrawAudioContext.destory();
+            // }
+            this.getDrawAudioContext = tt.createInnerAudioContext();
+            this.getDrawAudioContext.autoplay = false;
+            this.getDrawAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/getDraw.mp3';
+            this.getDrawAudioContext.play();
+            // this.getDrawAudioContext.onEnded(() => {
+            //     this.getDrawAudioContext.destory();
+            //     this.getDrawAudioContext = null;
+            // })        
+        } else {
+            cc.audioEngine.play(this.getDrawAudio, false, this.volume);
+        }
     },
 
     /**
@@ -181,7 +252,21 @@ cc.Class({
      */
     playGetStar () {
         if (!this.soundEffectOpen) { return }
-        cc.audioEngine.play(this.getStarAudio, false, this.volume);
+        if (window.tt != undefined) {
+            // if (this.playGetStarAudioContext != undefined && this.playGetStarAudioContext != null) {
+            //     // this.playGetStarAudioContext.destory();
+            // }
+            this.playGetStarAudioContext = tt.createInnerAudioContext();
+            this.playGetStarAudioContext.autoplay = false;
+            this.playGetStarAudioContext.src = 'https://pub.dwstatic.com/wxgame/taptapstar_toutiao_test/sheet/getStar.mp3';
+            this.playGetStarAudioContext.play();
+            // this.playGetStarAudioContext.onEnded(() => {
+            //     this.playGetStarAudioContext.destory();
+            //     this.playGetStarAudioContext = null;
+            // })
+        } else {
+            cc.audioEngine.play(this.getStarAudio, false, this.volume);
+        }
     },
 
     /**