Browse Source

Merge branch 'master' of http://47.100.37.243:10080/wutt/game.git

5 years ago
parent
commit
d145816860
49 changed files with 1108 additions and 367 deletions
  1. 382 72
      minigame/WebContent/assets.js
  2. 70 9
      minigame/WebContent/css/main.css
  3. 15 0
      minigame/WebContent/css/music.css
  4. BIN
      minigame/WebContent/images/assets_atlas_P_3.png
  5. BIN
      minigame/WebContent/images/assets_atlas_P_4.png
  6. BIN
      minigame/WebContent/images/assets_atlas_P_5.png
  7. BIN
      minigame/WebContent/images/share_picture.png
  8. BIN
      minigame/WebContent/img/cover.png
  9. BIN
      minigame/WebContent/img/edit.gif
  10. BIN
      minigame/WebContent/img/edit.png
  11. BIN
      minigame/WebContent/img/kspr.png
  12. BIN
      minigame/WebContent/img/loading/bg21.png
  13. BIN
      minigame/WebContent/img/play.png
  14. BIN
      minigame/WebContent/img/poster/hsr1.jpg
  15. BIN
      minigame/WebContent/img/poster/hsr_fen.png
  16. BIN
      minigame/WebContent/img/poster/hsr_hei.png
  17. BIN
      minigame/WebContent/img/poster/hsr_lv.png
  18. BIN
      minigame/WebContent/img/poster/qcdf_fen.png
  19. BIN
      minigame/WebContent/img/poster/qcdf_hei.png
  20. BIN
      minigame/WebContent/img/poster/qcdf_lv.png
  21. BIN
      minigame/WebContent/img/poster/swy_fen.png
  22. BIN
      minigame/WebContent/img/poster/swy_hei.png
  23. BIN
      minigame/WebContent/img/poster/swy_lv.png
  24. BIN
      minigame/WebContent/img/poster/ymc_fen.png
  25. BIN
      minigame/WebContent/img/poster/ymc_hei.png
  26. BIN
      minigame/WebContent/img/poster/ymc_lv.png
  27. BIN
      minigame/WebContent/img/powder.png
  28. BIN
      minigame/WebContent/img/share_btn.png
  29. BIN
      minigame/WebContent/img/wait_cut.png
  30. BIN
      minigame/WebContent/img/wait_move.png
  31. 180 110
      minigame/WebContent/index.html
  32. 267 76
      minigame/WebContent/js/main.js
  33. 34 0
      minigame/WebContent/js/music.js
  34. 3 3
      minigame/WebContent/js/poster.js
  35. 11 11
      minigame/WebContent/js/wechat.js
  36. 138 80
      minigame/WebContent/lottery.html
  37. 1 1
      minigame/WebContent/result_all.html
  38. BIN
      minigame/WebContent/sound/6滴只要6滴橄榄油.mp3
  39. BIN
      minigame/WebContent/sound/cut.mp3
  40. BIN
      minigame/WebContent/sound/oil.mp3
  41. BIN
      minigame/WebContent/sound/shake.mp3
  42. BIN
      minigame/WebContent/sound/soup.mp3
  43. BIN
      minigame/WebContent/sound/幸福的味道.mp3
  44. BIN
      minigame/WebContent/sound/橄榄油加醋又好吃又健康.mp3
  45. BIN
      minigame/WebContent/sound/火力燃烧.mp3
  46. BIN
      minigame/WebContent/sound/老健康了.mp3
  47. 1 1
      minigame/src/com/hssx/constant/Constant.java
  48. 5 3
      minigame/src/com/hssx/controller/PrizeController.java
  49. 1 1
      minigame/src/com/hssx/controller/UserController.java

File diff suppressed because it is too large
+ 382 - 72
minigame/WebContent/assets.js


+ 70 - 9
minigame/WebContent/css/main.css

@@ -292,7 +292,7 @@ input {
   overflow: hidden;
   -o-text-overflow: ellipsis;
      text-overflow: ellipsis;
-  white-space: nowrap; }
+  /*white-space: nowrap; */}
 
 * {
   margin: 0;
@@ -617,12 +617,37 @@ img {
             transform: translate(0, -50%); }
 
 .warp {
+  display:none;
   width: 10rem;
   margin: 0 auto;
   position: relative;
   height: 100vh;
   background: url(../img/loading/bg.jpg) no-repeat 0 0/cover; }
 
+.loading2 {
+  display:none;
+  position: fixed;
+  top: 0;
+  left: 50%;
+  width: 10rem;
+  height: 100vh;
+  margin-left: -5rem;
+  background: url(../img/loading/bg.jpg) no-repeat 0 0/cover;
+  z-index: 100;
+  /*display: none;*/ }
+  .loading2 .curtain-box2 {
+    position: absolute;
+    top: 50%;
+    left: 50%;
+    width: 10.42188rem;
+    height: 14.04688rem;
+    margin-left: -5.21094rem;
+    background: url(../img/loading/bg21.png) no-repeat 0 0/100% auto;
+    -webkit-transform: translate(0, -50%);
+       -moz-transform: translate(0, -50%);
+        -ms-transform: translate(0, -50%);
+         -o-transform: translate(0, -50%);
+            transform: translate(0, -50%); }
 .loading {
   position: fixed;
   top: 0;
@@ -635,12 +660,17 @@ img {
   /*display: none;*/ }
   .loading .curtain-box {
     position: absolute;
-    top: 0.89062rem;
+    top: 50%;
     left: 50%;
     width: 10.42188rem;
     height: 14.04688rem;
     margin-left: -5.21094rem;
-    background: url(../img/loading/bg2.png) no-repeat 0 0/100% auto; }
+    background: url(../img/loading/bg2.png) no-repeat 0 0/100% auto;
+    -webkit-transform: translate(0, -50%);
+       -moz-transform: translate(0, -50%);
+        -ms-transform: translate(0, -50%);
+         -o-transform: translate(0, -50%);
+            transform: translate(0, -50%); }
     .loading .curtain-box .txt {
       position: absolute;
       top: 5.3125rem;
@@ -688,13 +718,18 @@ img {
 
 .select-dish-box {
   position: absolute;
-  top: 1.17188rem;
+  top: 50%;
   left: 50%;
   width: 10rem;
   height: 15.53125rem;
   margin-left: -5rem;
   background: url(../img/menu_bg.png) no-repeat 0 0/100% auto;
-  padding-top: 2.34375rem; }
+  padding-top: 2.34375rem;
+  -webkit-transform: translate(0, -50%);
+     -moz-transform: translate(0, -50%);
+      -ms-transform: translate(0, -50%);
+       -o-transform: translate(0, -50%);
+          transform: translate(0, -50%); }
   .select-dish-box .tt {
     width: 3.85938rem;
     margin: 0 auto;
@@ -766,7 +801,7 @@ img {
       .poster-mode .leads-box .form-group input , .poster-mode .leads-box .form-group .msg{
         width: 100%;
         height: 0.78125rem;
-		line-height: 0.78125rem;
+        line-height: 0.78125rem;
         font-size: 0.375rem;
         font-size: 20x;
         color: #c19e83;
@@ -811,12 +846,20 @@ img {
   .poster-mode .qrcode-box {
     position: absolute;
     bottom: 1.92188rem;
-    right: 0.46875rem;
+    /*right: 0.46875rem;*/
+    right: 0.16875rem;
     width: 1.40625rem; }
     .poster-mode .qrcode-box p {
-      font-size: 0.21875rem;
+      /*font-size: 0.21875rem;*/
+        font-size: 0.31875rem;
       color: #fff;
-      text-align: center; }
+      text-align: center;
+        overflow: hidden;
+        text-overflow: ellipsis;
+        display: -webkit-box;
+        -webkit-line-clamp: 2;
+        -webkit-box-orient: vertical;
+    }
   .poster-mode .replay-btn {
     position: absolute;
     bottom: 0.70312rem;
@@ -828,6 +871,24 @@ img {
     right: 1.48438rem;
     width: 2.8125rem; }
 
+.cut-mode2 {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100vh;
+  z-index: 100;
+  display: none; }
+
+.move-mode2 {
+  position: fixed;
+  top: 0;
+  left: 0;
+  width: 100%;
+  height: 100vh;
+  z-index: 100;
+  display: none; }
+
 .shake-mode2 {
   position: fixed;
   top: 0;

+ 15 - 0
minigame/WebContent/css/music.css

@@ -0,0 +1,15 @@
+/* music */
+@-webkit-keyframes reverseRotataZ{
+    0%{-webkit-transform: rotateZ(0deg);}
+    100%{-webkit-transform: rotateZ(-360deg);}
+}
+@-webkit-keyframes rotataZ{
+    0%{-webkit-transform: rotateZ(0deg);}
+    100%{-webkit-transform: rotateZ(360deg);}
+}
+#musicControl { position:fixed;right:10px;top:20px;margin-top:0;display:inline-block;z-index:99999999}
+#musicControl a { display:inline-block;width:25px;height:25px;overflow:hidden;background:url('../img/play.png') no-repeat;background-size:100%;}
+#musicControl a audio{width:100%;height:56px;}
+#musicControl a.stop { background-position:left bottom;}
+#musicControl a.on { background-position:0px 1px;-webkit-animation: reverseRotataZ 1.2s linear infinite;}
+#music_play_filter{width:100%;height:100%;overflow:hidden;position:fixed;top:0;left:0;z-index:99999998;}

BIN
minigame/WebContent/images/assets_atlas_P_3.png


BIN
minigame/WebContent/images/assets_atlas_P_4.png


BIN
minigame/WebContent/images/assets_atlas_P_5.png


BIN
minigame/WebContent/images/share_picture.png


BIN
minigame/WebContent/img/cover.png


BIN
minigame/WebContent/img/edit.gif


BIN
minigame/WebContent/img/edit.png


BIN
minigame/WebContent/img/kspr.png


BIN
minigame/WebContent/img/loading/bg21.png


BIN
minigame/WebContent/img/play.png


BIN
minigame/WebContent/img/poster/hsr1.jpg


BIN
minigame/WebContent/img/poster/hsr_fen.png


BIN
minigame/WebContent/img/poster/hsr_hei.png


BIN
minigame/WebContent/img/poster/hsr_lv.png


BIN
minigame/WebContent/img/poster/qcdf_fen.png


BIN
minigame/WebContent/img/poster/qcdf_hei.png


BIN
minigame/WebContent/img/poster/qcdf_lv.png


BIN
minigame/WebContent/img/poster/swy_fen.png


BIN
minigame/WebContent/img/poster/swy_hei.png


BIN
minigame/WebContent/img/poster/swy_lv.png


BIN
minigame/WebContent/img/poster/ymc_fen.png


BIN
minigame/WebContent/img/poster/ymc_hei.png


BIN
minigame/WebContent/img/poster/ymc_lv.png


BIN
minigame/WebContent/img/powder.png


BIN
minigame/WebContent/img/share_btn.png


BIN
minigame/WebContent/img/wait_cut.png


BIN
minigame/WebContent/img/wait_move.png


+ 180 - 110
minigame/WebContent/index.html

@@ -1,6 +1,6 @@
 <!DOCTYPE html>
 <html>
-  <head>
+<head>
     <meta charset="utf-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=0,minimum-scale=1.0,maximum-scale=1.0,minimal-ui">
@@ -14,144 +14,214 @@
     <meta name="format-detection" content="email=no" />
     <title>贝蒂斯厨房</title>
     <script src="./js/flexiable.js"></script>
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
     <link rel="stylesheet" type="text/css" href="./css/animate.min.css?v=1">
-    <link rel="stylesheet" type="text/css" href="./css/main.css?v=1">
+    <link rel="stylesheet" type="text/css" href="./css/music.css?v=2">
+    <link rel="stylesheet" type="text/css" href="./css/main.css?v=2">
     <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 = false;
+        if (location.href.startsWith('http://')) {
+            location.href = location.href.replace('http','https');
+        }
+    </script>
 </head>
 <body onload="getInfo()">
-    <!-- loading -->
-    <div class="loading">
-        <div class="curtain-box">
-            <div class="txt rubberBand time6 iteration">
-                <img src="./img/loading/loading_txt.png">
-            </div>
-            <div class="loading-bar">
-                <p class="load-txt">远方快递正在为您准备美食<span id="loadingTxt">80</span>%</p>
-                <div class="bar">
+<!-- loading -->
+<div class="loading">
+    <div class="curtain-box">
+        <div class="txt rubberBand time6 iteration">
+            <img src="./img/loading/loading_txt.png">
+        </div>
+        <div class="loading-bar">
+            <p class="load-txt">远方快递正在为您准备美食<span id="loadingTxt">0</span>%</p>
+            <div class="bar">
                     <span id="loadingBar">
                         <i class="icon-load"></i>
                     </span>
-                </div>
             </div>
         </div>
     </div>
-    <!-- 主内容 -->
-    <div class="warp">
-        <!-- 选择菜 -->
-        <div class="select-dish-box">
-            <img src="./img/menu_tt.png" class="tt fadeIn time4 animated js-an">
-            <div class="list">
-                <div class="item bounceIn time3 animated js-an delay3">
-                    <img src="./img/menu1.png">
-                </div>
-                <div class="item bounceIn time3 animated js-an delay4">
-                    <img src="./img/menu2.png">
-                </div>
-                <div class="item bounceIn time3 animated js-an delay5">
-                    <img src="./img/menu3.png">
-                </div>
-                <div class="item bounceIn time3 animated js-an delay6">
-                    <img src="./img/menu4.png">
-                </div>
+</div>
+    <div class="loading2">
+        <div class="curtain-box2">
+            <div class="txt rubberBand time6">
             </div>
-            <div class="confirm anim-btn"></div>
-        </div>
-        <!-- 游戏 -->
-        <div class="game-box">
-            <canvas id="canvas" width="640" height="1040"></canvas>
         </div>
     </div>
-    <!-- 海报 -->
-    <div class="poster-mode">
-        <img src="./img/logo.png" class="logo">
-        <img src="./img/poster/hsr.png" class="poster-img" id="poster">
-        <div class="leads-box">
-            <img src="./img/poster/headOil.png" class="pro">
-            <div class="form-group">
-                <input id="nameInput" type="text" placeholder="我想把这道菜送给TA">
-				<div id="nameText" class='msg' style='display:none;'></div>
+<!-- 主内容 -->
+<div class="warp">
+    <!-- 选择菜 -->
+    <div class="select-dish-box">
+        <img src="./img/menu_tt.png" class="tt fadeIn time4 animated js-an">
+        <div class="list">
+            <div class="item bounceIn time3 animated js-an delay3">
+                <img src="./img/menu1.png">
             </div>
-            <div class="form-group">
-                <input id="textInput" type="text" placeholder="我想对TA说">
-				<div id="text" class='msg' style='display:none;'></div>
+            <div class="item bounceIn time3 animated js-an delay4">
+                <img src="./img/menu2.png">
             </div>
-            <div class="user-info">
-                <div class="headimg-box">
-                    <img src="./img/headimg.png">
-                </div>
-                <p>微信昵称</p>
+            <div class="item bounceIn time3 animated js-an delay5">
+                <img src="./img/menu3.png">
+            </div>
+            <div class="item bounceIn time3 animated js-an delay6">
+                <img src="./img/menu4.png">
             </div>
-            <!-- <div class="submit" onclick='saveText()'> -->
-                <!-- <img src="./img/share_btn.png"> -->
-            <!-- </div> -->
         </div>
-        <div class="qrcode-box">
-            <!-- <img src="./img/poster/qrcode.jpg"> -->
-            <img src="./img/poster/ewm.png">
-            <p>扫码为他做菜</p>
+        <div class="confirm anim-btn"></div>
+    </div>
+    <!-- 游戏 -->
+    <div class="game-box">
+        <canvas id="canvas" width="640" height="1040"></canvas>
+    </div>
+</div>
+<!-- 海报 -->
+<div class="poster-mode">
+    <img src="./img/logo.png" class="logo">
+    <img src="./img/poster/hsr.png" class="poster-img" id="poster">
+    <div class="leads-box">
+        <img src="./img/poster/headOil.png" class="pro">
+        <div class="form-group" style="position:relative;">
+            <img id='edit' src="./img/edit.gif" style='height: 0.35rem;position: absolute;left: -13px;top: 8px;display: none;'>
+            <input id="nameInput" type="text" placeholder="我想把这道菜送给TA">
+            <div id="nameText" class='msg' style='display:none;'></div>
         </div>
-        <div class="replay-btn">
-            <img src="./img/replay_btn.png">
+        <div class="form-group">
+            <input id="textInput" type="text" placeholder="我想对TA说">
+            <div id="text" class='msg' style='display:none;'></div>
         </div>
-        <!-- <div class="secret-btn"> -->
-            <!-- <img src="./img/secret_btn.png"> -->
-        <!-- </div> -->
-        <div class="secret-btn" onclick='saveText()'>
-            <img src="./img/share_btn.png">
+        <div class="user-info">
+            <div class="headimg-box">
+                <img src="./img/headimg.png">
+            </div>
+            <p>微信昵称</p>
         </div>
     </div>
+    <div class="qrcode-box">
+        <img src="./img/poster/ewm.png">
+        <p>扫码为他做菜</p>
+    </div>
+    <div class="replay-btn">
+        <img src="./img/replay_btn.png">
+    </div>
+    <div class="secret-btn" onclick='saveText()'>
+        <img src="./img/share_btn.png">
+    </div>
+</div>
 
-	<img id="cover" style="width: 100%;height: 103%;position: absolute;top: 0;left: 0;z-index: 99999;display: none" src="./img/cover.png" onclick="hiddenCover()">
+<div id="cover"  style="width: 100%;height: 100%;position: absolute;top: 0;left: 0;z-index: 99999;display: none;background: rgba(0,0,0,0.8)" onclick="hiddenCover()">
+    <img style="width: 100%" src="./img/cover.png">
+</div>
 
-    <div class="secret-box">
-        <img src="./img/poster/secret1.png" id="secret">
-    </div>
 
-    <!-- 摇一摇提示 -->
-    <div class="shake-mode2">
-        <img src="./img/wait_shake.png">
-    </div>
+<div class="secret-box">
+    <img src="./img/poster/secret1.png" id="secret">
+</div>
 
-    <div class="shake-mode">
-        <div class="shake-dialog">
-            <!-- <img src="./img/shake_fire.png"> -->
-            <div class="fire anim-fire js-an" id="fire"></div>
-            <img src="./img/shake_icon.png" class="icon">
-            <img src="./img/shake_txt.png" class="txt">
-        </div>
-    </div>
-    <script src="./js/jquery.min.js"></script>
-    <script src="./js/create.js"></script>
-    <script src="./js/tweenmax.js"></script>
-    <script src="./js/wechat.js"></script>
-    <script src="./assets.js"></script>
-    <script src="./js/main.js"></script>
-    <script src="http://res.wx.qq.com/connect/zh_CN/htmledition/js/wxLogin.js"></script>
-    <script>
-        // 判断微信分享
-        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
-            // 发送给好友
-            WeixinJSBridge.on('menu:share:appmessage', function(argv){
-                // alert('发送给好友')
-                setTimeout(function(){
-                    window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
-                }, 6000);
+<span id="musicControl">
+        <a id="mc_play" class="on" onclick="play_music();">
+            <audio id="music" loop="loop" autoplay="autoplay">
+                <source src="sound/background_music.mp3" type="audio/mpeg">
+            </audio>
+        </a>
+    </span>
+
+<!-- 切菜提示 -->
+<div class="cut-mode2">
+    <img src="./img/wait_cut.png">
+</div>
 
-            });
-            // 分享到朋友圈
-            WeixinJSBridge.on('menu:share:timeline', function(argv){
-                // alert('分享到朋友圈')
-                setTimeout(function(){
-                    window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
-                }, 6000);
+<!-- 移菜提示 -->
+<div class="move-mode2">
+    <img src="./img/wait_move.png">
+</div>
 
-            });
-        }, false);
+<!-- 摇一摇提示 -->
+<div class="shake-mode2">
+    <img src="./img/wait_shake.png">
+</div>
+
+<div class="shake-mode">
+    <div class="shake-dialog">
+        <!-- <img src="./img/shake_fire.png"> -->
+        <div class="fire anim-fire js-an" id="fire"></div>
+        <img src="./img/shake_icon.png" class="icon">
+        <img src="./img/shake_txt.png" class="txt">
+    </div>
+</div>
 
-        // 判断微博分享
-        document.addEventListener('WeiboJSBridgeReady', function onBridgeReady() {
+<script src="./js/jquery.min.js"></script>
+<script src="./js/create.js"></script>
+<script src="./js/tweenmax.js"></script>
+<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=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>
+	//解决IOS下分享签名失败问题
+	if (navigator.userAgent.indexOf('iPhone') !== -1) {
+	  window.wechaturl = window.location + '';
+	}
+    //一般情况下,这样就可以自动播放了,但是一些奇葩iPhone机不可以
+    var music = document.getElementById('music').play();
+    music.volume = 0.1;
+    //必须在微信Weixin JSAPI的WeixinJSBridgeReady才能生效
+    document.addEventListener("WeixinJSBridgeReady", function () {
+        var music = document.getElementById('music').play();
+        music.volume = 0.1;
+    }, false);
 
-        }, false);
+        function shareWeixin(msg) {
+        	let wechaturl = window.location.href.split('#')[0];
+        	var shareUrl = wechaturl;
+        	if (window.wechaturl !== undefined) {
+        	 	wechaturl = window.wechaturl;
+        	}
+        	var url = escape(wechaturl);
+        	$.post("./user/getWxConfigParam?url="+url, {}, 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(){
+                        $("#cover").show();
+                        const share = {
+           			        title: "我为你精心准备的美味,快享用吧!",
+           			        desc: msg,
+           			        imgUrl: "https://wx.ttkuaiban.com/minigame/images/share_picture.png",
+           			        link: shareUrl,
+           			        success: function() {
+//            			            alert("分享成功")
+           			        	window.location.href = "https://wx.ttkuaiban.com/minigame/lottery.html";
+           			        },
+           			        cancel: function() {
+//                                 alert("分享失败")
+           			        }
+           			    };
+        			    wx.onMenuShareAppMessage(share);
+        			    wx.onMenuShareTimeline(share);
+        			    wx.onMenuShareQQ(share);
+        			    wx.onMenuShareQZone(share);
+        			    wx.onMenuShareWeibo(share);
+        			});
+        			wx.error(function(res){
+                        alert("分享失败")
+        				console.log(res);
+        			});
+        		};
+        	});
+        }
     </script>
 </body>
 </html>

+ 267 - 76
minigame/WebContent/js/main.js

@@ -14,6 +14,27 @@ createjs.Sound.registerSound("sound/start/swy.mp3", "swy");
 createjs.Sound.registerSound("sound/start/qcdf.mp3", "qcdf");
 createjs.Sound.registerSound("sound/background_music.mp3", "bgm");
 
+createjs.Sound.registerSound("sound/cut.mp3", "cut");//切菜
+createjs.Sound.registerSound("sound/oil.mp3", "oil");//空锅倒油(肉、油麦菜)
+createjs.Sound.registerSound("sound/soup.mp3", "soup");//煮
+createjs.Sound.registerSound("sound/shake.mp3", "shake");//摇
+
+// 大屏适配
+var hFont = $('html').css('font-size');
+var h = $(window).height();
+hFont = hFont.slice(0,-2);
+// 屏幕超过1245。显示大屏配置
+if(h/hFont > 16.6){
+    $("body").addClass("big-page");
+}else if(h/hFont < 15.2){
+    $("body").addClass("small-page");
+    $(".game-box").css("top",'-35px')
+}
+
+
+
+
+
 window.user_info = {
     uid: 0,
     logo:'http://img5q.duitang.com/uploads/item/201502/25/20150225060808_wuANL.jpeg',//用户头像
@@ -30,7 +51,8 @@ for (i=0; i < params.length ; i++){
     URLParams[aParam[0]] = aParam[1];
 }
 function init() {
-    createjs.Sound.play("bgm", {loop: -1});
+    //createjs.Sound.play("bgm", {loop: -1});
+    just_play();
     var comp = AdobeAn.getComposition("5529E26743974F469545223C44E61D22");
     var lib = comp.getLibrary();
     var loader = new createjs.LoadQueue(false);
@@ -67,7 +89,14 @@ function handleComplete(evt, comp) {
     }
     var exportRoot = new lib.assets();
     $(".loading").fadeOut(function(){
-        $(".select-dish-box").find(".animated").removeClass("js-an");
+        // $(".select-dish-box").find(".animated").removeClass("js-an");
+        $(".loading2").show();
+        $(".loading2").on("touchend",function(){
+            $(".loading2").fadeOut(function(){
+                $(".warp").show();
+                $(".select-dish-box").find(".animated").removeClass("js-an");
+            });
+        });
     });
 
 
@@ -84,6 +113,15 @@ function handleComplete(evt, comp) {
         dishIndex = $(".select-dish-box .item.active").index();
         $(".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();
+        })
 
         // 判断是哪个菜
         if(dishIndex == 0){
@@ -117,8 +155,7 @@ function handleComplete(evt, comp) {
     })
     $(".replay-btn").on("click",function(){
         URLParams = new Array();
-        window.location.href = "http://wx.ttkuaiban.com/minigame/";
-        //location.reload()
+        window.location.href = "https://wx.ttkuaiban.com/minigame/";
     })
     //$(".secret-btn").on("click",function(){
     //saveText();
@@ -130,22 +167,40 @@ function handleComplete(evt, comp) {
 
 
     function ballAnim(dom) {
+        var video = "";
+        if(dishIndex == 0){
+            video = createjs.Sound.play("soup");//播放
+        }else if(dishIndex == 1){
+            video = createjs.Sound.play("soup");//播放
+        }else if(dishIndex == 3){
+            video = createjs.Sound.play("soup");//播放
+        }
+        video.volume = 1;
+        setTimeout(function(){
+            video.paused = true;
+        }, 3500);
         var anim = new TimelineMax({ repeat: -1 });
         anim.to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "-=30", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
-        .to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn });
+            .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
+            .to(dom, 0.3, { rotation: "-=30", ease: Power0.easeIn })
+            .to(dom, 0.3, { rotation: "+=30", ease: Power0.easeIn })
+            .to(dom, 0.15, { rotation: "-=15", ease: Power0.easeIn });
         return anim;
     }
 
     function materialAnim(dom, x, y, callback) {
         var anim = new TimelineMax({ onComplete: callback });
-        anim.to(dom, 0.5, { x: "+=" + x, y: "+=" + y, ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
-        .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn });
+        anim.to(dom, 0.5, { x: "+=" + x, y: "+=" + y,scale:1.1, ease: Power0.easeIn })
+            .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
+            .to(exportRoot.powder, 0.1, { alpha: 1, ease: Power0.easeIn },"-=0.1")
+            .to(exportRoot.powder, 0.3, { x: "-=15",y:"+=55",alpha:0, ease: Power0.easeIn },'-=0.2')
+            .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
+            .to(exportRoot.powder, 0.01, { x: "+=15",y:"-=55",alpha:0, ease: Power0.easeIn })
+            .to(dom, 0.3, { rotation: "-=25", ease: Power0.easeIn })
+            .to(exportRoot.powder, 0.1, { alpha: 1, ease: Power0.easeIn },"-=0.1")
+            .to(exportRoot.powder, 0.3, { x: "-=15",y:"+=55",alpha:0, ease: Power0.easeIn },'-=0.2')
+            .to(dom, 0.3, { rotation: "+=25", ease: Power0.easeIn })
+            .to(exportRoot.powder, 0.1, { alpha:0, ease: Power0.easeIn });
         return anim;
     }
 
@@ -157,38 +212,55 @@ function handleComplete(evt, comp) {
         }
         var anim = new TimelineMax({ delay:0.8});
         anim.to(dom, 0.4, { alpha: 1, ease: Power0.easeIn })
-        .to(dom, 1, { scale: 1, ease: Power0.easeIn })
+            .to(dom, 1, { scale: 1, ease: Power0.easeIn })
         return anim;
     }
     function bowlAnim(callback) {
         var anim = new TimelineMax({ onComplete: callback, delay: 0.3 });
         anim.to(exportRoot.plate, 0.5, { y: "-=370", ease: Power0.easeIn })
-        .to(exportRoot.bowl, 0.5, { alpha: 1, ease: Power0.easeIn });
+            .to(exportRoot.bowl, 0.5, { alpha: 1, ease: Power0.easeIn });
         return anim;
     }
 
     function proAnim(callback) {
         var anim = new TimelineMax({ onComplete: callback, delay: 0.5 });
         anim.to(exportRoot.pro.proImg, 0.5, { rotation: "-=25", ease: Power0.easeIn })
-        .to(exportRoot.pro.oil_icon1, 0.3, {alpha:1})
-        .to(exportRoot.pro.oil_icon2, 0.2, {alpha:1})
-        .to(exportRoot.pro.proImg, 1, {})
-        .to(exportRoot.pro, 0.3, { alpha: 0, ease: Power0.easeIn })
-        .to(exportRoot.pro, 1, {})
+            .to(exportRoot.pro.oil_icon1, 0.3, {alpha:1})
+            .to(exportRoot.pro.oil_icon2, 0.2, {alpha:1})
+            .to(exportRoot.pro.proImg, 1, {})
+            .to(exportRoot.pro, 0.3, { alpha: 0, ease: Power0.easeIn })
+            .to(exportRoot.pro, 1, {})
         return anim;
     }
     function oilIconAnim() {
         oilAnim();
-
+        var video = "" , noice = "" , soup = "";
         if(dishIndex == 0){
-            createjs.Sound.play("hsr");//播放
+            noice = createjs.Sound.play("hsr");//播放
+            setTimeout(function(){
+                video = createjs.Sound.play("oil");//播放
+            }, 1000);
         }else if(dishIndex == 1){
-            createjs.Sound.play("qcdf");//播放
+            noice = createjs.Sound.play("qcdf");//播放
+            setTimeout(function(){
+                video = createjs.Sound.play("oil");//播放
+            }, 2000);
         }else if(dishIndex == 2){
-            createjs.Sound.play("swy");//播放
+            noice = createjs.Sound.play("swy");//播放
         }else{
-            createjs.Sound.play("ymc");//播放
+            noice = createjs.Sound.play("ymc");//播放
+            setTimeout(function(){
+                video = createjs.Sound.play("oil");//播放
+            }, 3000);
         }
+        noice.volume = 1;
+        video.volume = 0.2;
+        //soup.volume = 0.8;
+        setTimeout(function(){
+            video.paused = true;
+            //soup.paused = true;
+        }, 6000);
+
         var anim = new TimelineMax({ repeat:10,delay:1});
         anim.to(exportRoot.pro.oil_icon2, 0.3, {y:"+=100",alpha:0})
         return anim;
@@ -197,7 +269,7 @@ function handleComplete(evt, comp) {
     function btnAnim(dom){
         var anim = new TimelineMax({ repeat:-1 });
         anim.to(dom, 0.3, { scale: "+=0.1", ease: Power0.easeIn })
-        .to(dom, 0.3, { scale: "-=0.1", ease: Power0.easeIn })
+            .to(dom, 0.3, { scale: "-=0.1", ease: Power0.easeIn })
         return anim;
     }
     function fadeInAnim(dom){
@@ -218,6 +290,15 @@ function handleComplete(evt, comp) {
             .to(exportRoot.btn2, 0.4, { alpha: 1, ease: Power0.easeIn })
         return anim;
     }
+    function menuIconInAnim2(dom,callback){
+        var anim = new TimelineMax({onComplete:callback });
+        anim.to(dom.icon1, 0.3, { alpha: 1, ease: Power0.easeIn })
+            .to(dom.icon2, 0.3, { alpha: 1, ease: Power0.easeIn })
+            .to(dom.icon3, 0.3, { alpha: 1, ease: Power0.easeIn })
+            .to(dom.icon4, 0.3, { alpha: 1, ease: Power0.easeIn })
+            .to(dom.icon5, 0.3, { alpha: 1, ease: Power0.easeIn })
+        return anim;
+    }
 
     function materialEnterAnim(dom,delay){
         dom.scale = 0.1;
@@ -271,12 +352,12 @@ function handleComplete(evt, comp) {
     ]
     // 红烧肉的位置
     var hsr_iconArr = [{
-            x: exportRoot.plate.x + exportRoot.plate.hsr_icon1.x,
-            y: exportRoot.plate.y + exportRoot.plate.hsr_icon1.y,
-            width: 202,
-            height: 129,
-            isClear: false
-        },
+        x: exportRoot.plate.x + exportRoot.plate.hsr_icon1.x,
+        y: exportRoot.plate.y + exportRoot.plate.hsr_icon1.y,
+        width: 202,
+        height: 129,
+        isClear: false
+    },
         {
             x: exportRoot.plate.x + exportRoot.plate.hsr_icon2.x,
             y: exportRoot.plate.y + exportRoot.plate.hsr_icon2.y,
@@ -301,12 +382,12 @@ function handleComplete(evt, comp) {
     ];
     // 青菜豆腐的位置
     var qcdf_iconArr = [{
-            x: exportRoot.plate.x + exportRoot.plate.qcdf_icon1.x,
-            y: exportRoot.plate.y + exportRoot.plate.qcdf_icon1.y,
-            width: 169,
-            height: 320,
-            isClear: false
-        },
+        x: exportRoot.plate.x + exportRoot.plate.qcdf_icon1.x,
+        y: exportRoot.plate.y + exportRoot.plate.qcdf_icon1.y,
+        width: 169,
+        height: 320,
+        isClear: false
+    },
         {
             x: exportRoot.plate.x + exportRoot.plate.qcdf_icon2.x,
             y: exportRoot.plate.y + exportRoot.plate.qcdf_icon2.y,
@@ -387,6 +468,7 @@ function handleComplete(evt, comp) {
             y: event.stageY,
         };
         lineArr.push(obj);
+        createjs.Sound.play("cut");//播放
     })
     exportRoot.addEventListener("pressmove", function(event) {
         if (lineArr.length >= 15) {
@@ -476,17 +558,22 @@ function handleComplete(evt, comp) {
                 exportRoot.plate.swy_icon2.alpha = 0;
             }
 
+
+
             oilIconAnim();
             proAnim(function() {
                 btnAnim(exportRoot.btn2);
                 if(dishIndex == 0){
                     menuIconInAnim(exportRoot.pot.hsr);
-                }else if(dishIndex == 1){
-                    menuIconInAnim(exportRoot.pot.qcdf);
                 }else if(dishIndex == 3){
                     menuIconInAnim(exportRoot.pot.ymc);
+                }else if(dishIndex == 1){
+                    menuIconInAnim(exportRoot.pot.qcdf);
+                }else{
+                    exportRoot.btn2.alpha = 1;
                 }
             });
+
         })
         exportRoot.btn2.addEventListener("mousedown", function() {
             exportRoot.btn2.removeAllEventListeners();
@@ -495,45 +582,120 @@ function handleComplete(evt, comp) {
             materialEnterAnim(exportRoot.blackboard.material1,0.2);
             materialEnterAnim(exportRoot.blackboard.material2,0.4);
             materialEnterAnim(exportRoot.blackboard.material3,0.6);
-            exportRoot.ball1.alpha = 1;
 
             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() {
             exportRoot.blackboard.material1.removeAllEventListeners();
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
+            chooseType = 3;
             $(".poster-mode").addClass("poster-bg3");
+            exportRoot.ball1.alpha = 1;
+            if(dishIndex == 0){
+                $('#poster').attr('src','./img/poster/hsr_lv.png');
+            }else if(dishIndex == 1){
+                $('#poster').attr('src','./img/poster/qcdf_lv.png');
+            }else if(dishIndex == 2){
+                $('#poster').attr('src','./img/poster/swy_lv.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_lv.png');
+            }
             materialAnim(exportRoot.blackboard.material1, 300, 180, function() {
                 exportRoot.blackboard.material1.x -=300;
                 exportRoot.blackboard.material1.y -=180;
+                exportRoot.blackboard.material1.scale = 1;
                 // $(".shake-mode").show();
-                shakeInit();
+                setTimeout(function(){ shakeInit(); }, 2000);
+                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() {
             exportRoot.blackboard.material1.removeAllEventListeners();
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
+            chooseType = 2;
             $(".poster-mode").addClass("poster-bg2");
+            exportRoot.ball1.gotoAndStop(1);
+            exportRoot.ball1.alpha = 1;
+            if(dishIndex == 0){
+                $('#poster').attr('src','./img/poster/hsr_hei.png');
+            }else if(dishIndex == 1){
+                $('#poster').attr('src','./img/poster/qcdf_hei.png');
+            }else if(dishIndex == 2){
+                $('#poster').attr('src','./img/poster/swy_hei.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_hei.png');
+            }
             materialAnim(exportRoot.blackboard.material2, 120, 180, function() {
                 exportRoot.blackboard.material2.x -=120;
                 exportRoot.blackboard.material2.y -=180;
+                exportRoot.blackboard.material2.scale = 1;
                 // $(".shake-mode").show();
-                shakeInit();
+                setTimeout(function(){ shakeInit(); }, 2000);
+                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() {
             exportRoot.blackboard.material1.removeAllEventListeners();
             exportRoot.blackboard.material2.removeAllEventListeners();
             exportRoot.blackboard.material3.removeAllEventListeners();
+            chooseType = 1;
             $(".poster-mode").addClass("poster-bg1");
+            exportRoot.ball1.gotoAndStop(2);
+            exportRoot.ball1.alpha = 1;
+            if(dishIndex == 0){
+                $('#poster').attr('src','./img/poster/hsr_fen.png');
+            }else if(dishIndex == 1){
+                $('#poster').attr('src','./img/poster/qcdf_fen.png');
+            }else if(dishIndex == 2){
+                $('#poster').attr('src','./img/poster/swy_fen.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_fen.png');
+            }
             materialAnim(exportRoot.blackboard.material3, -30, 180, function() {
                 exportRoot.blackboard.material3.x +=30;
                 exportRoot.blackboard.material3.y -=180;
+                exportRoot.blackboard.material3.scale = 1;
                 // $(".shake-mode").show();
-                shakeInit();
+                setTimeout(function(){ shakeInit(); }, 2000);
+
+                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();
+                }
             });
         })
     }
@@ -545,12 +707,16 @@ function handleComplete(evt, comp) {
                 return false;
             }
         }
+
         stage.removeChild(lineShape);
         clearInterval(lineTimr);
         exportRoot.removeAllEventListeners();
 
 
         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);
@@ -594,6 +760,7 @@ function handleComplete(evt, comp) {
         var x, y, z, last_x = 0,
             last_y = 0,
             last_z = 0;
+        var createTime = false;
 
         function deviceMotionHandler(eventData) {
             var acceleration = eventData.accelerationIncludingGravity;
@@ -606,7 +773,13 @@ function handleComplete(evt, comp) {
                 z = acceleration.z;
                 var speed = Math.abs(x + y + z - last_x - last_y - last_z) / diffTime * 10000;
                 if (speed > SHAKE_THRESHOLD) {
+                    if(!createTime) {
+                        createTime = true;
+                        var video = createjs.Sound.play("shake");//播放
+                        setTimeout(function(){ video.paused = true;createTime = false; }, 2500);
+                    }
                     $(".shake-mode2").hide();
+                    $(".shake-mode").show();
                     shake_cnt++;
                     if(shake_cnt>2){
                         setTimeout(function(){
@@ -623,23 +796,22 @@ function handleComplete(evt, comp) {
                             if(document.location.href.indexOf('type') == -1){
                                 var href = document.location.href + (document.location.href.indexOf('?') > -1?'&':'?') + "type=" + chooseType + "&food=" + dishIndex;
                                 history.pushState("", "Title", href);
-                        	}
+                            }
 
                             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();
+                            // exportRoot.btn3.removeAllEventListeners();
                             $(".poster-mode").fadeIn();
                         },3000)
-
                     }
                     //dosomething
                     $("#fire").addClass("anim-time");
@@ -652,18 +824,11 @@ function handleComplete(evt, comp) {
 
                 // 开始火的动画
                 $("#fire").removeClass("js-an");
-                $(".shake-dialog .icon").hide();
-                $(".shake-dialog .txt").hide();
             }
         }
 
     }
 
-
-
-
-
-
     //Registers the "tick" event listener.
     function fnStartAnimation() {
         stage.addChild(exportRoot, lineShape);
@@ -676,12 +841,14 @@ function handleComplete(evt, comp) {
 
 function getInfo() {
     var ua = navigator.userAgent.toLowerCase();
+    var isMobile = false;
     if (!!navigator.userAgent.match(/AppleWebKit.*Mobile.*/)) {
+        isMobile = true;
         if (ua.match(/MicroMessenger/i) == "micromessenger") {
             type = 0;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                 +"appid=wx749c84daac654e1e&"
-                +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
+                +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
                 +"response_type=code&"
                 +"scope=snsapi_userinfo&"//snsapi_userinfo
                 +"state=1#wechat_redirect";
@@ -692,7 +859,7 @@ function getInfo() {
             url = "https://api.weibo.com/oauth2/authorize?"
                 +"client_id=2141531565&"
                 +"response_type=code&"
-                +"redirect_uri=http://wx.ttkuaiban.com/minigame/index.html"
+                +"redirect_uri=https://wx.ttkuaiban.com/minigame/index.html"
         }
     } else {
         var ua = navigator.userAgent.toLowerCase();
@@ -700,14 +867,16 @@ function getInfo() {
             type = 0;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                 +"appid=wx749c84daac654e1e&"
-                +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
+                +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
                 +"response_type=code&"
                 +"scope=snsapi_userinfo&"//snsapi_userinfo
                 +"state=1#wechat_redirect";
         }
+
     }
 
     if(URLParams['uid']) {
+        $('#edit').hide();
         $('#nameInput').hide();
         $('#nameText').show();
         $('#textInput').hide();
@@ -719,18 +888,41 @@ function getInfo() {
         chooseType = URLParams['type'];
         dishType = URLParams['food'];
         $(".poster-mode").addClass("poster-bg" + chooseType);
-        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');
+        if(chooseType == 3) {
+            if(dishType == 0){
+                $('#poster').attr('src','./img/poster/hsr_lv.png');
+            }else if(dishType == 1){
+                $('#poster').attr('src','./img/poster/qcdf_lv.png');
+            }else if(dishType == 2){
+                $('#poster').attr('src','./img/poster/swy_lv.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_lv.png');
+            }
+        } else if(chooseType == 2) {
+            if(dishType == 0){
+                $('#poster').attr('src','./img/poster/hsr_hei.png');
+            }else if(dishType == 1){
+                $('#poster').attr('src','./img/poster/qcdf_hei.png');
+            }else if(dishType == 2){
+                $('#poster').attr('src','./img/poster/swy_hei.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_hei.png');
+            }
+        } else if(chooseType == 1) {
+            if(dishType == 0){
+                $('#poster').attr('src','./img/poster/hsr_fen.png');
+            }else if(dishType == 1){
+                $('#poster').attr('src','./img/poster/qcdf_fen.png');
+            }else if(dishType == 2){
+                $('#poster').attr('src','./img/poster/swy_fen.png');
+            }else{
+                $('#poster').attr('src','./img/poster/ymc_fen.png');
+            }
         }
         getMsg();
         $(".poster-mode").fadeIn();
     } else {
+        $('#edit').show();
         $('#nameInput').show();
         $('#nameText').hide();
         $('#textInput').show();
@@ -740,7 +932,10 @@ function getInfo() {
         $('.secret-btn').show();
 
         init();
-        getMsg();
+        if (isMobile && !window.ifDebug) {
+            getMsg();
+        }
+
     }
 
 }
@@ -868,12 +1063,8 @@ function saveText() {
                     history.pushState("", "Title", href);
                 }
 
-                $("#cover").show();
-                //if(type == 1) {
-                setTimeout(function(){
-                    window.location.href = "http://wx.ttkuaiban.com/minigame/lottery.html";
-                }, 10000);
-                //}
+                //海报页面的微信分享
+                shareWeixin(msg.data.message);
             }else{
                 console.log("错误"+xhr.status)
             }
@@ -883,7 +1074,7 @@ function saveText() {
 
 $(".replay-btn").on("click",function(){
     URLParams = new Array();
-    window.location.href = "http://wx.ttkuaiban.com/minigame/";
+    window.location.href = "https://wx.ttkuaiban.com/minigame/";
 })
 
 function hiddenCover() {

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

@@ -0,0 +1,34 @@
+function play_music(){
+    if ($('#mc_play').hasClass('on')){
+        $('#mc_play audio').get(0).pause();
+        $('#mc_play').attr('class','stop');
+    }else{
+        $('#mc_play audio').get(0).play();
+        $('#mc_play').attr('class','on');
+    }
+    var myVid = document.getElementById("music");
+    myVid.volume=0.1;
+    $('#music_play_filter').hide();
+    event.stopPropagation(); //阻止冒泡
+}
+
+function just_play(id){
+    $('#mc_play audio').get(0).play();
+    $('#mc_play').attr('class','on');
+    var myVid = document.getElementById("music");
+    myVid.volume=0.1;
+    if (typeof(id)!='undefined'){
+        $('#music_play_filter').hide();
+    }
+    event.stopPropagation(); //阻止冒泡
+}
+
+function is_weixn(){
+    return false;
+    var ua = navigator.userAgent.toLowerCase();
+    if(ua.match(/MicroMessenger/i)=="micromessenger") {
+        return true;
+    } else {
+        return false;
+    }
+}

+ 3 - 3
minigame/WebContent/js/poster.js

@@ -20,7 +20,7 @@
             type = 0;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                     +"appid=wx749c84daac654e1e&"
-                    +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
+                    +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
                     +"response_type=code&"
                     +"scope=snsapi_userinfo&"//snsapi_userinfo
                     +"state=1#wechat_redirect";
@@ -34,7 +34,7 @@
                 +"client_id=2141531565&"
                 //+"display=mobile&"
                 +"response_type=code&"
-                +"redirect_uri=http://wx.ttkuaiban.com/minigame/index.html"
+                +"redirect_uri=https://wx.ttkuaiban.com/minigame/index.html"
                 //+"scope=snsapi_base";
 			getMsg();
         }            
@@ -44,7 +44,7 @@
             type = 0;
             url = "https://open.weixin.qq.com/connect/oauth2/authorize?"
                     +"appid=wx749c84daac654e1e&"
-                    +"redirect_uri=http://wx.ttkuaiban.com/minigame&"
+                    +"redirect_uri=https://wx.ttkuaiban.com/minigame&"
                     +"response_type=code&"
                     +"scope=snsapi_userinfo&"//snsapi_userinfo
                     +"state=1#wechat_redirect";

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

@@ -1,14 +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({
@@ -67,5 +66,6 @@
     }
 	*/
 
-
+    
 })();
+

+ 138 - 80
minigame/WebContent/lottery.html

@@ -7,9 +7,12 @@
     <meta http-equiv="X-UA-Compatible" content="ie=edge">
     <title>抽奖</title>
     <script src="js/jquery.min.js"></script>
-    <link rel="stylesheet" href="css/lottery2.css" type="text/css" />
+    <script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
+    <script src="js/wechat.js"></script>
+    <link rel="stylesheet" href="css/lottery2.css?v=2" type="text/css" />
     <script type="text/javascript">
     	//从localstorage中取得ID
+    	var limit = 0;
     	var id = localStorage.userId;
         var current = 0;
         var last = 0;
@@ -19,17 +22,58 @@
         var src = null;
         var recordId = null;
         $(function () {
+        	//先在这里查看是否有id
+            if(id == null || id == undefined || id == ""){
+            	window.location.href = "https://wx.ttkuaiban.com/minigame";
+            }
+        	
+            $.post("./user/getWxConfigParam?url=https://wx.ttkuaiban.com/minigame/lottery.html", {}, 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: "https://wx.ttkuaiban.com/minigame/lottery.html",
+        			        success: function() {
+        			        	$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
+        		    				if (resp.code == 'error') {
+        		    					console.log(resp.code);
+        		    				}else{
+        		    					//分享之后前端限制可抽奖次数+1
+        		    					limit--;
+        		    				}
+        		    			});
+        			        },
+        			        cancel: function() {}
+        			    };
+        			    wx.onMenuShareAppMessage(share);
+        			    wx.onMenuShareTimeline(share);
+        			    wx.onMenuShareQQ(share);
+        			    wx.onMenuShareQZone(share);
+        			    wx.onMenuShareWeibo(share);
+        			});
+        			wx.error(function(res){
+        				console.log(res);
+        			});
+        		};	
+        	});
+            
             //进入和窗口缩放时重新设置内容位置
             setPosition();
             $(window).resize(function () {
                 setPosition();
-            });
-            //id设置进入localstorage
-            localStorage.setItem("userId", id);
-            //在这里查看是否有id
-            if(id == null || id == undefined || id == ""){
-            	window.location.href = "http://wx.ttkuaiban.com/minigame";
-            }
+            });            
             
             //获取
             $.post("./prize/luckDrawList", {}, function(resp) {
@@ -49,54 +93,61 @@
             
             //点击抽奖
             $(".button").click(function () {
-                if(enable == true){
-					//获取抽奖结果
-                    $.post("./prize/luckDraw", {userId: id}, function(resp) {
-        				if (resp.code == 'error') {
-        					alert(resp.msg);
-        				}else{
-        					//进入不可点击状态
-                            enable = false;
-                            //设置初始速度
-                            speed = 60;
-                            recordId = resp.data.prizeRecord;
-                            //设置要中奖的位置 1.5没有 0十二瓶 4一升 2.6五百毫升 3书 7肥皂
-                            if(resp.data.prizeLevel == -1){
-                            	var rand = Math.round(Math.random()*2);
-                            	console.log(rand);
-                            	if(rand <= 1){
-                            		threshold = 1;
-                            	}else{
-                            		threshold = 5; 
-                            	}
-                            }else if(resp.data.prizeLevel == 0){
-                            	threshold = 0;
-                            	src = "images/reward_oil60_2.png";
-                            }else if(resp.data.prizeLevel == 1){
-                            	threshold = 2;   
-                            	src = "images/reward_oil5_2.png";           	
-                            }else if(resp.data.prizeLevel == 2){
-                            	threshold = 4;
-                            	src = "images/reward_oil10_2.png";                          	
-                            }else if(resp.data.prizeLevel == 3){
-                            	threshold = 7;
-                            	src = "images/reward_soap2.png";                          	
-                            }else if(resp.data.prizeLevel == 4){
-                            	threshold = 3;
-                            	src = "images/reward_book2.png";        	
-                            }else{
-                            	threshold = 1;
-                            }
-                            //配置移动次数
-                            last = 56 + threshold - current;
-                            setTimeout(function(){next(current)}, 1000);
-        				}
-        			});
+            	if(enable == true){
+            		if(limit >= 1){
+            			alert("请再进行一次游戏获取抽奖机会");
+            			window.location.href = "index.html";
+            		}else{
+            			limit++;
+    					//获取抽奖结果
+                        $.post("./prize/luckDraw", {userId: id}, function(resp) {
+            				if (resp.code == 'error') {
+            					alert(resp.msg);
+            				}else{
+            					//进入不可点击状态
+                                enable = false;
+                                //设置初始速度
+                                speed = 60;
+                                recordId = resp.data.prizeRecord.id;
+                                //设置要中奖的位置 1.5没有 0十二瓶 4一升 2.6五百毫升 3书 7肥皂
+                                if(resp.data.prizeLevel == -1){
+                                	var rand = Math.round(Math.random()*2);
+                                	console.log(rand);
+                                	if(rand <= 1){
+                                		threshold = 1;
+                                	}else{
+                                		threshold = 5; 
+                                	}
+                                }else if(resp.data.prizeLevel == 0){
+                                	threshold = 0;
+                                	src = "images/reward_oil60_2.png";
+                                }else if(resp.data.prizeLevel == 1){
+                                	threshold = 2;   
+                                	src = "images/reward_oil5_2.png";           	
+                                }else if(resp.data.prizeLevel == 2){
+                                	threshold = 4;
+                                	src = "images/reward_oil10_2.png";                          	
+                                }else if(resp.data.prizeLevel == 3){
+                                	threshold = 7;
+                                	src = "images/reward_soap2.png";                          	
+                                }else if(resp.data.prizeLevel == 4){
+                                	threshold = 3;
+                                	src = "images/reward_book2.png"; 	
+                                }else{
+                                	threshold = 1;
+                                }
+                                //配置移动次数
+                                last = 56 + threshold - current;
+                                setTimeout(function(){next(current)}, 1000);
+            				}
+            			});
+            		}
                 }
             });
             //谢谢惠顾后点击的按钮
             $(".result_failed_button").click(function () {
                 window.location.href = "index.html";
+                //这里需要检查一下还有没有剩余次数,如果没有的话直接关闭mask,alert可以分享增加次数
             });
           	//领取奖品按钮
             $(".result_success_button").click(function () {
@@ -108,13 +159,19 @@
                 	$.post("./prize/luckDrawAddInfo", {
                 		id: recordId,
                 		phone: phone,
-                		username: name
+                		userName: name
                 	}, function(resp) {
         				if (resp.code == 'error') {
         					console.log(resp.code);
         				}else{
         					alert("填写成功");
-        					window.location.href = "index.html";
+        					$(".mask").hide();
+        		            $(".success").hide();
+        		            $(".result_success_title").hide();
+        		            $(".result_success_logo").hide();
+        		            $(".result_success_name").hide();
+        		            $(".result_success_phone").hide();
+        		            $(".result_success_button").hide();
         				}
         			});
                 }
@@ -126,9 +183,9 @@
             $(".pool").css("top", $(document).width() / 1.9);
             $(".container").css("top", $(document).width() / 1.75).css("height", $(document).width() / 1.6);
             $(".item").css("height", $(".container").width() / 3.9);
-            $(".title").css("top", $(".container").width() * 2.35);
-            $(".check_result").css("top", $(".container").width() * 2.36);
-            $(".tips").css("top", $(".container").width() * 2.45);
+            $(".title").css("top", $(".container").width() * 2.3);
+            $(".check_result").css("top", $(".container").width() * 2.32);
+            $(".tips").css("top", $(".container").width() * 2.42);
             $(".mask").css("height", $(document).height());
             $(".result_failed_button").css("top", $(".container").width() * 1.6);
             $(".result_success_title").css("top", $(".container").width() * 0.69);
@@ -153,7 +210,7 @@
                 setTimeout(function(){next()}, speed);
             }else{
                 setTimeout(function(){
-                    if(threshold == 1 || threshold == 3 || threshold == 5){
+                    if(threshold == 1 || threshold == 5){
                     	failed();
                     }else{
                     	success();
@@ -183,28 +240,28 @@
         }
         
      	//判断微信分享
-        document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
-    		//发送给好友
-    		WeixinJSBridge.on('menu:share:appmessage', function(argv){
-    			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
-    				if (resp.code == 'error') {
-    					console.log(resp.code);
-    				}else{
-    					alert("分享成功");
-    				}
-    			});
-    		});
-    		//分享到朋友圈
-    		WeixinJSBridge.on('menu:share:timeline', function(argv){
-    			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
-    				if (resp.code == 'error') {
-    					console.log(resp.code);
-    				}else{
-    					alert("分享成功");
-    				}
-    			});
-    		}); 
-    	}, false);
+//         document.addEventListener('WeixinJSBridgeReady', function onBridgeReady() {
+//     		//发送给好友
+//     		WeixinJSBridge.on('menu:share:appmessage', function(argv){
+//     			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
+//     				if (resp.code == 'error') {
+//     					console.log(resp.code);
+//     				}else{
+//     					alert("分享成功");
+//     				}
+//     			});
+//     		});
+//     		//分享到朋友圈
+//     		WeixinJSBridge.on('menu:share:timeline', function(argv){
+//     			$.post("./prize/luckDrawAddShare", {uid: id}, function(resp) {
+//     				if (resp.code == 'error') {
+//     					console.log(resp.code);
+//     				}else{
+//     					alert("分享成功");
+//     				}
+//     			});
+//     		}); 
+//     	}, false);
     </script>
 </head>
 
@@ -225,7 +282,8 @@
     <span class="title"><span style="color: #FF356B">活动</span>说明</span>
     <span class="tips">1.中奖者留下姓名和电话,在活动结束后会联系邮寄奖品;<br>
         2.微博参与抽奖方式:<br>
-        关注@贝蒂斯橄榄油官方微博,转发或评论置顶微博并上传“游戏结果海报”。
+        关注@贝蒂斯橄榄油官方微博,转发或评论置顶微博并上传“游戏结果海报”。<br>
+        3.每人每天通过游戏获得两次抽奖机会,转发本页面额外获得一次抽奖机会。
     </span>
 
     <div class="case">

+ 1 - 1
minigame/WebContent/result_all.html

@@ -23,7 +23,7 @@
 					for(let index in resp.data){
 						$("table").append(
 								"<tr><td>" + 
-								index +
+								(index + 1) +
 								"</td><td>" +
 								resp.data[index].nickName + 
 								"</td><td>" +

BIN
minigame/WebContent/sound/6滴只要6滴橄榄油.mp3


BIN
minigame/WebContent/sound/cut.mp3


BIN
minigame/WebContent/sound/oil.mp3


BIN
minigame/WebContent/sound/shake.mp3


BIN
minigame/WebContent/sound/soup.mp3


BIN
minigame/WebContent/sound/幸福的味道.mp3


BIN
minigame/WebContent/sound/橄榄油加醋又好吃又健康.mp3


BIN
minigame/WebContent/sound/火力燃烧.mp3


BIN
minigame/WebContent/sound/老健康了.mp3


+ 1 - 1
minigame/src/com/hssx/constant/Constant.java

@@ -11,7 +11,7 @@ public class Constant {
     public static final String MICROBLOG_APPSECRET = "f39462b939a56ce6d846bf83e04c20b5";//微博的accesstoken
     public static final String WECHAT_APPID = "wx749c84daac654e1e";//微信的appid
     public static final String WECHAT_APPSECRET = "aacbd046ec1c790836f4f684c96fe585";//微信的appsecret
-    public static final String CALLBACKURL = "http://wx.ttkuaiban.com/minigame/index.html";//微博返回code的回调地址
+    public static final String CALLBACKURL = "https://wx.ttkuaiban.com/minigame/index.html";//微博返回code的回调地址
 
 }
 

+ 5 - 3
minigame/src/com/hssx/controller/PrizeController.java

@@ -70,7 +70,9 @@ public class PrizeController {
 		HashMap<String, Object> map = new HashMap<String, Object>();
 		// 模拟无限次数抽奖
 		// 测试必定中奖账号
-//		if ("o1L3L5vwFkGSUMpec3uwRgsI6A-M".equals(user.getVoucherId())) {
+//		if ("o1L3L5jybPQ0zJWujikHpVJPBiM8".equals(user.getVoucherId())) {
+//			System.out.println("中奖了!!!!!!!!!!!!!!");
+//			prizeRecordMapper.insert(prizeRecord);
 //			Prize prize = prizeMapper.selectByPrimaryKey(1);
 //			// UserPrizeCount userPrizeCount = new UserPrizeCount();
 //			// userPrizeCount.setUserId(userId);
@@ -88,7 +90,7 @@ public class PrizeController {
 			// 直接抽奖(每日默认2次抽奖机会)
 			synchronized (this) {
 				Random ran = new Random();
-				int num = ran.nextInt(9999);
+				int num = ran.nextInt(60);
 				Prize prize = prizeMapper.selectByPrimaryKey(num);
 				if (prize == null) {
 					count = -1;
@@ -129,7 +131,7 @@ public class PrizeController {
 				// 已分享直接抽奖
 				synchronized (this) {
 					Random ran = new Random();
-					int num = ran.nextInt(108);// 50%中奖概率
+					int num = ran.nextInt(60);// 50%中奖概率
 					Prize prize = prizeMapper.selectByPrimaryKey(num);
 					if (prize == null) {
 						count = -1;

+ 1 - 1
minigame/src/com/hssx/controller/UserController.java

@@ -192,7 +192,7 @@ public class UserController {
 			@RequestParam String url,
 			HttpServletResponse response) throws Exception {
 		HttpRespMsg msg = new HttpRespMsg();
-		
+		System.out.println("接收到url=="+url);
 		WxParamExample example = new WxParamExample();
 		Date d = new Date(System.currentTimeMillis() - WX_TOKEN_EXPIRE);
 		example.createCriteria().andIndateGreaterThan(d);