Kaynağa Gözat

音效及部分图片修改

sunyadv 5 yıl önce
ebeveyn
işleme
81a88d7769

BIN
minigame/WebContent/img/share_btn.png


BIN
minigame/WebContent/img/wait_cut.png


BIN
minigame/WebContent/img/wait_move.png


+ 6 - 4
minigame/WebContent/index.html

@@ -21,7 +21,7 @@
     <script src="https://cdn.bootcss.com/SoundJS/1.0.2/soundjs.min.js"></script>
     <script src="https://www.w3cways.com/demo/vconsole/vconsole.min.js?v=2.2.0"></script>
     <script>
-        window.ifDebug = true;
+        window.ifDebug = false;
         if (location.href.startsWith('http://')) {
         	location.href = location.href.replace('http','https');
         }
@@ -153,10 +153,12 @@
 	<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
     <script>
         //一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以
-        document.getElementById('music').play();
+        var music = document.getElementById('music').play();
+        music.volume = 0.1;
         //必须在微信Weixin JSAPI的WeixinJSBridgeReady才能生效
         document.addEventListener("WeixinJSBridgeReady", function () {
-            document.getElementById('music').play();
+            var music = document.getElementById('music').play();
+            music.volume = 0.1;
         }, false);
 
         function shareWeixin(msg) {
@@ -168,7 +170,7 @@
         			console.log(resp.code);
         		}else{
         			wx.config({
-        			    debug: false,
+        			    debug: true,
         			    appId: 'wx749c84daac654e1e',
         			    timestamp: resp.data.timestamp,
         			    nonceStr: resp.data.noncestr,

+ 16 - 71
minigame/WebContent/js/main.js

@@ -107,9 +107,11 @@ function handleComplete(evt, comp) {
         $(".select-dish-box").hide();
         $(".game-box").show();
         $(".cut-mode2").show();
+        setTimeout(function(){  $(".cut-mode2").hide(); }, 1500);
         $(".cut-mode2").on("touchend",function(){
             $(this).hide();  
         })
+
         $(".move-mode2").on("touchend",function(){
             $(this).hide();
         })
@@ -147,7 +149,6 @@ function handleComplete(evt, comp) {
     $(".replay-btn").on("click",function(){
         URLParams = new Array();
         window.location.href = "https://wx.ttkuaiban.com/minigame/";
-        //location.reload()
     })
     //$(".secret-btn").on("click",function(){
     //saveText();
@@ -208,21 +209,22 @@ function handleComplete(evt, comp) {
     }
     function oilIconAnim() {
         oilAnim();
-        var video = "";
+        var video = "" , noice = "";
         if(dishIndex == 0){
-            createjs.Sound.play("hsr");//播放
+            noice = createjs.Sound.play("hsr");//播放
             video = createjs.Sound.play("oil");//播放
         }else if(dishIndex == 1){
-            createjs.Sound.play("qcdf");//播放
+            noice = createjs.Sound.play("qcdf");//播放
             video = createjs.Sound.play("soup");//播放
         }else if(dishIndex == 2){
-            createjs.Sound.play("swy");//播放
+            noice = createjs.Sound.play("swy");//播放
         }else{
-            createjs.Sound.play("ymc");//播放
+            noice = createjs.Sound.play("ymc");//播放
             video = createjs.Sound.play("oil");//播放
         }
-
-        setTimeout(function(){ video.paused = true; }, 5000);
+        noice.volume = 1;
+        video.volume = 0.2;
+        setTimeout(function(){ video.paused = true; }, 4500);
 
         var anim = new TimelineMax({ repeat:10,delay:1});
         anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
@@ -584,7 +586,7 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material1.x -=300;
                 exportRoot.blackboard.material1.y -=180;
                 // $(".shake-mode").show();
-                setTimeout(function(){ shakeInit(); }, 3000);
+                setTimeout(function(){ shakeInit(); }, 2000);
                 if(dishIndex == 0){
                     exportRoot.pot.hsr.play();
                 }else if(dishIndex == 1){
@@ -618,7 +620,7 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material2.x -=120;
                 exportRoot.blackboard.material2.y -=180;
                 // $(".shake-mode").show();
-                setTimeout(function(){ shakeInit(); }, 3000);
+                setTimeout(function(){ shakeInit(); }, 2000);
                 if(dishIndex == 0){
                     exportRoot.pot.hsr.play();
                 }else if(dishIndex == 1){
@@ -652,7 +654,7 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material3.x +=30;
                 exportRoot.blackboard.material3.y -=180;
                 // $(".shake-mode").show();
-                setTimeout(function(){ shakeInit(); }, 3000);
+                setTimeout(function(){ shakeInit(); }, 2000);
 
                 if(dishIndex == 0){
                     exportRoot.pot.hsr.play();
@@ -684,6 +686,7 @@ function handleComplete(evt, comp) {
         bowlAnim(function() {
 
             $(".move-mode2").show();
+            setTimeout(function(){  $(".move-mode2").hide(); }, 1500);
             if(dishIndex == 0){
                 dishMove(exportRoot.plate.hsr_icon1,0,0);
                 dishMove(exportRoot.plate.hsr_icon2,0,0);
@@ -731,7 +734,6 @@ function handleComplete(evt, comp) {
 
         function deviceMotionHandler(eventData) {
             var acceleration = eventData.accelerationIncludingGravity;
-            console.log(acceleration);
             var curTime = new Date().getTime();
             if ((curTime - last_update) > 10) {
                 var diffTime = curTime - last_update;
@@ -740,12 +742,11 @@ function handleComplete(evt, comp) {
                 y = acceleration.y;
                 z = acceleration.z;
                 var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
-                console.log('speed='+speed+',SHAKE_THRESHOLD='+SHAKE_THRESHOLD)
                 if (speed > SHAKE_THRESHOLD) {
                     if(!createTime) {
 						createTime = true;
 						var video = createjs.Sound.play("shake");//播放
-						setTimeout(function(){ video.paused = true;createTime = false; }, 5000);
+						setTimeout(function(){ video.paused = true;createTime = false; }, 2500);
 					}
                     $(".shake-mode2").hide();
                     $(".shake-mode").show();
@@ -887,16 +888,6 @@ function getInfo() {
                 $('#poster').attr('src','./img/poster/ymc_fen.png');
             }
         }
-
-        // if(dishType == 0){
-        //     $('#poster').attr('src','./img/poster/hsr.png');
-        // }else if(dishType == 1){
-        //     $('#poster').attr('src','./img/poster/qcdf.png');
-        // }else if(dishType == 2){
-        //     $('#poster').attr('src','./img/poster/swy.png');
-        // }else{
-        //     $('#poster').attr('src','./img/poster/ymc.png');
-        // }
         getMsg();
         $(".poster-mode").fadeIn();
     } else {
@@ -1039,54 +1030,8 @@ function saveText() {
                 if(href != document.location.href){
                     history.pushState("", "Title", href);
                 }
-
-                shareWeixin(msg.data.message);
                 //海报页面的微信分享
-//                $.post("./user/getWxConfigParam?url=" + href, {}, function(resp) {
-//            		if (resp.code == 'error') {
-//            			console.log(resp.code);
-//            		}else{
-//            			wx.config({
-//            			    debug: false,
-//            			    appId: 'wx749c84daac654e1e',
-//            			    timestamp: resp.data.timestamp,
-//            			    nonceStr: resp.data.noncestr,
-//            			    signature: resp.data.sign,
-//            			    jsApiList: ['onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo', 'onMenuShareQZone', 'showOptionMenu', 'hideAllNonBaseMenuItem', 'showAllNonBaseMenuItem']
-//            			});
-//            			wx.ready(function(){
-//            				const share = {
-//            			        title: "我为你精心准备的美味,快享用吧!",
-//            			        desc: "",
-//            			        imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
-//            			        link: href,
-//            			        success: function() {
-//            			        	$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
-//            		    				if (resp.code == 'error') {
-//            		    					console.log(resp.code);
-//            		    				}else{
-//            		    					window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
-//            		    				}
-//            		    			});
-//            			        },
-//            			        cancel: function() {}
-//            			    };
-//            			    wx.onMenuShareAppMessage(share);
-//            			    wx.onMenuShareTimeline(share);
-//            			    wx.onMenuShareQQ(share);
-//            			    wx.onMenuShareQZone(share);
-//            			    wx.onMenuShareWeibo(share);
-//            			});
-//            			wx.error(function(res){
-//            				console.log(res);
-//            			});
-//            		};
-//            	});
-                //if(type == 1) {
-//                setTimeout(function(){
-//                    window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
-//                }, 10000);
-                //}
+                shareWeixin(msg.data.message);
             }else{
                 console.log("错误"+xhr.status)
             }

+ 0 - 10
minigame/WebContent/js/music.js

@@ -32,13 +32,3 @@ function is_weixn(){
         return false;
     }
 }
-
-
-document.addEventListener("WeixinJSBridgeReady", function () {
-    document.getElementById('music').play();
-}, false);
-
-window.οnlοad=function(){
-
-    //$('#mc_play').click();
-}

+ 9 - 9
minigame/WebContent/js/wechat.js

@@ -1,13 +1,13 @@
 (function(){
-    var init = {
-        url:window.location.href.split('#')[0],
-        share: {
-            title: '',
-            desc: '',
-            imgUrl: './img/share_img.jpg?v=v72',
-            link:window.location.href.split('#')[0]
-        }
-    };
+    // var init = {
+    //     url:window.location.href.split('#')[0],
+    //     share: {
+    //         title: '',
+    //         desc: '',
+    //         imgUrl: './img/share_img.jpg?v=v72',
+    //         link:window.location.href.split('#')[0]
+    //     }
+    // };
 
 	/*
     $.ajax({