void LoginLayer2LoginBtn() { if (string.IsNullOrEmpty(loginLayer2.inputMobile.text)) { UITipsDialog.ShowTips("请输入手机号"); return; } if (string.IsNullOrEmpty(loginLayer2.inputPwd.text)) { UITipsDialog.ShowTips("请输入密码"); return; } RequestLogin requestLogin = new RequestLogin(); requestLogin.phone = loginLayer2.inputMobile.text; requestLogin.password = loginLayer2.inputPwd.text; requestLogin.equitment = SystemInfo.deviceUniqueIdentifier; LoginManager.Instance.SendLoginMessage <ResponseLogin>(requestLogin, (responseData) => { if (responseData.status == "200") { Debug.Log("登录成功" + responseData.msg); UITipsDialog.ShowTips("登录成功"); loginCallback(responseData.data); } else { UITipsDialog.ShowTips(responseData.msg); } }); }
/// <summary> /// 退出检测 /// </summary> private void EixtDetection() { if (Input.GetKeyDown(KeyCode.Escape)) //如果按下退出键 { if (CountDown <= 0) //当倒计时时间等于0的时候 { CountDown = Time.time; //把游戏开始时间,赋值给 CountDown IsTiming = true; //开始计时 UITipsDialog.ShowTips("再次点击退出应用"); } else { Application.Quit(); //退出游戏 } } if (IsTiming) //如果 IsTiming 为 true { if ((Time.time - CountDown) > 2.0) //如果 两次点击时间间隔大于2秒 { CountDown = 0; //倒计时时间归零 IsTiming = false; //关闭倒计时 } } }
void RequestLogin(string account, string passwrd) { RequestLightLogin requestLogin = new RequestLightLogin(); requestLogin.loginAccount = account; requestLogin.password = passwrd; LoginManager.Instance.SendLightLoginMessage <ResponseLightLogin>(requestLogin, (responseData) => { if (responseData.status == "200") { UITipsDialog.ShowTips("登录成功"); PlayerPrefs.SetString(GameDataMgr.AccountKey, requestLogin.loginAccount); PlayerPrefs.SetString(GameDataMgr.PassWrdKey, requestLogin.password); ResponseLogin response = new ResponseLogin() { userName = "******", loginAccount = requestLogin.loginAccount }; loginCallback(response); } else { UITipsDialog.ShowTips(responseData.msg); } }); }
void LoginLayer1LoginBtn() { //loginLayer1.inputAccount.text = "10000001"; //loginLayer1.inputPwd.text = "782109"; //loginLayer1.inputAccount.text = "10046698"; //loginLayer1.inputPwd.text = "768412"; //loginLayer1.inputAccount.text = "10000015"; //loginLayer1.inputPwd.text = "530648"; if (string.IsNullOrEmpty(loginLayer1.inputAccount.text)) { UITipsDialog.ShowTips("请输入灯光练习账号"); return; } if (string.IsNullOrEmpty(loginLayer1.inputPwd.text)) { UITipsDialog.ShowTips("请输入灯光练习密码"); return; } RequestLogin(loginLayer1.inputAccount.text, loginLayer1.inputPwd.text); //return; //if (string.IsNullOrEmpty(loginLayer1.inputAccount.text)) //{ // UITipsDialog.ShowTips("请输入理论保过卡卡号"); // return; //} //if (string.IsNullOrEmpty(loginLayer1.inputPwd.text)) //{ // UITipsDialog.ShowTips("请输入理论保过卡密码"); // return; //} //RequestLogin requestLogin = new RequestLogin(); //requestLogin.phone = loginLayer1.inputAccount.text; //requestLogin.password = loginLayer1.inputPwd.text; //requestLogin.equitment = SystemInfo.deviceUniqueIdentifier; //LoginManager.Instance.SendLoginMessage<ResponseLogin>(requestLogin, (responseData) => //{ // if (responseData.status == "200") // { // Debug.Log("登录成功" + responseData.msg); // UITipsDialog.ShowTips("登录成功"); // loginCallback(responseData.data); // } // else // { // UITipsDialog.ShowTips(responseData.msg); // } //}); }
void SignupLayerConfirmBtn() { if (string.IsNullOrEmpty(signupLayer.inputMobile.text)) { UITipsDialog.ShowTips("请输入手机号"); return; } if (string.IsNullOrEmpty(signupLayer.inputAnswer.text)) { UITipsDialog.ShowTips("请输入问题答案"); return; } if (string.IsNullOrEmpty(signupLayer.inputIdentifying.text)) { UITipsDialog.ShowTips("请输入手机验证码"); return; } string pwd1 = signupLayer.inputPwd1.text; string pwd2 = signupLayer.inputPwd2.text; if (string.IsNullOrEmpty(pwd1)) { UITipsDialog.ShowTips("请输入新密码"); return; } if (string.IsNullOrEmpty(pwd2)) { UITipsDialog.ShowTips("请确认新密码"); return; } if (!string.Equals(pwd1, pwd2)) { UITipsDialog.ShowTips("两次密码不一致"); return; } RequestFreeSignup param = new RequestFreeSignup(); param.phone = signupLayer.inputMobile.text; param.code = signupLayer.inputIdentifying.text; param.password = pwd1; param.equitment = SystemInfo.deviceUniqueIdentifier; LoginManager.Instance.SendFreeSingup <ResponseFreeSignup>(param, (responseData) => { if (responseData.status == "200") { UITipsDialog.ShowTips("注册成功"); } else { UITipsDialog.ShowTips(responseData.msg); } }); }
void OnClickShare() { if (ConfigDataMgr.Instance.gameConfig.showShare) { ShareData shareData = ConfigDataMgr.Instance.shareData; GlobalManager.Instance.ShareWebpage(shareData.title, shareData.content, shareData.url, shareData.image); } else { UITipsDialog.ShowTips("此功能暂未开放"); } }
/// <summary> /// Checks the gameConfig update. /// </summary> void CheckConfigUpdate() { //检查配置更新 //string questionUrl = "http://localhost/LightExam/gameConfig.json"; string questionUrl = "http://app.jiakaojingling.com/jkjl/static/dengguang/LightExam/gameConfig.json"; //string questionUrl = "http://loongx.gz01.bdysite.com/LightExam/gameConfig.json"; StartCoroutine(RequestNetworkFile(questionUrl, (result, content, data) => { if (result) { GameVersion gameVersion = LitJson.JsonMapper.ToObject <GameVersion>(content); if (ConfigDataMgr.Instance.gameConfig != null && gameVersion.AppVersion != ConfigDataMgr.Instance.gameConfig.AppVersion) { UIPrompDialog.ShowPromp(UIPrompDialog.PrompType.Confirm, "版本更新", "应用功能版本更新,请退出前往更新?", (confirm) => { if (confirm) { Application.Quit(); } }); } else { GameConfig gameConfig = LitJson.JsonMapper.ToObject <GameConfig>(content); if (ConfigDataMgr.Instance.gameConfig == null || gameVersion.ResVersion != ConfigDataMgr.Instance.gameConfig.ResVersion) { StartCoroutine(UpdateResource(gameConfig)); } else { CheckLoginState(); } } } else if (ConfigDataMgr.Instance.gameConfig != null) { CheckLoginState(); } else { UITipsDialog.ShowTips("题库缺失,请链接网络后重新进入", true); } })); }
void ForgetLayer1ContinueBtn() { if (string.IsNullOrEmpty(forgetLayer1.inputMobile.text)) { UITipsDialog.ShowTips("请输入手机号"); return; } if (string.IsNullOrEmpty(forgetLayer1.inputAnswer.text)) { UITipsDialog.ShowTips("请输入问题答案"); return; } if (string.IsNullOrEmpty(forgetLayer1.inputIdentifying.text)) { UITipsDialog.ShowTips("请输入手机验证码"); return; } OpenLayer(forgetLayer2); }
void SignupLayerIdentifyText(GameObject go) { if (signupLayer.CountDown > 0) { return; } string mobile = signupLayer.inputMobile.text; string answer = signupLayer.inputAnswer.text; if (string.IsNullOrEmpty(mobile)) { UITipsDialog.ShowTips("请输入手机号"); return; } if (string.IsNullOrEmpty(signupLayer.inputAnswer.text)) { UITipsDialog.ShowTips("请输入问题答案"); return; } RequestAuthCode param = new RequestAuthCode(); param.phone = mobile; param.zuoti = answer; param.type = "register"; param.equitmentTime = SystemInfo.deviceUniqueIdentifier; LoginManager.Instance.SendAuthCode <ResponseAuthCode>(param, (responseData) => { if (responseData.status == "200") { signupLayer.CountDown = 60; signupLayer.authCode = responseData.data.code; } else { UITipsDialog.ShowTips(responseData.msg); } }); }
void LoginLayer2WechatBtn() { GlobalManager.Instance.AuthWechat((requestOther) => { if (requestOther != null) { LoginManager.Instance.SendOtherMessage <ResponseLogin>(requestOther, (responseData) => { if (responseData.status == "200") { Debug.Log("登录成功" + responseData.msg); UITipsDialog.ShowTips("登录成功"); loginCallback(responseData.data); } else { UITipsDialog.ShowTips(responseData.msg); } }); } }); }
void ForgetLayer2ConfirmBtn() { string pwd1 = forgetLayer2.inputPwd1.text; string pwd2 = forgetLayer2.inputPwd2.text; if (string.IsNullOrEmpty(pwd1)) { UITipsDialog.ShowTips("请输入新密码"); return; } if (string.IsNullOrEmpty(pwd2)) { UITipsDialog.ShowTips("请确认新密码"); return; } if (!string.Equals(pwd1, pwd2)) { UITipsDialog.ShowTips("两次密码不一致"); return; } RequestForgetPwd requestForgetPwd = new RequestForgetPwd(); requestForgetPwd.phone = forgetLayer1.inputMobile.text; requestForgetPwd.code = forgetLayer1.inputIdentifying.text; requestForgetPwd.password = pwd1; requestForgetPwd.equitment = SystemInfo.deviceUniqueIdentifier; LoginManager.Instance.SendForgetPwd <ResponseForgetPwd>(requestForgetPwd, (responseData) => { if (responseData.status == "200") { UITipsDialog.ShowTips("设置密码成功"); } else { UITipsDialog.ShowTips(responseData.msg); } }); }
/// <summary> /// 分享回调 /// </summary> /// <param name="reqID">Req identifier.</param> /// <param name="state">State.</param> /// <param name="type">Type.</param> /// <param name="result">Result.</param> void OnShareResultHandler(int reqID, ResponseState state, PlatformType type, Hashtable result) { if (state == ResponseState.Success) { UITipsDialog.ShowTips("分享成功"); print("share successfully - share result :"); print(MiniJSON.jsonEncode(result)); } else if (state == ResponseState.Fail) { UITipsDialog.ShowTips("分享失败"); #if UNITY_ANDROID print("fail! throwable stack = " + result["stack"] + "; error msg = " + result["msg"]); #elif UNITY_IPHONE print("fail! error code = " + result["error_code"] + "; error msg = " + result["error_msg"]); #endif } else if (state == ResponseState.Cancel) { UITipsDialog.ShowTips("取消分享"); print("cancel !"); } }
void ForgetLayer1IdentifyText(GameObject go) { if (forgetLayer1.CountDown > 0) { return; } if (string.IsNullOrEmpty(forgetLayer1.inputMobile.text)) { UITipsDialog.ShowTips("请输入手机号"); return; } if (string.IsNullOrEmpty(forgetLayer1.inputAnswer.text)) { UITipsDialog.ShowTips("请输入问题答案"); return; } RequestAuthCode param = new RequestAuthCode(); param.phone = forgetLayer1.inputMobile.text; param.zuoti = forgetLayer1.inputAnswer.text; param.type = "forget"; param.equitmentTime = SystemInfo.deviceUniqueIdentifier; LoginManager.Instance.SendAuthCode <ResponseAuthCode>(param, (responseData) => { if (responseData.status == "200") { forgetLayer1.CountDown = 60; forgetLayer1.authCode = responseData.data.code; } else { UITipsDialog.ShowTips(responseData.msg); } }); }
public static void ShowTips(string tips) { UITipsDialog uITipsDialog = UIManager.Instance.OpenUI <UITipsDialog>(); uITipsDialog.InitWith(tips); }
void OnClickWechat() { UITipsDialog.ShowTips("此接口当前未开放"); }
/// <summary> /// 进入考试场景 /// </summary> public void SwitchToExam(Callback callback = null) { AuthorizeData auth = ConfigDataMgr.Instance.authorizeData; if (!auth.authorize || auth.authExpire) { UITipsDialog.ShowTips("软件未授权或授权到期"); return; } //#if CHAPTER_ONE // Callback LoadFinish = () => // { // switch (GameDataMgr.instance.carType) // { // case CarType.DaZhong: // UIManager.Instance.OpenUI<UIExamWindowDaZhong>(); // break; // case CarType.AiLiShe: // UIManager.Instance.OpenUI<UIExamWindowAiLiShe>(); // break; // case CarType.BenTengB30: // UIManager.Instance.OpenUI<UIExamWindowBenTengB30>(); // break; // case CarType.AiLiShe2015: // UIManager.Instance.OpenUI<UIExamWindowAiLiShe2015>(); // break; // } // if (callback != null) // { // callback(); // } // }; // if (!ConfigDataMgr.instance.gameConfig.ios_audit) // { // UILoadingWindow uiLoadingWindow = UIManager.Instance.OpenUI<UILoadingWindow>(); // AsyncOperation async = SceneManager.LoadSceneAsync(ExamScene); // uiLoadingWindow.InitWith(async, LoadFinish, true); // } // else // { // UILoadingDialog uiLoadingDialog = UIManager.Instance.OpenUI<UILoadingDialog>(); // AsyncOperation async = SceneManager.LoadSceneAsync(ExamScene); // uiLoadingDialog.InitWith(async, LoadFinish, true); // } //#elif CHAPTER_TWO Callback LoadFinish = () => { //switch ((CarUID)GameDataMgr.Instance.carTypeData.uid) //{ // case CarUID.SangTaNa_Old: // case CarUID.SangTaNa_New: // UIManager.Instance.OpenUI<UIExamWindowDaZhong>(); // break; // case CarUID.AiLiShe_Old: // case CarUID.AiLiShe_New: // UIManager.Instance.OpenUI<UIExamWindowAiLiShe>(); // break; // case CarUID.BenTengB30_Old: // case CarUID.BenTengB30_New: // UIManager.Instance.OpenUI<UIExamWindowBenTengB30>(); // break; // case CarUID.AiLiShe2_Old: // case CarUID.AiLiShe2_New: // UIManager.Instance.OpenUI<UIExamWindowAiLiShe2015>(); // break; //} switch (GameDataMgr.Instance.carTypeData.chexingcode) { case "sangtana": UIManager.Instance.OpenUI <UIExamWindowDaZhong>(); break; case "ailishe": UIManager.Instance.OpenUI <UIExamWindowAiLiShe>(); break; case "bentengb30": UIManager.Instance.OpenUI <UIExamWindowBenTengB30>(); break; case "ailishe2": UIManager.Instance.OpenUI <UIExamWindowAiLiShe2015>(); break; } if (callback != null) { callback(); } }; UILoadingDialog uiLoadingDialog = UIManager.Instance.OpenUI <UILoadingDialog>(); AsyncOperation async = SceneManager.LoadSceneAsync(ExamScene); uiLoadingDialog.InitWith(async, LoadFinish, true); //#endif }
public static void ShowTips(string tips, bool isKeep = false) { UITipsDialog uITipsDialog = UIManager.Instance.OpenUI <UITipsDialog>(); uITipsDialog.InitWith(tips, isKeep); }