Johson 6 年 前
コミット
fdf7d38067

ファイルの差分が大きいため隠しています
+ 233 - 127
assets/scenes/hall.fire


+ 10 - 10
assets/scenes/start.fire

@@ -1206,7 +1206,7 @@
     "editingReturn": [],
     "_N$backgroundImage": null,
     "_N$returnType": 1,
-    "_N$inputFlag": 3,
+    "_N$inputFlag": 5,
     "_N$inputMode": 6,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
@@ -2284,7 +2284,7 @@
     "editingReturn": [],
     "_N$backgroundImage": null,
     "_N$returnType": 1,
-    "_N$inputFlag": 3,
+    "_N$inputFlag": 0,
     "_N$inputMode": 6,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
@@ -6265,8 +6265,8 @@
     "editingDidEnded": [],
     "editingReturn": [],
     "_N$backgroundImage": null,
-    "_N$returnType": 1,
-    "_N$inputFlag": 3,
+    "_N$returnType": 5,
+    "_N$inputFlag": 5,
     "_N$inputMode": 6,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
@@ -6881,8 +6881,8 @@
     "editingDidEnded": [],
     "editingReturn": [],
     "_N$backgroundImage": null,
-    "_N$returnType": 1,
-    "_N$inputFlag": 3,
+    "_N$returnType": 5,
+    "_N$inputFlag": 0,
     "_N$inputMode": 6,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
@@ -7498,7 +7498,7 @@
     "editingReturn": [],
     "_N$backgroundImage": null,
     "_N$returnType": 1,
-    "_N$inputFlag": 3,
+    "_N$inputFlag": 0,
     "_N$inputMode": 6,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
@@ -8114,8 +8114,8 @@
     "editingReturn": [],
     "_N$backgroundImage": null,
     "_N$returnType": 1,
-    "_N$inputFlag": 3,
-    "_N$inputMode": 6,
+    "_N$inputFlag": 5,
+    "_N$inputMode": 3,
     "_N$fontSize": 21,
     "_N$lineHeight": 21,
     "_N$fontColor": {
@@ -8134,7 +8134,7 @@
       "b": 127,
       "a": 255
     },
-    "_N$maxLength": 10,
+    "_N$maxLength": 11,
     "_N$stayOnTop": false,
     "_id": "38yBx17vJLabNOSOBH6efH"
   },

+ 24 - 2
assets/scripts/controller/UserMgr.js

@@ -48,6 +48,7 @@ cc.Class({
             }
             else{
                 console.log(ret);
+                self.token = ret.data.token
                 // self.account = ret.name;
                 // self.userId = ret.id;
                 // self.avatar = ret.avatar;
@@ -82,6 +83,7 @@ cc.Class({
             }
             else{
                 console.log(ret);
+                self.token = ret.data.token
                 // self.account = ret.name;
                 // self.userId = ret.id;
                 // self.avatar = ret.avatar;
@@ -92,7 +94,7 @@ cc.Class({
             }
         };
         // cc.vv.wc.show("正在登录游戏");
-        cc.vv.http.sendRequest("/login",data,onLogin);
+        cc.vv.http.sendRequest("/sys/user/login",data,onLogin);
     },
     
     create:function(data){
@@ -116,7 +118,27 @@ cc.Class({
         //     sign:this.sign,
         //     name:name
         // };
-        cc.vv.http.sendRequest("/register",data,onCreate);    
+        cc.vv.http.sendRequest("/sys/user/register",data,onCreate);    
+    },
+
+    agentLogin:function(gameid,callback){
+        var onEnter = function(ret){
+            if(ret.status !== 1){
+                console.log(ret.msg);
+                callback(ret)
+            }
+            else{
+                console.log(ret);
+                self.gametoken = ret.data.token
+                callback(ret)
+                // cc.director.loadScene("hall");
+            }
+        }
+        var data = {
+            token :this.token,
+            id :gameid
+        };
+        cc.vv.http.sendRequest("/api/agent/login",data,onEnter)
     },
     
     enterRoom:function(roomId,callback){

+ 2 - 1
assets/scripts/net/HTTP.js

@@ -1,6 +1,7 @@
 //var URL = "http://120.77.56.190:9000";
 //var URL = "http://127.0.0.1:9000";
-var URL = "http://api.boyin18.com/sys/user";
+// var URL = "http://api.boyin18.com/sys/user";
+var URL = "http://192.168.2.186/qpapi/public"
 var HTTP = cc.Class({
     extends: cc.Component,
 

+ 9 - 3
assets/scripts/view/GamesHallController.js

@@ -21,6 +21,7 @@ cc.Class({
         buyuHall:cc.Node,
         caipiaoHall:cc.Node,
         zhenrenHall:cc.Node,
+        webviewNode:cc.Node,
 
         Gundong:cc.Label,
         GundongMask:cc.Mask,
@@ -61,10 +62,12 @@ cc.Class({
         this.dzyyHall.active = false
         this.buyuHall.active = false
         this.caipiaoHall.active = false
+        this.webviewNode.active = false
 
         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);
@@ -91,7 +94,9 @@ cc.Class({
             ['4' , this.zhenrenHall.getComponent('ZhenrenHallController')],
             ['5' , this.dzjjHall.getComponent('DzjjHallController')],
             ['6' , this.buyuHall.getComponent('BuyuHallController')],
-            ['7' , this.sportsHall.getComponent('SportsHallController')]]
+            // ['7' , this.sportsHall.getComponent('SportsHallController')]
+            ['7' , this.webviewNode.getComponent('WebviewCtrl')]
+        ]
 
         this.myhallMap = new Map(subhall);
         console.log(this.myhallMap.keys());
@@ -273,13 +278,14 @@ cc.Class({
     clickHall(sender,customEventData){
         this.showingHall = this.myhallMap.get(customEventData)
         this.showingHall.parentScene = this
-        this.showingHall.initScene()
+        this.showingHall.initScene(customEventData)
         this.setHalllist(customEventData)
         this.display()
     },
+
     clickHallList(sender,customEventData){
         var nextScene = this.myhallMap.get(customEventData)
-        nextScene.initScene()
+        nextScene.initScene(customEventData)
         nextScene.parentScene = this
         this.setHalllist(customEventData)
         if (nextScene) {

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

@@ -88,7 +88,7 @@ cc.Class({
         }
         var data = {
             user:user,
-            pass:pass,
+            password:pass,
         };
         console.log(user);
         cc.vv.userMgr.login(data);

+ 2 - 1
assets/scripts/view/SubHallManger.js

@@ -21,8 +21,9 @@ cc.Class({
 
     },
 
-    initScene()
+    initScene(gameid)
     {
+        this.gameid = gameid
         this.SceneLevel = 1
     },
 

+ 43 - 0
assets/scripts/view/WebviewCtrl.js

@@ -0,0 +1,43 @@
+import SubHallManger from '../view/subHallManger'
+cc.Class({
+    extends: SubHallManger,
+
+    properties: {
+        gamesNode:cc.Node,
+        webview: cc.WebView,
+    },
+    onLoad(){
+        cc.vv.userMgr.agentLogin(this.gameid,function (ret) {
+            this.reqSuccess(ret)
+        }.bind(this))
+    },
+
+    onWebFinishLoad: function (sender, event) {
+        var loadStatus = "";
+        if (event === cc.WebView.EventType.LOADED) {
+            loadStatus = " is loaded!";
+        } else if (event === cc.WebView.EventType.LOADING) {
+            loadStatus = " is loading!";
+        } else if (event === cc.WebView.EventType.ERROR) {
+            loadStatus = ' load error!';
+        }
+        console.log(loadStatus)
+    },
+    
+    // setView(gameid){
+    //     this.gameid = gameid
+    // },
+
+    reqSuccess(ret){
+        if(ret.status !== 1){
+            this.visitURL('http://sports.meme100.com/m/#/')
+        }else{
+            this.visitURL('http://sports.meme100.com/m/#/?token='+ret.data.apiToken)
+        }
+        
+    },
+
+    visitURL: function (url) {
+        this.webview.url = url;
+    }
+});

+ 9 - 0
assets/scripts/view/WebviewCtrl.js.meta

@@ -0,0 +1,9 @@
+{
+  "ver": "1.0.5",
+  "uuid": "40aae59a-7ecf-4f8a-a832-e5b4f8af93db",
+  "isPlugin": false,
+  "loadPluginInWeb": true,
+  "loadPluginInNative": true,
+  "loadPluginInEditor": false,
+  "subMetas": {}
+}

+ 1 - 1
settings/project.json

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

この差分においてかなりの量のファイルが変更されているため、一部のファイルを表示していません