allen 3 years ago
parent
commit
3b86d9d296

+ 21 - 0
app/index/controller/Index.php

@@ -255,6 +255,13 @@ class Index extends Controller
         }
         }
     }
     }
 
 
+    /**
+     * 开始游戏
+     * @return mixed|Json
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @throws ModelNotFoundException
+     */
     public function startGame()
     public function startGame()
     {
     {
         $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
         $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
@@ -296,6 +303,13 @@ class Index extends Controller
         return $this->successResponse(['gameId' => $gameId], '开始游戏成功');
         return $this->successResponse(['gameId' => $gameId], '开始游戏成功');
     }
     }
 
 
+    /**
+     * 结束游戏
+     * @return mixed|Json
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @throws ModelNotFoundException
+     */
     public function endGame()
     public function endGame()
     {
     {
         $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
         $activity = Db::table('awards_activity')->where('begin_at', '<=', time())
@@ -359,6 +373,13 @@ class Index extends Controller
         return $this->successResponse(null, '提交成功');
         return $this->successResponse(null, '提交成功');
     }
     }
 
 
+    /**
+     * 提交彩蛋
+     * @return mixed|Json
+     * @throws DataNotFoundException
+     * @throws DbException
+     * @throws ModelNotFoundException
+     */
     public function submitEasterEgg()
     public function submitEasterEgg()
     {
     {
         $easterEgg = Request::post("easterEgg");
         $easterEgg = Request::post("easterEgg");

+ 29 - 1
app/index/view/video/index.html

@@ -149,7 +149,7 @@
     };
     };
 
 
     var data = `{  "initial": [ "js/all.min.js" ],
     var data = `{  "initial": [ "js/all.min.js" ],
-        "game": [  "js/default.thm.js?v=10" , "js/main.min.js?v=10"  ]
+        "game": [  "js/default.thm.js?v=11" , "js/main.min.js?v=11"  ]
     }`;
     }`;
     var manifest = JSON.parse(data);
     var manifest = JSON.parse(data);
     var list = manifest.initial.concat(manifest.game);
     var list = manifest.initial.concat(manifest.game);
@@ -531,6 +531,32 @@
     }
     }
 
 
 
 
+    var gameId;
+    // 开始游戏
+    function startGame(   ){
+        var u = YUMING + 'index/index/startGame'
+        var obj = { token:theTokenData };
+        $.post(u,obj,function(data){      
+            console.log(data)         
+            gameId = data.data.gameId;           
+        })
+    }
+    // 结束游戏
+    function endGame(   ){
+        var u = YUMING + 'index/index/endGame'
+        var obj = { token:theTokenData };
+        $.post(u,obj,function(data){      
+            console.log(data)         
+        })
+    }
+    // 提交彩蛋
+    function submitEasterEgg( eggIndex  ){
+        var u = YUMING + 'index/index/submitEasterEgg'
+        var obj = { token:theTokenData ,gameId:gameId,  easterEgg:eggIndex };
+        $.post(u,obj,function(data){      
+            console.log(data)         
+        })
+    }
 
 
 
 
     function showHaibao(){
     function showHaibao(){
@@ -646,6 +672,7 @@
 
 
     // 新增---------------
     // 新增---------------
     $('#jiangImg').click(function(){
     $('#jiangImg').click(function(){
+        canJump = 0;
         getAwardLog(function(obj){
         getAwardLog(function(obj){
             console.log(obj);
             console.log(obj);
             if(obj.length > 0){
             if(obj.length > 0){
@@ -692,6 +719,7 @@
 
 
     // 新增 0725---------
     // 新增 0725---------
     $('#rankImg').click(function(){
     $('#rankImg').click(function(){
+        canJump = 0;
         $('#tipDIV').hide();
         $('#tipDIV').hide();
         hideBtnDIV();
         hideBtnDIV();
         MainGame.self.showRankPage();
         MainGame.self.showRankPage();

+ 0 - 0
public/js/default.thm.js


File diff suppressed because it is too large
+ 0 - 0
public/js/main.min.js


Some files were not shown because too many files changed in this diff