zouyong 5 лет назад
Родитель
Сommit
61d4c923a4

+ 308 - 189
tower_sanguo/assets/resources/module/loading/loading.prefab

@@ -30,17 +30,17 @@
         "__id__": 43
       },
       {
-        "__id__": 54
+        "__id__": 58
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 65
+        "__id__": 69
       }
     ],
     "_prefab": {
-      "__id__": 66
+      "__id__": 70
     },
     "_opacity": 255,
     "_color": {
@@ -130,7 +130,7 @@
       "array": [
         0,
         0,
-        536.9357503463519,
+        532.6056233274298,
         0,
         0,
         0,
@@ -1664,7 +1664,7 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "btn_share",
+    "_name": "New EditBox",
     "_objFlags": 0,
     "_parent": {
       "__id__": 1
@@ -1672,16 +1672,22 @@
     "_children": [
       {
         "__id__": 44
+      },
+      {
+        "__id__": 48
+      },
+      {
+        "__id__": 52
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 51
+        "__id__": 56
       }
     ],
     "_prefab": {
-      "__id__": 53
+      "__id__": 57
     },
     "_opacity": 255,
     "_color": {
@@ -1693,7 +1699,7 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
+      "width": 500,
       "height": 40
     },
     "_anchorPoint": {
@@ -1705,15 +1711,15 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        3.438,
-        -192.536,
+        0,
+        0,
         0,
         0,
         0,
         0,
         1,
-        4,
-        4,
+        1,
+        1,
         1
       ]
     },
@@ -1732,27 +1738,23 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "bg_share",
+    "_name": "BACKGROUND_SPRITE",
     "_objFlags": 512,
     "_parent": {
       "__id__": 43
     },
-    "_children": [
-      {
-        "__id__": 45
-      }
-    ],
+    "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 48
+        "__id__": 45
       },
       {
-        "__id__": 49
+        "__id__": 46
       }
     ],
     "_prefab": {
-      "__id__": 50
+      "__id__": 47
     },
     "_opacity": 255,
     "_color": {
@@ -1764,8 +1766,8 @@
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
-      "height": 40
+      "width": 500,
+      "height": 60
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
@@ -1802,46 +1804,119 @@
     "_id": ""
   },
   {
+    "__type__": "cc.Sprite",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 44
+    },
+    "_enabled": true,
+    "_materials": [
+      {
+        "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+      }
+    ],
+    "_srcBlendFactor": 770,
+    "_dstBlendFactor": 771,
+    "_spriteFrame": {
+      "__uuid__": "ff0e91c7-55c6-4086-a39f-cb6e457b8c3b"
+    },
+    "_type": 1,
+    "_sizeMode": 0,
+    "_fillType": 0,
+    "_fillCenter": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 0
+    },
+    "_fillStart": 0,
+    "_fillRange": 0,
+    "_isTrimmedMode": true,
+    "_atlas": null,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 44
+    },
+    "_enabled": true,
+    "alignMode": 0,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 0,
+    "_right": 0,
+    "_top": -10,
+    "_bottom": -10,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 160,
+    "_originalHeight": 40,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.PrefabInfo",
+    "root": {
+      "__id__": 1
+    },
+    "asset": {
+      "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
+    },
+    "fileId": "11ayTYL0tJMKy+axIM6E44",
+    "sync": false
+  },
+  {
     "__type__": "cc.Node",
-    "_name": "lbl_share",
-    "_objFlags": 512,
+    "_name": "TEXT_LABEL",
+    "_objFlags": 0,
     "_parent": {
-      "__id__": 44
+      "__id__": 43
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 46
+        "__id__": 49
+      },
+      {
+        "__id__": 50
       }
     ],
     "_prefab": {
-      "__id__": 47
+      "__id__": 51
     },
     "_opacity": 255,
     "_color": {
       "__type__": "cc.Color",
-      "r": 0,
-      "g": 0,
-      "b": 0,
+      "r": 255,
+      "g": 255,
+      "b": 255,
       "a": 255
     },
     "_contentSize": {
       "__type__": "cc.Size",
-      "width": 100,
-      "height": 40
+      "width": 500,
+      "height": 60
     },
     "_anchorPoint": {
       "__type__": "cc.Vec2",
-      "x": 0.5,
-      "y": 0.5
+      "x": 0,
+      "y": 1
     },
     "_trs": {
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
-        0,
+        -248,
+        26.311999999999998,
         0,
         0,
         0,
@@ -1870,7 +1945,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 45
+      "__id__": 48
     },
     "_enabled": true,
     "_materials": [
@@ -1878,11 +1953,11 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_useOriginalSize": false,
-    "_string": "分享",
-    "_N$string": "分享",
-    "_fontSize": 20,
-    "_lineHeight": 40,
+    "_useOriginalSize": true,
+    "_string": "",
+    "_N$string": "",
+    "_fontSize": 50,
+    "_lineHeight": 60,
     "_enableWrapText": false,
     "_N$file": null,
     "_isSystemFontUsed": true,
@@ -1891,10 +1966,37 @@
     "_styleFlags": 0,
     "_underlineHeight": 0,
     "_N$horizontalAlign": 1,
-    "_N$verticalAlign": 1,
+    "_N$verticalAlign": 0,
     "_N$fontFamily": "Arial",
     "_N$overflow": 1,
-    "_N$cacheMode": 1,
+    "_N$cacheMode": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Widget",
+    "_name": "",
+    "_objFlags": 0,
+    "node": {
+      "__id__": 48
+    },
+    "_enabled": true,
+    "alignMode": 0,
+    "_target": null,
+    "_alignFlags": 45,
+    "_left": 2,
+    "_right": -2,
+    "_top": -6.312000000000001,
+    "_bottom": -13.687999999999999,
+    "_verticalCenter": 0,
+    "_horizontalCenter": 0,
+    "_isAbsLeft": true,
+    "_isAbsRight": true,
+    "_isAbsTop": true,
+    "_isAbsBottom": true,
+    "_isAbsHorizontalCenter": true,
+    "_isAbsVerticalCenter": true,
+    "_originalWidth": 158,
+    "_originalHeight": 40,
     "_id": ""
   },
   {
@@ -1905,15 +2007,82 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "a4vPw2FMVFjrUgBFEzR1Kx",
+    "fileId": "90E/Kwu0tGv48pmipAdmY3",
     "sync": false
   },
   {
-    "__type__": "cc.Sprite",
+    "__type__": "cc.Node",
+    "_name": "PLACEHOLDER_LABEL",
+    "_objFlags": 512,
+    "_parent": {
+      "__id__": 43
+    },
+    "_children": [],
+    "_active": true,
+    "_components": [
+      {
+        "__id__": 53
+      },
+      {
+        "__id__": 54
+      }
+    ],
+    "_prefab": {
+      "__id__": 55
+    },
+    "_opacity": 255,
+    "_color": {
+      "__type__": "cc.Color",
+      "r": 187,
+      "g": 187,
+      "b": 187,
+      "a": 255
+    },
+    "_contentSize": {
+      "__type__": "cc.Size",
+      "width": 498,
+      "height": 40
+    },
+    "_anchorPoint": {
+      "__type__": "cc.Vec2",
+      "x": 0,
+      "y": 1
+    },
+    "_trs": {
+      "__type__": "TypedArray",
+      "ctor": "Float64Array",
+      "array": [
+        -248,
+        20,
+        0,
+        0,
+        0,
+        0,
+        1,
+        1,
+        1,
+        1
+      ]
+    },
+    "_eulerAngles": {
+      "__type__": "cc.Vec3",
+      "x": 0,
+      "y": 0,
+      "z": 0
+    },
+    "_skewX": 0,
+    "_skewY": 0,
+    "_is3DNode": false,
+    "_groupIndex": 0,
+    "groupIndex": 0,
+    "_id": ""
+  },
+  {
+    "__type__": "cc.Label",
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 44
+      "__id__": 52
     },
     "_enabled": true,
     "_materials": [
@@ -1921,23 +2090,23 @@
         "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
       }
     ],
-    "_srcBlendFactor": 770,
-    "_dstBlendFactor": 771,
-    "_spriteFrame": {
-      "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
-    },
-    "_type": 1,
-    "_sizeMode": 0,
-    "_fillType": 0,
-    "_fillCenter": {
-      "__type__": "cc.Vec2",
-      "x": 0,
-      "y": 0
-    },
-    "_fillStart": 0,
-    "_fillRange": 0,
-    "_isTrimmedMode": true,
-    "_atlas": null,
+    "_useOriginalSize": true,
+    "_string": "输入mac地址",
+    "_N$string": "输入mac地址",
+    "_fontSize": 20,
+    "_lineHeight": 25,
+    "_enableWrapText": false,
+    "_N$file": null,
+    "_isSystemFontUsed": true,
+    "_spacingX": 0,
+    "_batchAsBitmap": false,
+    "_styleFlags": 0,
+    "_underlineHeight": 0,
+    "_N$horizontalAlign": 0,
+    "_N$verticalAlign": 1,
+    "_N$fontFamily": "Arial",
+    "_N$overflow": 1,
+    "_N$cacheMode": 0,
     "_id": ""
   },
   {
@@ -1945,13 +2114,13 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 44
+      "__id__": 52
     },
     "_enabled": true,
     "alignMode": 0,
     "_target": null,
     "_alignFlags": 45,
-    "_left": 0,
+    "_left": 2,
     "_right": 0,
     "_top": 0,
     "_bottom": 0,
@@ -1963,7 +2132,7 @@
     "_isAbsBottom": true,
     "_isAbsHorizontalCenter": true,
     "_isAbsVerticalCenter": true,
-    "_originalWidth": 100,
+    "_originalWidth": 158,
     "_originalHeight": 40,
     "_id": ""
   },
@@ -1975,108 +2144,41 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "e6s3ZQaI1LDLNxUqxPp7n5",
+    "fileId": "adwID24SdPp4bEbrmcCPZm",
     "sync": false
   },
   {
-    "__type__": "cc.Button",
+    "__type__": "cc.EditBox",
     "_name": "",
     "_objFlags": 0,
     "node": {
       "__id__": 43
     },
     "_enabled": true,
-    "_normalMaterial": {
-      "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
-    },
-    "_grayMaterial": null,
-    "duration": 0.1,
-    "zoomScale": 1.2,
-    "clickEvents": [
-      {
-        "__id__": 52
-      }
-    ],
-    "_N$interactable": true,
-    "_N$enableAutoGrayEffect": false,
-    "_N$transition": 2,
-    "transition": 2,
-    "_N$normalColor": {
-      "__type__": "cc.Color",
-      "r": 230,
-      "g": 230,
-      "b": 230,
-      "a": 255
-    },
-    "_N$pressedColor": {
-      "__type__": "cc.Color",
-      "r": 200,
-      "g": 200,
-      "b": 200,
-      "a": 255
-    },
-    "pressedColor": {
-      "__type__": "cc.Color",
-      "r": 200,
-      "g": 200,
-      "b": 200,
-      "a": 255
-    },
-    "_N$hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "hoverColor": {
-      "__type__": "cc.Color",
-      "r": 255,
-      "g": 255,
-      "b": 255,
-      "a": 255
-    },
-    "_N$disabledColor": {
-      "__type__": "cc.Color",
-      "r": 120,
-      "g": 120,
-      "b": 120,
-      "a": 200
-    },
-    "_N$normalSprite": {
-      "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
-    },
-    "_N$pressedSprite": {
-      "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
-    },
-    "pressedSprite": {
-      "__uuid__": "e9ec654c-97a2-4787-9325-e6a10375219a"
-    },
-    "_N$hoverSprite": {
-      "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
-    },
-    "hoverSprite": {
-      "__uuid__": "f0048c10-f03e-4c97-b9d3-3506e1d58952"
-    },
-    "_N$disabledSprite": {
-      "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
+    "_useOriginalSize": false,
+    "_string": "c9:65:e2:1c:b0:23",
+    "returnType": 0,
+    "maxLength": 17,
+    "_tabIndex": 0,
+    "editingDidBegan": [],
+    "textChanged": [],
+    "editingDidEnded": [],
+    "editingReturn": [],
+    "_N$textLabel": {
+      "__id__": 49
+    },
+    "_N$placeholderLabel": {
+      "__id__": 53
     },
-    "_N$target": {
-      "__id__": 43
+    "_N$background": {
+      "__id__": 45
     },
+    "_N$inputFlag": 5,
+    "_N$inputMode": 6,
+    "_N$stayOnTop": false,
     "_id": ""
   },
   {
-    "__type__": "cc.ClickEvent",
-    "target": {
-      "__id__": 1
-    },
-    "component": "",
-    "_componentId": "5b5a8FTiW1BNa0P/4J4OxNj",
-    "handler": "clickShare",
-    "customEventData": ""
-  },
-  {
     "__type__": "cc.PrefabInfo",
     "root": {
       "__id__": 1
@@ -2084,29 +2186,29 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "d0moPmfkBMbZkvgZoRCtg0",
+    "fileId": "06hQMbRr9JgKIx50yE5Qx/",
     "sync": false
   },
   {
     "__type__": "cc.Node",
-    "_name": "btn_open",
+    "_name": "btn_login",
     "_objFlags": 0,
     "_parent": {
       "__id__": 1
     },
     "_children": [
       {
-        "__id__": 55
+        "__id__": 59
       }
     ],
-    "_active": true,
+    "_active": false,
     "_components": [
       {
-        "__id__": 62
+        "__id__": 66
       }
     ],
     "_prefab": {
-      "__id__": 64
+      "__id__": 68
     },
     "_opacity": 255,
     "_color": {
@@ -2130,8 +2232,8 @@
       "__type__": "TypedArray",
       "ctor": "Float64Array",
       "array": [
-        0,
-        0,
+        3.438,
+        -192.536,
         0,
         0,
         0,
@@ -2157,27 +2259,27 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "bg_open",
-    "_objFlags": 0,
+    "_name": "bg_share",
+    "_objFlags": 512,
     "_parent": {
-      "__id__": 54
+      "__id__": 58
     },
     "_children": [
       {
-        "__id__": 56
+        "__id__": 60
       }
     ],
     "_active": true,
     "_components": [
       {
-        "__id__": 59
+        "__id__": 63
       },
       {
-        "__id__": 60
+        "__id__": 64
       }
     ],
     "_prefab": {
-      "__id__": 61
+      "__id__": 65
     },
     "_opacity": 255,
     "_color": {
@@ -2228,20 +2330,20 @@
   },
   {
     "__type__": "cc.Node",
-    "_name": "lbl_open",
-    "_objFlags": 0,
+    "_name": "lbl_share",
+    "_objFlags": 512,
     "_parent": {
-      "__id__": 55
+      "__id__": 59
     },
     "_children": [],
     "_active": true,
     "_components": [
       {
-        "__id__": 57
+        "__id__": 61
       }
     ],
     "_prefab": {
-      "__id__": 58
+      "__id__": 62
     },
     "_opacity": 255,
     "_color": {
@@ -2295,7 +2397,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 56
+      "__id__": 60
     },
     "_enabled": true,
     "_materials": [
@@ -2304,8 +2406,8 @@
       }
     ],
     "_useOriginalSize": false,
-    "_string": "打开互推",
-    "_N$string": "打开互推",
+    "_string": "登录",
+    "_N$string": "登录",
     "_fontSize": 20,
     "_lineHeight": 40,
     "_enableWrapText": false,
@@ -2330,7 +2432,7 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "9bBlxf79ZHeqYjfzbhQ4/H",
+    "fileId": "a4vPw2FMVFjrUgBFEzR1Kx",
     "sync": false
   },
   {
@@ -2338,7 +2440,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 59
     },
     "_enabled": true,
     "_materials": [
@@ -2370,7 +2472,7 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 55
+      "__id__": 59
     },
     "_enabled": true,
     "alignMode": 0,
@@ -2400,7 +2502,7 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "82pcDh96lNC6sLfFSR1sI6",
+    "fileId": "e6s3ZQaI1LDLNxUqxPp7n5",
     "sync": false
   },
   {
@@ -2408,16 +2510,18 @@
     "_name": "",
     "_objFlags": 0,
     "node": {
-      "__id__": 54
+      "__id__": 58
     },
     "_enabled": true,
-    "_normalMaterial": null,
+    "_normalMaterial": {
+      "__uuid__": "eca5d2f2-8ef6-41c2-bbe6-f9c79d09c432"
+    },
     "_grayMaterial": null,
     "duration": 0.1,
     "zoomScale": 1.2,
     "clickEvents": [
       {
-        "__id__": 63
+        "__id__": 67
       }
     ],
     "_N$interactable": true,
@@ -2485,7 +2589,7 @@
       "__uuid__": "29158224-f8dd-4661-a796-1ffab537140e"
     },
     "_N$target": {
-      "__id__": 55
+      "__id__": 58
     },
     "_id": ""
   },
@@ -2496,7 +2600,7 @@
     },
     "component": "",
     "_componentId": "5b5a8FTiW1BNa0P/4J4OxNj",
-    "handler": "clickOpen",
+    "handler": "clickLogin",
     "customEventData": ""
   },
   {
@@ -2507,7 +2611,7 @@
     "asset": {
       "__uuid__": "cef7cf40-13aa-4dd9-a07c-b36334df80d0"
     },
-    "fileId": "e2HuYa69tN2YXY6qwRtPdV",
+    "fileId": "d0moPmfkBMbZkvgZoRCtg0",
     "sync": false
   },
   {
@@ -2518,6 +2622,21 @@
       "__id__": 1
     },
     "_enabled": true,
+    "mask_type": 0,
+    "close_node": null,
+    "design_block_node": null,
+    "use_modal": false,
+    "use_outside_close": false,
+    "effect_par": null,
+    "open_effect": 0,
+    "close_effect": 0,
+    "close_toPoint": "",
+    "lbl_usename": {
+      "__id__": 56
+    },
+    "btn_login": {
+      "__id__": 66
+    },
     "_id": ""
   },
   {

+ 11 - 5
tower_sanguo/assets/scripts/GameController.ts

@@ -131,6 +131,12 @@ class GameController {
     }
 
     initSDK() {
+        if (this.loadui) {
+            this.loadui.disPlayloginBtn();
+        }
+    }
+
+    login() {
         LogUtil.logAndroid('initSDK...' + this.useLocalServer);
         if (this.useLocalServer) {
             this.gameData.initServerData();
@@ -251,7 +257,7 @@ class GameController {
         }
     }
 
-    
+
     /** 上次发送错误日志的时间 */
     static lastSendErrorTime: number = new Date().getTime();
     /** 最近发送的错误日志 */
@@ -306,17 +312,17 @@ class GameController {
         GameController.lastSendErrorTime = time;
         if (GameController.lastSendErrors.length > 5) {
             GameController.lastSendErrors = GameController.lastSendErrors.slice(GameController.lastSendErrors.length - 5);
-        }   
+        }
 
         // 拼接服务类型(0测试服 1测试服)和 玩家uin 
-        let uin =  HttpCommand.serverType + ":" + CommonData.uin;
+        let uin = HttpCommand.serverType + ":" + CommonData.uin;
         // 项目标签,尽量短
         let gamename = 'tower';
 
         let senddata = {
             "level": "error",
             "game": gamename + ":" + uin,
-            "message":d
+            "message": d
         };
 
         const httpRequest = new XMLHttpRequest();
@@ -331,7 +337,7 @@ class GameController {
 
         let str = JSON.stringify(senddata);
         str = Utils.RSAEncrypt(str);
-        
+
         httpRequest.send(str);
     }
 }

+ 0 - 7
tower_sanguo/assets/scripts/module/loading/LoadingNode.ts

@@ -28,12 +28,5 @@ export default class LoadingNode extends cc.Component {
 		this.lbl_loading = this.node_bg.getChildByName("lbl_loading");
 		this.node_chuan = this.node_bg.getChildByName("node_chuan");
 		this.img_chuan = this.node_chuan.getChildByName("img_chuan");
-		this.btn_share = this.Loading.getChildByName("btn_share");
-		this.bg_share = this.btn_share.getChildByName("bg_share");
-		this.lbl_share = this.bg_share.getChildByName("lbl_share");
-		this.btn_open = this.Loading.getChildByName("btn_open");
-		this.bg_open = this.btn_open.getChildByName("bg_open");
-		this.lbl_open = this.bg_open.getChildByName("lbl_open");
-
     }
 }

+ 54 - 45
tower_sanguo/assets/scripts/module/loading/LoadingUI.ts

@@ -1,45 +1,54 @@
-import BaseUI from "../../../MOKA/component/BaseUI";
-import GameController from "../../GameController";
-import LoadingNode from "./LoadingNode";
-
-const { ccclass, menu, property } = cc._decorator;
-
-@ccclass
-export default class LoadingUI extends BaseUI {
-
-    ui: LoadingNode = null;
-
-    protected static prefabUrl = "module/loading/loading";
-    protected static className = "LoadingUI";
-
-    onLoad() {
-        this.ui = this.node.addComponent(LoadingNode);
-    }
-
-    clickShare() {
-        GameController.sdkM.shareAppMessage();
-    }
-
-    clickOpen() {
-        GameController.sdkM.openCommendApp(0);
-    }
-
-    start() {
-
-    }
-
-    setProgress(percent: number) {
-        this.ui.node_chuan.getComponent(cc.Sprite).fillRange = percent;
-        let x = this.ui.node_chuan.width * percent;
-        this.ui.img_chuan.setPosition(x, this.ui.img_chuan.y);
-        this.setLoadingStr("加载不耗流量 " + (percent * 100) + "%");
-    }
-
-    setLoadingStr(str){
-        this.ui.lbl_loading.getComponent(cc.Label).string = str;
-    }
-
-    setTips(str) {
-        this.ui.lbl_tips.getComponent(cc.Label).string = str;
-    }
-}
+import BaseUI from "../../../MOKA/component/BaseUI";
+import GameController from "../../GameController";
+import LoadingNode from "./LoadingNode";
+
+const { ccclass, menu, property } = cc._decorator;
+
+@ccclass
+export default class LoadingUI extends BaseUI {
+
+    ui: LoadingNode = null;
+
+    protected static prefabUrl = "module/loading/loading";
+    protected static className = "LoadingUI";
+
+    @property(cc.EditBox)
+    lbl_usename: cc.EditBox = null;
+    @property(cc.Button)
+    btn_login: cc.Button = null;
+
+    onLoad() {
+        this.ui = this.node.addComponent(LoadingNode);
+        let mac = GameController.storageData.getStorage("testmac", 1);
+        this.lbl_usename.string = mac == null ? "c9:65:e2:1c:b0:23" : mac;
+    }
+
+    disPlayloginBtn() {
+        this.btn_login.node.active = true;
+    }
+
+    clickLogin() {
+        GameController.http.mac = this.lbl_usename.string;
+        GameController.storageData.setStorage("testmac", GameController.http.mac, 1);
+        GameController.login();
+    }
+
+    start() {
+
+    }
+
+    setProgress(percent: number) {
+        this.ui.node_chuan.getComponent(cc.Sprite).fillRange = percent;
+        let x = this.ui.node_chuan.width * percent;
+        this.ui.img_chuan.setPosition(x, this.ui.img_chuan.y);
+        this.setLoadingStr("加载不耗流量 " + (percent * 100) + "%");
+    }
+
+    setLoadingStr(str) {
+        this.ui.lbl_loading.getComponent(cc.Label).string = str;
+    }
+
+    setTips(str) {
+        this.ui.lbl_tips.getComponent(cc.Label).string = str;
+    }
+}

+ 2 - 1
tower_sanguo/assets/scripts/net/HttpCommand.ts

@@ -50,10 +50,11 @@ export default class HttpCommand {
         this.sendRequest(HTTPTYPE.connect, 'POST', JSON.stringify(data), callback);
     }
 
+    mac:string = 'c9:65:e2:1c:b0:23,f6:60:e4:1a:b7:27';
     connectTest(callback) {
         GameController.commonData.ranKey = Utils.randomString()
         let data = {
-            "mac": "c9:65:e2:1c:b0:23,f6:60:e4:1a:b7:27",
+            "mac": this.mac,
             "psk": GameController.commonData.ranKey,
             "appId": GameController.commonData.appid
         }