浏览代码

1 切菜 移菜提示触屏消失
2 生熟菜变化

wolftooth 5 年之前
父节点
当前提交
90a0369552

文件差异内容过多而无法显示
+ 351 - 75
minigame/WebContent/assets.js


二进制
minigame/WebContent/images/assets_atlas_P_3.png


二进制
minigame/WebContent/images/assets_atlas_P_4.png


+ 4 - 4
minigame/WebContent/index.html

@@ -149,11 +149,11 @@
     <script src="./js/wechat.js"></script>
     <script src="./assets.js?v=2"></script>
     <script src="./js/music.js?v=1"></script>
-    <script src="./js/main.js?v=7"></script>
+    <script src="./js/main.js?v=8"></script>
     <script src="https://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
-	<!-- 必须加在微信api资源 --> 
-	<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script> 
-	<script> 
+    <!-- 必须加在微信api资源 --> 
+	<script src="https://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
+     <script>
 	//一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以 
 	document.getElementById('music').play(); 
 	//必须在微信Weixin JSAPI的WeixinJSBridgeReady才能生效 

+ 44 - 7
minigame/WebContent/js/main.js

@@ -107,10 +107,10 @@ function handleComplete(evt, comp) {
         $(".select-dish-box").hide();
         $(".game-box").show();
         $(".cut-mode2").show();
-        $(".cut-mode2").on("click",function(){
+        $(".cut-mode2").on("touchend",function(){
             $(this).hide();  
         })
-        $(".move-mode2").on("click",function(){
+        $(".move-mode2").on("touchend",function(){
             $(this).hide();
         })
 
@@ -555,6 +555,13 @@ function handleComplete(evt, comp) {
             materialEnterAnim(exportRoot.blackboard.material3,0.6);
 
             ballAnim(exportRoot.ball1);
+            if(dishIndex == 0){
+                exportRoot.pot.hsr.play();
+            }else if(dishIndex == 1){
+                exportRoot.pot.qcdf.play();
+            }else{
+                exportRoot.pot.ymc.play();
+            }
         })
 
         exportRoot.blackboard.material1.addEventListener("mousedown", function() {
@@ -578,7 +585,16 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material1.y -=180;
                 // $(".shake-mode").show();
                 setTimeout(function(){ shakeInit(); }, 3000);
-
+                if(dishIndex == 0){
+                    exportRoot.pot.hsr.play();
+                }else if(dishIndex == 1){
+                    exportRoot.pot.qcdf.play();
+                }else if(dishIndex == 2){
+                    exportRoot.bowl.oil.alpha = 0;
+                    exportRoot.plate['swy_icon1'].play();
+                }else{
+                    exportRoot.pot.ymc.play();
+                }
             });
         })
         exportRoot.blackboard.material2.addEventListener("mousedown", function() {
@@ -603,6 +619,16 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material2.y -=180;
                 // $(".shake-mode").show();
                 setTimeout(function(){ shakeInit(); }, 3000);
+                if(dishIndex == 0){
+                    exportRoot.pot.hsr.play();
+                }else if(dishIndex == 1){
+                    exportRoot.pot.qcdf.play();
+                }else if(dishIndex == 2){
+                    exportRoot.bowl.oil.alpha = 0;
+                    exportRoot.plate['swy_icon1'].play();
+                }else{
+                    exportRoot.pot.ymc.play();
+                }
             });
         })
         exportRoot.blackboard.material3.addEventListener("mousedown", function() {
@@ -627,6 +653,17 @@ function handleComplete(evt, comp) {
                 exportRoot.blackboard.material3.y -=180;
                 // $(".shake-mode").show();
                 setTimeout(function(){ shakeInit(); }, 3000);
+
+                if(dishIndex == 0){
+                    exportRoot.pot.hsr.play();
+                }else if(dishIndex == 1){
+                    exportRoot.pot.qcdf.play();
+                }else if(dishIndex == 2){
+                    exportRoot.bowl.oil.alpha = 0;
+                    exportRoot.plate['swy_icon1'].play();
+                }else{
+                    exportRoot.pot.ymc.play();
+                }
             });
         })
     }
@@ -645,7 +682,7 @@ function handleComplete(evt, comp) {
 
 
         bowlAnim(function() {
-            
+
             $(".move-mode2").show();
             if(dishIndex == 0){
                 dishMove(exportRoot.plate.hsr_icon1,0,0);
@@ -731,14 +768,14 @@ function handleComplete(evt, comp) {
                         	}
 
                             if(dishIndex == 0){
-                                exportRoot.pot.hsr.gotoAndStop(1);
+                                exportRoot.pot.hsr.gotoAndStop(3);
                             }else if(dishIndex == 1){
-                                exportRoot.pot.qcdf.gotoAndStop(1);
+                                exportRoot.pot.qcdf.gotoAndStop(3);
                             }else if(dishIndex == 2){
                                 exportRoot.bowl.oil.alpha = 0;
                                 exportRoot.plate['swy_icon1'].gotoAndStop(2);
                             }else{
-                                exportRoot.pot.ymc.gotoAndStop(1);
+                                exportRoot.pot.ymc.gotoAndStop(3);
                             }
                             $(".shake-mode").fadeOut();
                             // exportRoot.btn3.removeAllEventListeners();