diff --git a/.DS_Store b/.DS_Store index 5841d7e..cccfad6 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/Websocket/assets/Scene/Websocket.fire b/Websocket/assets/Scene/Websocket.fire index 7c1190c..8ddee83 100644 --- a/Websocket/assets/Scene/Websocket.fire +++ b/Websocket/assets/Scene/Websocket.fire @@ -72,10 +72,10 @@ "_active": true, "_components": [ { - "__id__": 15 + "__id__": 16 }, { - "__id__": 16 + "__id__": 17 } ], "_prefab": null, @@ -376,7 +376,7 @@ }, { "__type__": "cc.Node", - "_name": "close", + "_name": "btn_close", "_objFlags": 0, "_parent": { "__id__": 2 @@ -558,7 +558,11 @@ }, "duration": 0.1, "zoomScale": 1.2, - "clickEvents": [], + "clickEvents": [ + { + "__id__": 15 + } + ], "_N$interactable": true, "_N$enableAutoGrayEffect": false, "_N$normalColor": { @@ -597,6 +601,15 @@ "__id__": 10 } }, + { + "__type__": "cc.ClickEvent", + "target": { + "__id__": 2 + }, + "component": "HelloWorld", + "handler": "", + "customEventData": "" + }, { "__type__": "cc.Canvas", "_name": "", diff --git a/Websocket/settings/builder.json b/Websocket/settings/builder.json index 09f915c..6222461 100644 --- a/Websocket/settings/builder.json +++ b/Websocket/settings/builder.json @@ -1,5 +1,18 @@ { + "appKey": "", + "appSecret": "", + "encryptJs": true, "excludeScenes": [], + "fb-instant-games": {}, + "includeAnySDK": false, + "includeSDKBox": false, + "inlineSpriteFrames": true, + "inlineSpriteFrames_native": true, + "jailbreakPlatform": false, + "md5Cache": false, + "mergeStartScene": false, + "oauthLoginServer": "", + "optimizeHotUpdate": false, "orientation": { "landscapeLeft": true, "landscapeRight": true, @@ -7,7 +20,22 @@ "upsideDown": false }, "packageName": "org.cocos2d.helloworld", + "privateKey": "", + "qqplay": { + "REMOTE_SERVER_ROOT": "", + "orientation": "portrait" + }, + "renderMode": "0", "startScene": "2d2f792f-a40c-49bb-a189-ed176a246e49", - "title": "hello_world", - "webOrientation": "auto" + "title": "hello_Ios", + "webOrientation": "auto", + "wechatgame": { + "REMOTE_SERVER_ROOT": "", + "appid": "wx6ac3f5090a6b99c5", + "isSubdomain": false, + "orientation": "portrait", + "subContext": "" + }, + "xxteaKey": "8d905e07-1e49-42", + "zipCompressJs": true } \ No newline at end of file diff --git a/WechatGame_login/assets/Scene/Login.fire b/WechatGame_login/assets/Scene/Login.fire index f2ff488..01d60b1 100644 --- a/WechatGame_login/assets/Scene/Login.fire +++ b/WechatGame_login/assets/Scene/Login.fire @@ -336,7 +336,7 @@ }, "_contentSize": { "__type__": "cc.Size", - "width": 146.81, + "width": 147, "height": 60 }, "_rotationX": 0, @@ -390,7 +390,7 @@ } ], "_tag": -1, - "_active": false, + "_active": true, "_components": [ { "__id__": 13 @@ -426,7 +426,7 @@ "_scaleY": 1.2, "_position": { "__type__": "cc.Vec2", - "x": -200, + "x": 0, "y": -449 }, "_skewX": 0, @@ -626,7 +626,7 @@ } ], "_tag": -1, - "_active": true, + "_active": false, "_components": [ { "__id__": 19 @@ -662,7 +662,7 @@ "_scaleY": 1.2, "_position": { "__type__": "cc.Vec2", - "x": 0, + "x": 100, "y": -449 }, "_skewX": 0, @@ -866,17 +866,18 @@ "_fitHeight": false }, { - "__type__": "280c3rsZJJKnZ9RqbALVwtK", + "__type__": "4896an2Du9KerKmdF65r/u1", "_name": "", "_objFlags": 0, "node": { "__id__": 2 }, "_enabled": true, - "_a": 1, - "label": { - "__id__": 9 + "headSprite": { + "__id__": 7 }, - "text": "Hello, World!" + "tipLabel": { + "__id__": 9 + } } ] \ No newline at end of file diff --git a/WechatGame_login/assets/Script/HelloWorld.js b/WechatGame_login/assets/Script/HelloWorld.js deleted file mode 100644 index 627bf09..0000000 --- a/WechatGame_login/assets/Script/HelloWorld.js +++ /dev/null @@ -1,80 +0,0 @@ - -// obj.fn(); -function func(){ - // console.log( this ); // 20 this -> window - // var c=1; - // var b=function(){ - // var b=1; - // console.log(this); - // return 1; - // } - // var c=new b(); - // console.log(c); - // var d=b(); - // console.log(d); - // var f=b; - // console.log(f); - - var obj = { - a: 20, - fn: function() { - console.log( this ); // 20 this -> window - } - } - - obj.fn(); -} - -func(); - - -cc.Class({ - extends: cc.Component, - - properties: { - _a:1, - // _c:this._b+2, - label: { - default: null, - type: cc.Label - }, - - // defaults, set visually when attaching this script to the Canvas - text: 'Hello, World!', - }, - - // use this for initialization - onLoad: function () { - this.label.string = this.text; - var c=2; - var obj = { - a: 20, - c:this, - b: this._a + 10, - fn: function() { - console.log( this ); - console.log(c,this.c); - } - } - func(); - setTimeout(()=> { - var a = 30; - console.log( this ); - }) - - setTimeout(function() { - var a = 30; - console.log( this ); - }) - - obj.fn(); - }, - - - - // called every frame - update: function (dt) { - - }, -}); - diff --git a/WechatGame_login/assets/Script/HelloWorld.js.meta b/WechatGame_login/assets/Script/HelloWorld.js.meta deleted file mode 100644 index bdd969e..0000000 --- a/WechatGame_login/assets/Script/HelloWorld.js.meta +++ /dev/null @@ -1,9 +0,0 @@ -{ - "ver": "1.0.5", - "uuid": "280c3aec-6492-4a9d-9f51-a9b00b570b4a", - "isPlugin": false, - "loadPluginInWeb": true, - "loadPluginInNative": true, - "loadPluginInEditor": false, - "subMetas": {} -} \ No newline at end of file diff --git a/WechatGame_login/assets/Script/Login.js b/WechatGame_login/assets/Script/Login.js index ddf97f5..7122344 100644 --- a/WechatGame_login/assets/Script/Login.js +++ b/WechatGame_login/assets/Script/Login.js @@ -14,15 +14,16 @@ cc.Class({ }, start() { - this.wechatLogin(); + // this.wechatLogin(); }, wechatLogin() { console.log('login'); wx.login({ - success: function () { + success: (event)=> { + console.log('login event=', event); wx.getUserInfo({ - success: function (res) { + success: (res)=> { myGlobal.userInfo = res.userInfo; var userInfo = res.userInfo; var nickName = userInfo.nickName; @@ -32,6 +33,7 @@ cc.Class({ var city = userInfo.city; var country = userInfo.country; console.log(nickName, avatarUrl, gender, province, city, country); + this.onBtn_1(null); } }); }, diff --git a/WechatGame_login/settings/builder.json b/WechatGame_login/settings/builder.json index 5002d13..c3fdb38 100644 --- a/WechatGame_login/settings/builder.json +++ b/WechatGame_login/settings/builder.json @@ -29,5 +29,10 @@ "orientation": "portrait" }, "xxteaKey": "e9e8f007-239d-40", - "zipCompressJs": true + "zipCompressJs": true, + "qqplay": { + "orientation": "portrait", + "REMOTE_SERVER_ROOT": "" + }, + "fb-instant-games": {} } \ No newline at end of file