|
@@ -50,6 +50,7 @@
|
|
|
let CHANGE_SECRETARY = "CHANGE_SECRETARY";
|
|
|
let POWER_CHANGE = "POWER_CHANGE";
|
|
|
let POWER_TIME = "POWER_TIME";
|
|
|
+ let keyForLoginInfo = "userInfo";
|
|
|
let baseHeadUrl = "https://mygame1.tangro.cn/headimg/";
|
|
|
let poolKey = {
|
|
|
inHoleEft: "inHoleEft",
|
|
@@ -148,6 +149,7 @@
|
|
|
CHANGE_SECRETARY: CHANGE_SECRETARY,
|
|
|
POWER_CHANGE: POWER_CHANGE,
|
|
|
POWER_TIME: POWER_TIME,
|
|
|
+ keyForLoginInfo: keyForLoginInfo,
|
|
|
baseHeadUrl: baseHeadUrl,
|
|
|
poolKey: poolKey,
|
|
|
get GameMode () { return GameMode; },
|
|
@@ -870,7 +872,7 @@
|
|
|
}
|
|
|
}
|
|
|
sendPost2025(reqUrl, data, call) {
|
|
|
- let isDev = false;
|
|
|
+ let isDev = true;
|
|
|
let urlTop = "https://api.kessongame.site/";
|
|
|
let urlMid = urlTop + "prod-api/api/game/";
|
|
|
if (isDev) {
|
|
@@ -880,7 +882,7 @@
|
|
|
let url = urlMid + reqUrl;
|
|
|
if (reqUrl == "registerForApp" || reqUrl == "loginForApp") {
|
|
|
if (isDev) {
|
|
|
- url = urlMid + reqUrl;
|
|
|
+ url = urlTop + reqUrl;
|
|
|
}
|
|
|
else {
|
|
|
url = urlTop + "prod-api/" + reqUrl;
|
|
@@ -893,7 +895,7 @@
|
|
|
httpObj.send(url, data, 'post', 'text', ["Content-Type", "application/json; charset=UTF-8"]);
|
|
|
function errorHandler(error) {
|
|
|
if (call) {
|
|
|
- call("{'msg':'网络错误','code':500}");
|
|
|
+ call("{'msg':'Network exception','code':500}");
|
|
|
}
|
|
|
else {
|
|
|
alert("Tip:Please check your network connection.");
|
|
@@ -4372,6 +4374,9 @@
|
|
|
this.talkNode = (this.getChild("talkNode"));
|
|
|
this.n83 = (this.getChild("n83"));
|
|
|
this.n84 = (this.getChild("n84"));
|
|
|
+ this.n_Logout = (this.getChild("n_Logout"));
|
|
|
+ this.n_zhuCe = (this.getChild("n_zhuCe"));
|
|
|
+ this.n_dengLu = (this.getChild("n_dengLu"));
|
|
|
}
|
|
|
}
|
|
|
ui_UIMain.URL = "ui://isxx5ak7kt443qc";
|
|
@@ -6521,6 +6526,196 @@
|
|
|
}
|
|
|
UIModeSelection.uiName = "UIModeSelection";
|
|
|
|
|
|
+ class ui_UIReg extends fgui.GComponent {
|
|
|
+ static createInstance() {
|
|
|
+ return (fgui.UIPackage.createObject("game", "UIReg"));
|
|
|
+ }
|
|
|
+ onConstruct() {
|
|
|
+ this.n38 = (this.getChild("n38"));
|
|
|
+ this.n9 = (this.getChild("n9"));
|
|
|
+ this.btn_reg = (this.getChild("btn_reg"));
|
|
|
+ this.n14 = (this.getChild("n14"));
|
|
|
+ this.n15 = (this.getChild("n15"));
|
|
|
+ this.n34 = (this.getChild("n34"));
|
|
|
+ this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
|
|
|
+ this.closeBtn = (this.getChild("closeBtn"));
|
|
|
+ this.n39 = (this.getChild("n39"));
|
|
|
+ this.n40 = (this.getChild("n40"));
|
|
|
+ this.txt_ua = (this.getChild("txt_ua"));
|
|
|
+ this.n41 = (this.getChild("n41"));
|
|
|
+ this.txt_up1 = (this.getChild("txt_up1"));
|
|
|
+ this.n42 = (this.getChild("n42"));
|
|
|
+ this.txt_up2 = (this.getChild("txt_up2"));
|
|
|
+ this.lab_tip = (this.getChild("lab_tip"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ui_UIReg.URL = "ui://isxx5ak7bobav57v";
|
|
|
+
|
|
|
+ class ui_UILogin extends fgui.GComponent {
|
|
|
+ static createInstance() {
|
|
|
+ return (fgui.UIPackage.createObject("game", "UILogin"));
|
|
|
+ }
|
|
|
+ onConstruct() {
|
|
|
+ this.n18 = (this.getChild("n18"));
|
|
|
+ this.n7 = (this.getChild("n7"));
|
|
|
+ this.btn_login = (this.getChild("btn_login"));
|
|
|
+ this.n5 = (this.getChild("n5"));
|
|
|
+ this.n6 = (this.getChild("n6"));
|
|
|
+ this.btn_gotoReg = (this.getChild("btn_gotoReg"));
|
|
|
+ this.lab_tip = (this.getChild("lab_tip"));
|
|
|
+ this.closeBtn = (this.getChild("closeBtn"));
|
|
|
+ this.n25 = (this.getChild("n25"));
|
|
|
+ this.txt_ua = (this.getChild("txt_ua"));
|
|
|
+ this.n27 = (this.getChild("n27"));
|
|
|
+ this.txt_up = (this.getChild("txt_up"));
|
|
|
+ this.n29 = (this.getChild("n29"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ui_UILogin.URL = "ui://isxx5ak7bobav57u";
|
|
|
+
|
|
|
+ class UILogin extends UIBase {
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ }
|
|
|
+ onConstructor() {
|
|
|
+ this.ui = ui_UILogin.createInstance();
|
|
|
+ this.contentPane = this.ui;
|
|
|
+ this.isEject = false;
|
|
|
+ this.addUIClick(this.ui.closeBtn, this.closeSelf);
|
|
|
+ this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
|
|
|
+ this.addUIClick(this.ui.btn_login, this.userLogin);
|
|
|
+ }
|
|
|
+ show() {
|
|
|
+ super.show();
|
|
|
+ this.x = (Laya.stage.width - this.width) / 2;
|
|
|
+ this.y = (Laya.stage.height - this.height) / 2;
|
|
|
+ }
|
|
|
+ closeSelf() {
|
|
|
+ this.hide();
|
|
|
+ }
|
|
|
+ userLogin() {
|
|
|
+ this.ui.lab_tip.visible = false;
|
|
|
+ let ua = this.ui.txt_ua.text;
|
|
|
+ let up = this.ui.txt_up.text;
|
|
|
+ if (ua && up) {
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Request in progress..");
|
|
|
+ let reqData = JSON.stringify({
|
|
|
+ username: ua.trim(),
|
|
|
+ password: up.trim(),
|
|
|
+ fromMark: 'app_game'
|
|
|
+ });
|
|
|
+ xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
|
|
|
+ try {
|
|
|
+ this.ui.lab_tip.visible = true;
|
|
|
+ console.log('zh:res = ' + JSON.stringify(res));
|
|
|
+ let code = res.code;
|
|
|
+ let msg = res.msg;
|
|
|
+ this.ui.lab_tip.text = msg;
|
|
|
+ xGame.uiMgr.Show(UIMsg, msg);
|
|
|
+ if (code == 200) {
|
|
|
+ let keyStr = 'userInfo';
|
|
|
+ let jsonStr = {
|
|
|
+ "username": res.username,
|
|
|
+ "token": res.token
|
|
|
+ };
|
|
|
+ LocalStorageManager.setItem(keyStr, jsonStr);
|
|
|
+ this.ui.lab_tip.color = "#FFFFFF";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.lab_tip.color = "#FF0000";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (error) {
|
|
|
+ console.log('error=' + error);
|
|
|
+ alert(error);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Missing information!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoRegPage() {
|
|
|
+ this.closeSelf();
|
|
|
+ xGame.uiMgr.Show(UIReg);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ UILogin.uiName = "UILogin";
|
|
|
+
|
|
|
+ class UIReg extends UIBase {
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ }
|
|
|
+ onConstructor() {
|
|
|
+ this.ui = ui_UIReg.createInstance();
|
|
|
+ this.contentPane = this.ui;
|
|
|
+ this.isEject = false;
|
|
|
+ this.addUIClick(this.ui.closeBtn, this.closeSelf);
|
|
|
+ this.addUIClick(this.ui.btn_reg, this.regUser);
|
|
|
+ this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
|
|
|
+ }
|
|
|
+ show() {
|
|
|
+ super.show();
|
|
|
+ this.x = (Laya.stage.width - this.width) / 2;
|
|
|
+ this.y = (Laya.stage.height - this.height) / 2;
|
|
|
+ }
|
|
|
+ closeSelf() {
|
|
|
+ this.hide();
|
|
|
+ }
|
|
|
+ regUser() {
|
|
|
+ this.ui.lab_tip.visible = false;
|
|
|
+ let ua = this.ui.txt_ua.text;
|
|
|
+ let up1 = this.ui.txt_up1.text;
|
|
|
+ let up2 = this.ui.txt_up2.text;
|
|
|
+ if (ua && up1 && up2 && up1 == up2) {
|
|
|
+ this.ui.closeBtn.visible = false;
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Request in progress..");
|
|
|
+ let reqData = JSON.stringify({
|
|
|
+ username: ua.trim(),
|
|
|
+ password: up1.trim(),
|
|
|
+ fromMark: 'app_game'
|
|
|
+ });
|
|
|
+ xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
|
|
|
+ try {
|
|
|
+ this.ui.lab_tip.visible = true;
|
|
|
+ console.log('zh:res = ' + JSON.stringify(res));
|
|
|
+ let code = res.code;
|
|
|
+ let msg = res.msg;
|
|
|
+ this.ui.lab_tip.text = msg;
|
|
|
+ xGame.uiMgr.Show(UIMsg, msg);
|
|
|
+ if (code == 200) {
|
|
|
+ this.ui.lab_tip.color = "#FFFFFF";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.lab_tip.color = "#FF0000";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (error) {
|
|
|
+ console.log('error=' + error);
|
|
|
+ alert(error);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (up1 != up2) {
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Password mismatch!");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ xGame.uiMgr.Show(UIMsg, "Missing information!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoLogin() {
|
|
|
+ this.closeSelf();
|
|
|
+ xGame.uiMgr.Show(UILogin);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ UIReg.uiName = "UIReg";
|
|
|
+
|
|
|
class ui_UIGetAward extends fgui.GComponent {
|
|
|
static createInstance() {
|
|
|
return (fgui.UIPackage.createObject("game", "UIGetAward"));
|
|
@@ -6826,9 +7021,39 @@
|
|
|
xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
|
|
|
console.log("zh:播放小秘书每天语音");
|
|
|
}
|
|
|
+ this.onGetUserInfo();
|
|
|
this.ui.n83.visible = false;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ const d = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
+ let ua = d.username;
|
|
|
+ this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
|
|
|
+ }
|
|
|
+ this.c_btn_for_user();
|
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
|
}
|
|
|
+ Logout() {
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ LocalStorageManager.removeItem(keyForLoginInfo);
|
|
|
+ this.freshUser();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoLogin() {
|
|
|
+ xGame.uiMgr.Show(UILogin);
|
|
|
+ }
|
|
|
+ gotoRegUser() {
|
|
|
+ xGame.uiMgr.Show(UIReg);
|
|
|
+ }
|
|
|
+ c_btn_for_user() {
|
|
|
+ this.ui.n_Logout.visible = false;
|
|
|
+ this.ui.n_dengLu.visible = false;
|
|
|
+ this.ui.n_zhuCe.visible = false;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ this.ui.n_Logout.visible = true;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.n_dengLu.visible = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
changeSecretary(curUse) {
|
|
|
let name = cfgTable.secretaryshopData[curUse + 1].spine;
|
|
|
xGame.common.secretary && xGame.common.secretary.dispose();
|
|
@@ -6866,6 +7091,9 @@
|
|
|
this.addUIClick(this.ui.signBtn, this.openSignView);
|
|
|
this.addUIClick(this.ui.drawBtn, this.openDrawView);
|
|
|
this.addUIClick(this.ui.rankBtn, this.openRanking);
|
|
|
+ this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
|
+ this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
|
+ this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
|
}
|
|
|
show(showFailWords) {
|
|
|
super.show();
|
|
@@ -7067,22 +7295,27 @@
|
|
|
else {
|
|
|
Moyu.initUser(this, this.freshUser, force);
|
|
|
}
|
|
|
- if (!Moyu.hasUserInfo) {
|
|
|
- let user = Moyu.getUserInfo();
|
|
|
- user.headIcon = 'res/ty_touxiang.png';
|
|
|
- }
|
|
|
this.freshUser();
|
|
|
- console.log('zh: 进reg');
|
|
|
}
|
|
|
freshUser() {
|
|
|
let user = Moyu.getUserInfo();
|
|
|
if (!user.isAuth) {
|
|
|
user.headIcon = 'res/ty_touxiang.png';
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
DataMgr.upRankData();
|
|
|
+ }
|
|
|
this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
|
|
|
xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
|
|
|
+ let keyStr = keyForLoginInfo;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyStr)) {
|
|
|
+ const d = LocalStorageManager.getItem(keyStr);
|
|
|
+ let ua = d.username;
|
|
|
+ this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ }
|
|
|
+ this.c_btn_for_user();
|
|
|
}
|
|
|
interuptSecretary() {
|
|
|
Laya.timer.clearAll(this);
|
|
@@ -12235,51 +12468,6 @@
|
|
|
}
|
|
|
ui_SignNormal.URL = "ui://isxx5ak7bf9jv4jv";
|
|
|
|
|
|
- class ui_UILogin extends fgui.GComponent {
|
|
|
- static createInstance() {
|
|
|
- return (fgui.UIPackage.createObject("game", "UILogin"));
|
|
|
- }
|
|
|
- onConstruct() {
|
|
|
- this.n7 = (this.getChild("n7"));
|
|
|
- this.n0 = (this.getChild("n0"));
|
|
|
- this.btn_login = (this.getChild("btn_login"));
|
|
|
- this.closeBtn = (this.getChild("closeBtn"));
|
|
|
- this.n5 = (this.getChild("n5"));
|
|
|
- this.n6 = (this.getChild("n6"));
|
|
|
- this.n10 = (this.getChild("n10"));
|
|
|
- this.n12 = (this.getChild("n12"));
|
|
|
- this.btn_gotoReg = (this.getChild("btn_gotoReg"));
|
|
|
- this.lab_tip = (this.getChild("lab_tip"));
|
|
|
- this.txt_ua = (this.getChild("txt_ua"));
|
|
|
- this.txt_up = (this.getChild("txt_up"));
|
|
|
- }
|
|
|
- }
|
|
|
- ui_UILogin.URL = "ui://isxx5ak7bobav57u";
|
|
|
-
|
|
|
- class ui_UIReg extends fgui.GComponent {
|
|
|
- static createInstance() {
|
|
|
- return (fgui.UIPackage.createObject("game", "UIReg"));
|
|
|
- }
|
|
|
- onConstruct() {
|
|
|
- this.n9 = (this.getChild("n9"));
|
|
|
- this.closeBtn = (this.getChild("closeBtn"));
|
|
|
- this.btn_reg = (this.getChild("btn_reg"));
|
|
|
- this.n14 = (this.getChild("n14"));
|
|
|
- this.n15 = (this.getChild("n15"));
|
|
|
- this.n27 = (this.getChild("n27"));
|
|
|
- this.n26 = (this.getChild("n26"));
|
|
|
- this.txt_ua = (this.getChild("txt_ua"));
|
|
|
- this.n29 = (this.getChild("n29"));
|
|
|
- this.txt_up1 = (this.getChild("txt_up1"));
|
|
|
- this.n32 = (this.getChild("n32"));
|
|
|
- this.txt_up2 = (this.getChild("txt_up2"));
|
|
|
- this.n34 = (this.getChild("n34"));
|
|
|
- this.lab_tip = (this.getChild("lab_tip"));
|
|
|
- this.btn_gotoLogin = (this.getChild("btn_gotoLogin"));
|
|
|
- }
|
|
|
- }
|
|
|
- ui_UIReg.URL = "ui://isxx5ak7bobav57v";
|
|
|
-
|
|
|
class ui_Button_reg extends fgui.GButton {
|
|
|
static createInstance() {
|
|
|
return (fgui.UIPackage.createObject("game", "Button_reg"));
|
|
@@ -13079,16 +13267,6 @@
|
|
|
}
|
|
|
ui_Component63.URL = "ui://isxx5ak7h657452";
|
|
|
|
|
|
- class ui_Component_close extends fgui.GComponent {
|
|
|
- static createInstance() {
|
|
|
- return (fgui.UIPackage.createObject("game", "Component_close"));
|
|
|
- }
|
|
|
- onConstruct() {
|
|
|
- this.n5 = (this.getChild("n5"));
|
|
|
- }
|
|
|
- }
|
|
|
- ui_Component_close.URL = "ui://isxx5ak7hgftv580";
|
|
|
-
|
|
|
class ui_topNode extends fgui.GComponent {
|
|
|
static createInstance() {
|
|
|
return (fgui.UIPackage.createObject("game", "topNode"));
|
|
@@ -14605,6 +14783,17 @@
|
|
|
}
|
|
|
ui_ranking_com13.URL = "ui://isxx5ak7p7rrv4qa";
|
|
|
|
|
|
+ class ui_Component_dl_zc extends fgui.GButton {
|
|
|
+ static createInstance() {
|
|
|
+ return (fgui.UIPackage.createObject("game", "Component_dl_zc"));
|
|
|
+ }
|
|
|
+ onConstruct() {
|
|
|
+ this.c1 = this.getController("c1");
|
|
|
+ this.n0 = (this.getChild("n0"));
|
|
|
+ }
|
|
|
+ }
|
|
|
+ ui_Component_dl_zc.URL = "ui://isxx5ak7p8p3v58c";
|
|
|
+
|
|
|
class ui_Component122 extends fgui.GComponent {
|
|
|
static createInstance() {
|
|
|
return (fgui.UIPackage.createObject("game", "Component122"));
|
|
@@ -15700,7 +15889,6 @@
|
|
|
fgui.UIObjectFactory.setExtension(ui_RulerNode.URL, ui_RulerNode);
|
|
|
fgui.UIObjectFactory.setExtension(ui_Component108.URL, ui_Component108);
|
|
|
fgui.UIObjectFactory.setExtension(ui_Component63.URL, ui_Component63);
|
|
|
- fgui.UIObjectFactory.setExtension(ui_Component_close.URL, ui_Component_close);
|
|
|
fgui.UIObjectFactory.setExtension(ui_UIMsg.URL, ui_UIMsg);
|
|
|
fgui.UIObjectFactory.setExtension(ui_topNode.URL, ui_topNode);
|
|
|
fgui.UIObjectFactory.setExtension(ui_selfProgress.URL, ui_selfProgress);
|
|
@@ -15826,6 +16014,7 @@
|
|
|
fgui.UIObjectFactory.setExtension(ui_ranking_com10.URL, ui_ranking_com10);
|
|
|
fgui.UIObjectFactory.setExtension(ui_ranking_com11.URL, ui_ranking_com11);
|
|
|
fgui.UIObjectFactory.setExtension(ui_ranking_com13.URL, ui_ranking_com13);
|
|
|
+ fgui.UIObjectFactory.setExtension(ui_Component_dl_zc.URL, ui_Component_dl_zc);
|
|
|
fgui.UIObjectFactory.setExtension(ui_Component122.URL, ui_Component122);
|
|
|
fgui.UIObjectFactory.setExtension(ui_skillItem.URL, ui_skillItem);
|
|
|
fgui.UIObjectFactory.setExtension(ui_Component26.URL, ui_Component26);
|
|
@@ -22312,6 +22501,149 @@
|
|
|
}
|
|
|
UIModeSelection$1.uiName = "UIModeSelection";
|
|
|
|
|
|
+ class UILogin$1 extends UIBase {
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ }
|
|
|
+ onConstructor() {
|
|
|
+ this.ui = ui_UILogin.createInstance();
|
|
|
+ this.contentPane = this.ui;
|
|
|
+ this.isEject = false;
|
|
|
+ this.addUIClick(this.ui.closeBtn, this.closeSelf);
|
|
|
+ this.addUIClick(this.ui.btn_gotoReg, this.gotoRegPage);
|
|
|
+ this.addUIClick(this.ui.btn_login, this.userLogin);
|
|
|
+ }
|
|
|
+ show() {
|
|
|
+ super.show();
|
|
|
+ this.x = (Laya.stage.width - this.width) / 2;
|
|
|
+ this.y = (Laya.stage.height - this.height) / 2;
|
|
|
+ }
|
|
|
+ closeSelf() {
|
|
|
+ this.hide();
|
|
|
+ }
|
|
|
+ userLogin() {
|
|
|
+ this.ui.lab_tip.visible = false;
|
|
|
+ let ua = this.ui.txt_ua.text;
|
|
|
+ let up = this.ui.txt_up.text;
|
|
|
+ if (ua && up) {
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
|
|
|
+ let reqData = JSON.stringify({
|
|
|
+ username: ua.trim(),
|
|
|
+ password: up.trim(),
|
|
|
+ fromMark: 'app_game'
|
|
|
+ });
|
|
|
+ xGame.httpMgr.sendPost2025('loginForApp', reqData, (res) => {
|
|
|
+ try {
|
|
|
+ this.ui.lab_tip.visible = true;
|
|
|
+ console.log('zh:res = ' + JSON.stringify(res));
|
|
|
+ let code = res.code;
|
|
|
+ let msg = res.msg;
|
|
|
+ this.ui.lab_tip.text = msg;
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, msg);
|
|
|
+ if (code == 200) {
|
|
|
+ let keyStr = 'userInfo';
|
|
|
+ let jsonStr = {
|
|
|
+ "username": res.username,
|
|
|
+ "token": res.token
|
|
|
+ };
|
|
|
+ LocalStorageManager.setItem(keyStr, jsonStr);
|
|
|
+ this.ui.lab_tip.color = "#FFFFFF";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.lab_tip.color = "#FF0000";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (error) {
|
|
|
+ console.log('error=' + error);
|
|
|
+ alert(error);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Missing information!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoRegPage() {
|
|
|
+ this.closeSelf();
|
|
|
+ xGame.uiMgr.Show(UIReg$1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ UILogin$1.uiName = "UILogin";
|
|
|
+
|
|
|
+ class UIReg$1 extends UIBase {
|
|
|
+ constructor() {
|
|
|
+ super();
|
|
|
+ }
|
|
|
+ onConstructor() {
|
|
|
+ this.ui = ui_UIReg.createInstance();
|
|
|
+ this.contentPane = this.ui;
|
|
|
+ this.isEject = false;
|
|
|
+ this.addUIClick(this.ui.closeBtn, this.closeSelf);
|
|
|
+ this.addUIClick(this.ui.btn_reg, this.regUser);
|
|
|
+ this.addUIClick(this.ui.btn_gotoLogin, this.gotoLogin);
|
|
|
+ }
|
|
|
+ show() {
|
|
|
+ super.show();
|
|
|
+ this.x = (Laya.stage.width - this.width) / 2;
|
|
|
+ this.y = (Laya.stage.height - this.height) / 2;
|
|
|
+ }
|
|
|
+ closeSelf() {
|
|
|
+ this.hide();
|
|
|
+ }
|
|
|
+ regUser() {
|
|
|
+ this.ui.lab_tip.visible = false;
|
|
|
+ let ua = this.ui.txt_ua.text;
|
|
|
+ let up1 = this.ui.txt_up1.text;
|
|
|
+ let up2 = this.ui.txt_up2.text;
|
|
|
+ if (ua && up1 && up2 && up1 == up2) {
|
|
|
+ this.ui.closeBtn.visible = false;
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Request in progress..");
|
|
|
+ let reqData = JSON.stringify({
|
|
|
+ username: ua.trim(),
|
|
|
+ password: up1.trim(),
|
|
|
+ fromMark: 'app_game'
|
|
|
+ });
|
|
|
+ xGame.httpMgr.sendPost2025('registerForApp', reqData, (res) => {
|
|
|
+ try {
|
|
|
+ this.ui.lab_tip.visible = true;
|
|
|
+ console.log('zh:res = ' + JSON.stringify(res));
|
|
|
+ let code = res.code;
|
|
|
+ let msg = res.msg;
|
|
|
+ this.ui.lab_tip.text = msg;
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, msg);
|
|
|
+ if (code == 200) {
|
|
|
+ this.ui.lab_tip.color = "#FFFFFF";
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.lab_tip.color = "#FF0000";
|
|
|
+ }
|
|
|
+ }
|
|
|
+ catch (error) {
|
|
|
+ console.log('error=' + error);
|
|
|
+ alert(error);
|
|
|
+ }
|
|
|
+ finally {
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ if (up1 != up2) {
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Password mismatch!");
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ xGame.uiMgr.Show(UIMsg$1, "Missing information!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoLogin() {
|
|
|
+ this.closeSelf();
|
|
|
+ xGame.uiMgr.Show(UILogin$1);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ UIReg$1.uiName = "UIReg";
|
|
|
+
|
|
|
class UITry$1 extends UIBase {
|
|
|
constructor() {
|
|
|
super();
|
|
@@ -22696,9 +23028,39 @@
|
|
|
xGame.common.showGirlTalkPop(1, this.ui.talkNode, this.ui.talkNode.womanTxt);
|
|
|
console.log("zh:播放小秘书每天语音");
|
|
|
}
|
|
|
+ this.onGetUserInfo();
|
|
|
this.ui.n83.visible = false;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ const d = LocalStorageManager.getItem(keyForLoginInfo);
|
|
|
+ let ua = d.username;
|
|
|
+ this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
|
|
|
+ }
|
|
|
+ this.c_btn_for_user();
|
|
|
window['nativeCallJs'] = this.nativeCallJs.bind(this);
|
|
|
}
|
|
|
+ Logout() {
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ LocalStorageManager.removeItem(keyForLoginInfo);
|
|
|
+ this.freshUser();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ gotoLogin() {
|
|
|
+ xGame.uiMgr.Show(UILogin$1);
|
|
|
+ }
|
|
|
+ gotoRegUser() {
|
|
|
+ xGame.uiMgr.Show(UIReg$1);
|
|
|
+ }
|
|
|
+ c_btn_for_user() {
|
|
|
+ this.ui.n_Logout.visible = false;
|
|
|
+ this.ui.n_dengLu.visible = false;
|
|
|
+ this.ui.n_zhuCe.visible = false;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyForLoginInfo)) {
|
|
|
+ this.ui.n_Logout.visible = true;
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ this.ui.n_dengLu.visible = true;
|
|
|
+ }
|
|
|
+ }
|
|
|
changeSecretary(curUse) {
|
|
|
let name = cfgTable.secretaryshopData[curUse + 1].spine;
|
|
|
xGame.common.secretary && xGame.common.secretary.dispose();
|
|
@@ -22736,6 +23098,9 @@
|
|
|
this.addUIClick(this.ui.signBtn, this.openSignView);
|
|
|
this.addUIClick(this.ui.drawBtn, this.openDrawView);
|
|
|
this.addUIClick(this.ui.rankBtn, this.openRanking);
|
|
|
+ this.addUIClick(this.ui.n_Logout, this.Logout);
|
|
|
+ this.addUIClick(this.ui.n_dengLu, this.gotoLogin);
|
|
|
+ this.addUIClick(this.ui.n_zhuCe, this.gotoRegUser);
|
|
|
}
|
|
|
show(showFailWords) {
|
|
|
super.show();
|
|
@@ -22937,22 +23302,27 @@
|
|
|
else {
|
|
|
Moyu.initUser(this, this.freshUser, force);
|
|
|
}
|
|
|
- if (!Moyu.hasUserInfo) {
|
|
|
- let user = Moyu.getUserInfo();
|
|
|
- user.headIcon = 'res/ty_touxiang.png';
|
|
|
- }
|
|
|
this.freshUser();
|
|
|
- console.log('zh: 进reg');
|
|
|
}
|
|
|
freshUser() {
|
|
|
let user = Moyu.getUserInfo();
|
|
|
if (!user.isAuth) {
|
|
|
user.headIcon = 'res/ty_touxiang.png';
|
|
|
}
|
|
|
- else
|
|
|
+ else {
|
|
|
DataMgr.upRankData();
|
|
|
+ }
|
|
|
this.ui.headNode.nameTxt.text = xGame.tools.reviseString(user.nickName, 16);
|
|
|
xGame.common.createHead(this.ui.headNode.headRoot.headImg, user.headIcon);
|
|
|
+ let keyStr = keyForLoginInfo;
|
|
|
+ if (LocalStorageManager.hasJosnKey(keyStr)) {
|
|
|
+ const d = LocalStorageManager.getItem(keyStr);
|
|
|
+ let ua = d.username;
|
|
|
+ this.ui.headNode.nameTxt.text = xGame.tools.reviseString(ua, 16);
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ }
|
|
|
+ this.c_btn_for_user();
|
|
|
}
|
|
|
interuptSecretary() {
|
|
|
Laya.timer.clearAll(this);
|