Johson 6 年之前
父节点
当前提交
636dc5f35c

+ 3 - 3
assets/scripts/controller/UserMgr.js

@@ -15,9 +15,9 @@ cc.Class({
 
         id           :null,
         phone        :null,
-        name         :null,
+        playername         :null,
         avatar       :null,
-        uuid         :null,
+        playeruuid         :null,
         deleted_at   :null,
         created_at   :null,
         updated_at   :null,
@@ -76,7 +76,7 @@ cc.Class({
             }
         };
         // cc.vv.wc.show("正在登录游戏");
-        cc.vv.http.sendRequest("/hideLogin",null,onLogin);
+        cc.vv.http.sendRequest("/login",data,onLogin);
     },
     
     create:function(data){

+ 3 - 0
assets/scripts/view/AginHallController.js

@@ -8,6 +8,9 @@ cc.Class({
         gamesNode:cc.Node,
         
     },
+    init(){
+        this.SceneLevel = 2
+    },
 });
 
 

+ 3 - 0
assets/scripts/view/AgxinHallController.js

@@ -8,6 +8,9 @@ cc.Class({
         gamesNode:cc.Node,
         
     },
+    init(){
+        this.SceneLevel = 2
+    },
 });
 
 

+ 3 - 0
assets/scripts/view/BBinHallController.js

@@ -8,6 +8,9 @@ cc.Class({
         gamesNode:cc.Node,
         
     },
+    init(){
+        this.SceneLevel = 2
+    },
 });
 
 

+ 5 - 4
assets/scripts/view/CaiPiaoHallController.js

@@ -25,11 +25,12 @@ cc.Class({
     
     ClickGamesBtn(sender,customEventData)
     {
-        this.showingHall = this.subgamesNode.getComponent('CaiPiaosubHallController')
+        var showingHall = this.subgamesNode.getComponent('CaiPiaosubHallController')
         var needgames = this.myMap.get(customEventData)
-        this.showingHall.plane = this.subgamesNode.getChildByName("nameplane"+customEventData)
-        this.showingHall.showNeedGames(needgames)
-        this.playEnd('down')
+        showingHall.plane = this.subgamesNode.getChildByName("nameplane"+customEventData)
+        showingHall.showNeedGames(needgames)
+        showingHall.parentScene = this
+        this.playEnd(showingHall)
     },
 });
 

+ 3 - 0
assets/scripts/view/CaiPiaosubHallController.js

@@ -9,6 +9,9 @@ cc.Class({
         content:cc.Node,
         listView:cc.ScrollView,
     },
+    init(){
+        this.SceneLevel = 2
+    },
     showNeedGames(games)
     {
         this.listView.scrollToOffset(cc.v2(0,0),0)

+ 12 - 8
assets/scripts/view/DianziYouyiHallController.js

@@ -14,20 +14,24 @@ cc.Class({
     },
 
     clickAginHall(sender){
-        this.showingHall = this.aginHall.getComponent('AginHallController')
-        this.playEnd('down')
+        var showingHall = this.aginHall.getComponent('AginHallController')
+        showingHall.parentScene = this
+        this.playEnd(showingHall)
     },
     clickAgxinHall(sender){
-        this.showingHall = this.agxinHall.getComponent('AgxinHallController')
-        this.playEnd('down')
+        var showingHall = this.agxinHall.getComponent('AgxinHallController')
+        showingHall.parentScene = this
+        this.playEnd(showingHall)
     },
     clickBBinHall(sender){
-        this.showingHall = this.bbinHall.getComponent('BBinHallController')
-        this.playEnd('down')
+        var showingHall = this.bbinHall.getComponent('BBinHallController')
+        showingHall.parentScene = this
+        this.playEnd(showingHall)
     },
     clickMgHall(sender){
-        this.showingHall = this.mgHall.getComponent('MgHallController')
-        this.playEnd('down')
+        var showingHall = this.mgHall.getComponent('MgHallController')
+        showingHall.parentScene = this
+        this.playEnd(showingHall)
     },
 });
 

+ 23 - 11
assets/scripts/view/GamesHallController.js

@@ -62,6 +62,8 @@ cc.Class({
 
         this.returnNode.active =false
         this.shareNode.active =true
+        this.hallListBtn.active = false
+        // this.halllist.active = false
         // this.playShow()
         // this.animation = this.nvren.getComponent(cc.Animation);
         
@@ -143,7 +145,7 @@ cc.Class({
             var text = self.Gundong;
             var width = self.GundongMask.node.width;
             text.node.runAction(cc.repeatForever(cc.sequence(
-                cc.moveTo(text.node.width/width*10,cc.p(-text.node.width-width/5,text.node.y)),
+                cc.moveTo(text.node.width/width*10,cc.v2(-text.node.width-width/5,text.node.y)),
                 cc.callFunc(function(){
                     text.node.x = width;
                 }))));
@@ -168,7 +170,7 @@ cc.Class({
             var text = self.Gundong1;
             var height = self.GundongMask1.node.height;
             text.node.runAction(cc.repeatForever(cc.sequence(
-                cc.moveTo(1,cc.p(text.node.x,text.node.y+57)),
+                cc.moveTo(1,cc.v2(text.node.x,text.node.y+57)),
                 cc.callFunc(function(){
                     if (text.node.height == Math.abs(text.node.y)+17) {
                         text.node.y = 17;
@@ -206,7 +208,7 @@ cc.Class({
             var text = this.Gundong1;
             // var height = this.GundongMask1.node.height;
             text.node.runAction(cc.sequence(
-                cc.moveTo(1,cc.p(text.node.x,text.node.y+50)),
+                cc.moveTo(1,cc.v2(text.node.x,text.node.y+50)),
                 cc.callFunc(function(){
                     if (text.node.height <= Math.abs(text.node.y)+13) {
                         text.node.y = 13;
@@ -268,22 +270,28 @@ cc.Class({
 
     clickHall(sender,customEventData){
         this.showingHall = this.myhallMap.get(customEventData)
+        this.showingHall.parentScene = this
+        this.showingHall.initScene()
         this.setHalllist(customEventData)
         this.display()
     },
     clickHallList(sender,customEventData){
-        var nextScense = this.myhallMap.get(customEventData)
+        var nextScene = this.myhallMap.get(customEventData)
+        nextScene.initScene()
+        nextScene.parentScene = this
         this.setHalllist(customEventData)
-        if (nextScense) {
-            this.showingHall.playEnd('horizontal',nextScense)
+        if (nextScene) {
+            this.showingHall.playEnd(nextScene)
         }
     },
     
     display(){
-        this.setHalllistBtnDisplay(true)
+        if (this.showingHall.SceneLevel == 1) {
+            this.setHalllistBtnDisplay(true)
+        }
         var animation = this.hallsBtns.getComponent(cc.Animation);
         var hallsGoFinished = function(){
-            this.showingHall.playShow(this)
+            this.showingHall.playShow(this.setShowingHall)
             this.hallsBtns._parent._parent.active = false
         };
         animation.on('finished', hallsGoFinished, this);
@@ -292,7 +300,7 @@ cc.Class({
     },
     clickReturnBtn(){
         if (this.showingHall) {
-            this.showingHall.playEnd('up')
+            this.showingHall.playEnd()
         }
     },
     playShow(param)
@@ -310,9 +318,13 @@ cc.Class({
         this.animation.play('nrcome1');
     },
     setShowingHall(Hall){
-        this.showingHall = Hall==this?null:Hall
+        this.showingHall = Hall
         this.returnNode.active =Hall!=this
         this.shareNode.active =Hall==this
+        if (this.halllist.moved) {
+            this.setHalllistDisplay(!this.halllist.moved)
+        }
+        this.setHalllistBtnDisplay(this.showingHall.SceneLevel ==1 && !this.halllist.moved)
     },
 
     setHalllistBtnDisplay(display){
@@ -327,7 +339,7 @@ cc.Class({
     setHalllistDisplay(display)
     {
         if (this.halllist.moved!=display) {
-            var actionTo1 = display?cc.moveBy(0.3, cc.v2(340, 0)):cc.moveBy(0.3, cc.v2(-340, 0));
+            var actionTo1 = display?cc.moveBy(0.3, cc.v2(367, 0)):cc.moveBy(0.3, cc.v2(-367, 0));
             this.halllist.runAction(actionTo1)
             this.halllist.moved = display
         }

+ 9 - 9
assets/scripts/view/LoadingUIController.js

@@ -82,16 +82,16 @@ cc.Class({
     onBtnLoginClicked:function(){
         var user = this.loginName.string;
         var pass = this.loginPass.string;
-        // if(user == ""){
-        //     console.log("invalid name.");
-        //     return;
-        // }
-        // var data = {
-        //     user:user,
-        //     pass:pass,
-        // };
+        if(user == ""){
+            console.log("invalid name.");
+            return;
+        }
+        var data = {
+            user:user,
+            pass:pass,
+        };
         console.log(name);
-        cc.vv.userMgr.login();
+        cc.vv.userMgr.login(data);
     },
 
     initListener()

+ 3 - 0
assets/scripts/view/MgHallController.js

@@ -8,6 +8,9 @@ cc.Class({
         gamesNode:cc.Node,
         
     },
+    init(){
+        this.SceneLevel = 2
+    },
 });
 
 

+ 37 - 41
assets/scripts/view/SubHallManger.js

@@ -3,7 +3,6 @@ cc.Class({
     extends: cc.Component,
 
     properties: {
-
     },
 
     ctor: function () {
@@ -22,60 +21,57 @@ cc.Class({
 
     },
 
-    playShow(parentHall)
+    initScene()
+    {
+        this.SceneLevel = 1
+    },
+
+    playShow()
     {
-        if (parentHall) {
-            this.parentHall = parentHall
-        }
         this.node.active = true
-        console.log("this.node.width is ====",this.node.width)
-        console.log("this.MoveNum is ====",this.MoveNum)
         var actionTo = cc.moveBy(0.3, cc.v2(-this.node.parent.width, 0));
-        var actionTo1 = cc.moveBy(0.3, cc.v2(100, 0));
         this.node.width = this.node.parent.width
         this.node.runAction(actionTo)
-        // if (this.plane) {
-        //     this.plane.runAction(actionTo1)
-        // }
-        this.setShowingHall(this)
+        // this.setShowingHall(this)
+        if (this.parentScene.setShowingHall) {
+            this.parentScene.setShowingHall(this)
+        }
     },
 
-    playEnd(direction,nextScense)
+    playEnd(nextScense)
     {
         var finished = cc.callFunc(function() {
             this.node.active = false;
-            if (this.parentHall && this.parentHall.playShow && direction == "up") {
-                this.parentHall.playShow()
-                if (this.parentHall.parentHall && this.parentHall.parentHall.setHalllistDisplay) {
-                    this.parentHall.parentHall.setHalllistDisplay(true)
-                }
-                this.showingHall = this.parentHall
-            }else if (direction == "down")
-            {
-                if (this.parentHall && this.parentHall.setHalllistDisplay) {
-                    this.parentHall.setHalllistDisplay(false)
-                }
-                this.showingHall.playShow(this)
-            }else if(this.parentHall && nextScense && direction == 'horizontal')
-            {
-                nextScense.playShow(this.parentHall)
-                this.showingHall = nextScense
+            if (this.parentScene) {
+                if(nextScense && nextScense.playShow)
+                {
+                    nextScense.playShow()
+                    if (this.parentScene.setShowingHall) {
+                        this.parentScene.setShowingHall(nextScense)
+                    }
+                }else if (this.parentScene && this.parentScene.playShow) {
+                    this.parentScene.playShow()
+                    if (this.parentScene.setShowingHall) {
+                        this.parentScene.setShowingHall(this.parentScene)
+                    }
+                // if (this.parentScene.parentScene && this.parentScene.parentScene.setHalllistDisplay) {
+                //     this.parentScene.parentScene.setHalllistDisplay(true)
+                // }
+            }
+            }
+             
+            if (this.extraPlay) {
+                this.extraPlay()
             }
-            this.setShowingHall(this.showingHall)
         }, this, null);
         var actionTo = cc.sequence(cc.moveBy(0.3, cc.v2(this.node.parent.width, 0)),finished);
-        var actionTo1 = cc.moveBy(0.3, cc.v2(-103, 0));
         this.node.runAction(actionTo)
-        // if (this.plane) {
-        //     this.plane.runAction(actionTo1)
-        // }
     },
-    
-    setShowingHall(Hall)
-    {
-        if (this.parentHall && this.parentHall.setShowingHall && this.parentHall != this) {
-            this.showingHall = Hall
-            this.parentHall.setShowingHall(this.showingHall)
+
+    setShowingHall(hall){
+        if (this.parentScene && this.parentScene.setShowingHall) {
+            this.parentScene.setShowingHall(hall)
         }
-    }
+    },
+    
 });

+ 1 - 1
assets/scripts/view/TipsLayerController.js

@@ -9,7 +9,7 @@ cc.Class({
 
     onLoad()
     {
-        this.node.active = false
+        // this.node.active = false
         this.node.children.forEach(element => {
             element.active = false
         });

+ 1 - 1
settings/project.json

@@ -23,7 +23,7 @@
   "group-list": [
     "default"
   ],
-  "last-module-event-record-time": 1557052165489,
+  "last-module-event-record-time": 1557740830348,
   "simulator-orientation": false,
   "simulator-resolution": {
     "height": 640,