From eb51679c618d5027070fbd6f3c0519f0f17e7d7d Mon Sep 17 00:00:00 2001 From: JLChen <551775569@qq.com> Date: 星期一, 23 十一月 2020 10:07:53 +0800 Subject: [PATCH] Merge branch 'CJL' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into CJL --- HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs | 6 HDL_ON/UI/UI0-Public/TopViewDivBLL.cs | 15 HDL_ON/DriverLayer/Control_Udp_Bus.cs | 4 HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs | 0 HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs | 1 HDL_ON/UI/UI0-Public/AppUnlockPage.cs | 2 HDL-ON_iOS/AppDelegate.cs | 8 HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs | 50 HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs | 388 +++--- HDL-ON_iOS/Info.plist | 26 HDL_ON/Common/Utlis.cs | 169 --- HDL_ON/DAL/Server/HttpServerRequestBase.cs | 2 HDL_ON/UI/UI1-Login/RegisterPageBLL.cs | 28 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs | 32 HDL_ON/DAL/Net/Mqtt_Cloud.cs | 16 HDL_ON/UI/UI1-Login/LoginPage.cs | 157 --- HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs | 159 +-- HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs | 167 +-- HDL_ON/DriverLayer/UdpSocket.cs | 2 HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs | 18 HDL_ON/UI/UI1-Login/LoginPageBLL.cs | 90 - HDL_ON/Entity/DB_ResidenceData.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs | 4 HDL_ON/UI/UI0-Public/TopViewDiv.cs | 19 HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordOptionPage.cs | 54 HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs | 309 ----- HDL_ON/UI/UI1-Login/RegisterPage.cs | 36 HDL_ON/Common/MqttCommon.cs | 28 /dev/null | 711 -------------- HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs | 2 HDL_ON/DAL/Server/HttpUtil.cs | 51 HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs | 302 ++---- HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs | 6 HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/AccountBindInfoPage.cs | 32 36 files changed, 631 insertions(+), 2,273 deletions(-) diff --git a/HDL-ON_iOS/AppDelegate.cs b/HDL-ON_iOS/AppDelegate.cs index 4dfffc8..ac81ce3 100644 --- a/HDL-ON_iOS/AppDelegate.cs +++ b/HDL-ON_iOS/AppDelegate.cs @@ -23,7 +23,7 @@ // UserConfig.Instance.IsAppStoreVersionNewer = Harpy.Harpy.SharedInstance.TestIsAppStoreVersionNewer; // UserConfig.Instance.StoreVersion = Harpy.Harpy.SharedInstance.CurrentAppStoreVersion; // UserConfig.Instance.SaveUserConfig(); - // if (Shared.SimpleControl. UserInfo.Current.AccountString == @"464027401@qq.com") + // if (Shared.SimpleControl.MainPage.LoginUser.AccountString == @"464027401@qq.com") // { // return $"TestIsAppStoreVersionNewer : {UserConfig.Instance.IsAppStoreVersionNewer};; CurrentAppStoreVersion : {UserConfig.Instance.StoreVersion}"; // } @@ -196,11 +196,9 @@ string nsCount = NSLocale.CurrentLocale.CountryCode; - if ( UserInfo.Current != null && nsCount != UserInfo.Current.areaCode.ToString()) + if (MainPage.LoginUser != null && nsCount != MainPage.LoginUser.areaCode.ToString()) { - //int.TryParse(nsCount,out UserInfo.Current.areaCode); - //2020-11-18 - UserInfo.Current.areaCode = nsCount; + int.TryParse(nsCount,out MainPage.LoginUser.areaCode); OnAppConfig.Instance.SaveUserConfig(); } application.IdleTimerDisabled = true; diff --git a/HDL-ON_iOS/Info.plist b/HDL-ON_iOS/Info.plist index c76ed24..8967a81 100755 --- a/HDL-ON_iOS/Info.plist +++ b/HDL-ON_iOS/Info.plist @@ -6,26 +6,6 @@ <array> <dict> <key>CFBundleURLName</key> - <string>weixin</string> - </dict> - <dict> - <key>CFBundleURLName</key> - <string>AispeechMobile</string> - </dict> - <dict> - <key>CFBundleURLName</key> - <string>xiaoduapp</string> - </dict> - <dict> - <key>CFBundleURLSchemes</key> - <array> - <string>hdlonpro</string> - </array> - <key>CFBundleTypeRole</key> - <string>Editor</string> - </dict> - <dict> - <key>CFBundleURLName</key> <string>qqmusic</string> </dict> </array> @@ -107,13 +87,7 @@ <string>鑾峰彇澶╂皵棰勬姤</string> <key>LSApplicationQueriesSchemes</key> <array> - <string>weixinULAPI</string> - <string>weixin</string> - <string>xiaoduapp</string> - <string>AispeechMobile</string> <string>qqmusic</string> </array> - <key>CFBundleDevelopmentRegion</key> - <string>zh_CN</string> </dict> </plist> diff --git a/HDL_ON/Common/MqttCommon.cs b/HDL_ON/Common/MqttCommon.cs index 68ed1cd..3a94096 100644 --- a/HDL_ON/Common/MqttCommon.cs +++ b/HDL_ON/Common/MqttCommon.cs @@ -158,7 +158,7 @@ // try // { // System.Threading.Thread.Sleep(200); -// //if (! UserInfo.Current.IsLogin) { +// //if (!MainPage.LoginUser.IsLogin) { // // continue; // //} // if (!CommonPage.IsRemote) continue; @@ -207,7 +207,7 @@ // var topicFilterPush2 = new TopicFilter // { -// Topic = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze, +// Topic = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze, // QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce, // //QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce // }; @@ -255,7 +255,7 @@ // return; // } -// if (! UserInfo.Current.IsLogin) +// if (!MainPage.LoginUser.IsLogin) // { // return; // } @@ -315,7 +315,7 @@ // // ReceiveNotifySqueezeAsync (mMes); // //} else -// if (topic == $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze) +// if (topic == $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze) // { // var mMes = System.Text.Encoding.UTF8.GetString(e.ApplicationMessage.Payload); // //鏂版尋涓嬬嚎涓婚鏂规 鏀跺埌鎸や笅绾夸富棰� @@ -679,7 +679,7 @@ // var username = MqttInfoConfig.Instance.mMqttInfo.connEmqUserName; // var passwordRemote = MqttInfoConfig.Instance.mMqttInfo.connEmqPwd; // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; -// //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; +// //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; // //鑾峰彇鍙傛暟鎴愬姛锛屼繚瀛樺埌鏈湴骞舵爣璁颁负true // MqttInfoConfig.Instance.IfGetMqttInfoSuccess = true; @@ -818,19 +818,19 @@ // //鏂紑杩滅▼杩炴帴 // CommonPage.IsRemote = false; -// if (! UserInfo.Current.IsLogin) +// if (!MainPage.LoginUser.IsLogin) // { // return; // } // DisConnectRemoteMqttClient("鎸や笅绾�"); -// UserInfo.Current.LastTime = DateTime.MinValue; -// UserInfo.Current.SaveUserInfo(); +// MainPage.LoginUser.LastTime = DateTime.MinValue; +// MainPage.LoginUser.SaveUserInfo(); // Room.Lists.Clear(); // ////鍒犻櫎鎺ㄩ�佹暟鎹� // //var webclient = new System.Net.WebClient (); -// //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, UserInfo.Current.LoginTokenString); +// //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, MainPage.LoginUser.LoginTokenString); // //webclient.DownloadStringAsync (new Uri ("https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/SignOut")); @@ -838,7 +838,7 @@ // Application.RunOnMainThread(() => // { // Utlis.ShowAppLinkStatus(AppLinkStatus.WiFi); -// new Shared.SimpleControl.Phone.AccountLogin( UserInfo.Current.AccountString, "").Show(); +// new Shared.SimpleControl.Phone.AccountLogin(MainPage.LoginUser.AccountString, "").Show(); // SharedMethod.SharedMethod.CurPageLayout = null; // //CommonPage.IsRemote = false; @@ -852,7 +852,7 @@ // //2020-06-30 鍒犻櫎鎺ㄩ�佹暟鎹� // ForceUpdateUtlis.Current.SignOut(); //#if HDL -// if (!String.IsNullOrEmpty ( UserInfo.Current.AllVisionRegisterDevUserNameGuid)) { +// if (!String.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { // com.freeview.global.Video.Logout (); // }///BusGateWayToClient/320c1fea-1866-4708-8277-e2321a4dd236/NotifyGateWayInfoChange //#endif @@ -945,7 +945,7 @@ // await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); // break; // case 4://鍙戝竷鏂版柟妗堢殑鎸や笅绾夸富棰� -// topicName = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze; +// topicName = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze; // //message = System.Text.Encoding.UTF8.GetBytes (PushSignStr); // await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Payload = message, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); // break; @@ -1003,7 +1003,7 @@ // { // var mqttInfoRequestPar = new GetConnMqttInfoObj() // { -// LoginAccessToken = UserInfo.Current.LoginTokenString, +// LoginAccessToken = MainPage.LoginUser.LoginTokenString, // PlatformStr = GetRandomKey(), // PublishPayloadJsonStr = PushSignStr, // Mac = UserConfig.Instance.GatewayMAC, @@ -1029,7 +1029,7 @@ // MqttInfoConfig.Instance.CurRemoteMACInfo = mqttInfoRequestResult_Obj.AccountAllGateways.Find((obj) => obj.mac == UserConfig.Instance.GatewayMAC); // if (MqttInfoConfig.Instance.CurRemoteMACInfo != null) // { -// //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; +// //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; // //----绗笁姝� 寮�濮嬭繛鎺� // await MQTTConnectAsync(); diff --git a/HDL_ON/Common/Utlis.cs b/HDL_ON/Common/Utlis.cs index 4a8ae49..329f7f5 100644 --- a/HDL_ON/Common/Utlis.cs +++ b/HDL_ON/Common/Utlis.cs @@ -1,176 +1,19 @@ 锘縰sing System; -using Shared; -using System.Text.RegularExpressions; - -namespace HDL_ON +namespace HDL_ON.Common { /// <summary> /// 甯哥敤宸ュ叿绫� /// </summary> public class Utlis { - /// <summary> - /// 鍏ㄥ眬鎵撳嵃 - /// </summary> - public static void WriteLine(object mes) + /// <summary> + /// 鍏ㄥ眬鎵撳嵃 + /// </summary> + public static void WriteLine(object mes) { #if DEBUG Console.WriteLine(mes); #endif } - - /// <summary> - /// 寮圭獥鎻愮ず - /// </summary> - /// <param name="mes"></param> - public static void ShowAlertOnMainThread(string mes) - { - Application.RunOnMainThread(() => { - new Alert("", mes, Language.StringByID(StringId.Close)).Show(); - }); - } - - /// <summary> - /// ShowTip - /// </summary> - /// <param name="mes"></param> - /// <param name="closeTime">鍏抽棴鏃堕棿</param> - public static void ShowTip(String mes, int closeTime = 2) - { - var tip = new Tip() - { - Text = mes, - CloseTime = closeTime, - Direction = AMPopTipDirection.None - }; - tip.Show(MainPage.BaseView); - } - - - #region 鈻� 鍚勭姝e垯妫�娴媉______________________ - /// <summary> - /// 鐢ㄤ簬涓浗澶ч檰楠岃瘉鎵嬫満鍙锋鍒欒〃杈惧紡 - /// 浠�1寮�澶达紝11浣� - /// </summary> - public static string PhoneRegexStr = "^[1][0-9]{10}$"; - /// <summary> - /// 鐢ㄤ簬楠岃瘉闈炰腑鍥藉ぇ闄嗘墜鏈哄彿姝e垯琛ㄨ揪寮� - /// </summary> - public static string PhoneForForeignRegexStr = "^[0-9]*$"; - /// <summary> - /// 鐢ㄤ簬楠岃瘉閭姝e垯琛ㄨ揪寮� - /// </summary> - public static string EmailRegexStr = "^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"; - - /// <summary> - /// 鍒ゆ柇鏄惁鍖呭惈澶у啓瀛楁瘝 - /// </summary> - /// <returns><c>true</c>, if contain upper was checked, <c>false</c> otherwise.</returns> - /// <param name="value">Value.</param> - public static bool CheckContainUpper(string value) - { - Regex reg = new Regex("[A-Z]+"); - return reg.IsMatch(value); - } - - /// <summary> - /// 鍒ゆ柇鏄惁鍖呭惈灏忓啓瀛楁瘝 - /// </summary> - /// <returns><c>true</c>, if contain lower was checked, <c>false</c> otherwise.</returns> - /// <param name="value">Value.</param> - public static bool CheckContainLower(string value) - { - Regex reg = new Regex("[a-z]+"); - return reg.IsMatch(value); - } - - /// <summary> - /// 鍒ゆ柇鏄惁鍖呭惈鏁板瓧 - /// </summary> - /// <returns><c>true</c>, if contain lower was checked, <c>false</c> otherwise.</returns> - /// <param name="value">Value.</param> - public static bool CheckContainNum(string value) - { - Regex reg = new Regex("[0-9]+"); - return reg.IsMatch(value); - } - - /// <summary> - /// 鍒ゆ柇鏄惁鍖呭惈绗﹀彿 - /// </summary> - /// <returns><c>true</c>, if contain lower was checked, <c>false</c> otherwise.</returns> - /// <param name="value">Value.</param> - public static bool CheckContainSymbol(string value) - { - Regex reg = new Regex("([^a-z0-9A-Z])+"); - return reg.IsMatch(value); - } - - /// <summary> - /// 妫�娴嬮偖绠辨槸鍚﹀悎娉� - /// </summary> - /// <param name="email"></param> - /// <returns></returns> - public static bool CheckEmail(string email) - { - Regex reg = new Regex(EmailRegexStr); - return reg.IsMatch(email); - } - - /// <summary> - /// 妫�娴嬫墜鏈哄彿鏄惁鍚堟硶 - /// </summary> - /// <param name="phoneNumber">鎵嬫満鍙�</param> - /// <param name="areaCode">鍦板尯浠g爜</param> - /// <returns></returns> - public static bool CheckPhoneNumber(string phoneNumber, string areaCode) - { - //鏍¢獙澶栧浗鎵嬫満鍙� - if (areaCode != "86") - { - Regex reg = new Regex(PhoneForForeignRegexStr); - return reg.IsMatch(phoneNumber); - } - else - { - //鏍¢獙鍥藉唴鎵嬫満鍙� - Regex reg = new Regex(PhoneRegexStr); - return reg.IsMatch(phoneNumber); - } - } - - #endregion - - /// <summary> - /// TextButton - /// 鏍规嵁鏂囨湰,璁$畻鎸夐挳瀹冨疄闄呯殑瀹藉害 - /// </summary> - /// <param name="btn"></param> - /// <param name="extendWidth">琛ュ厖瀹藉害</param> - /// <returns></returns> - public static int GetRealWidthByTextButton(Button btn, int extendWidth = 1) - { - if (string.IsNullOrEmpty(btn.Text)) { return Application.GetRealWidth(extendWidth); } - - return btn.GetTextWidth() + Application.GetRealWidth(extendWidth); - } - - /// <summary> - /// 鏍规嵁鏂囨湰,璁$畻鎸夐挳瀹冨疄闄呯殑瀹藉害 - /// </summary> - /// <returns></returns> - public static int GetRealWidthByText(Button btn) - { - if (string.IsNullOrEmpty(btn.Text)) { return Application.GetRealWidth(4); } -#if __IOS__ - //闇�瑕佸鍔犱竴涓宸�� - return btn.GetTextWidth() + Application.GetRealWidth(8); -#else - //闇�瑕佸鍔犱竴涓宸�� - return btn.GetTextWidth() + Application.GetRealWidth(4); -#endif - } - - } - + } } diff --git a/HDL_ON/DAL/Net/Mqtt_Cloud.cs b/HDL_ON/DAL/Net/Mqtt_Cloud.cs index 9e7f3a7..ea35f24 100644 --- a/HDL_ON/DAL/Net/Mqtt_Cloud.cs +++ b/HDL_ON/DAL/Net/Mqtt_Cloud.cs @@ -116,7 +116,7 @@ { //杩藉姞锛氭病鏈夎繙绋嬭繛鎺ョ殑鏉冮檺 if (remoteMqttIsConnecting - || remoteIsConnected || ! UserInfo.Current.IsLogin) + || remoteIsConnected || !MainPage.LoginUser.IsLogin) { return; } @@ -221,7 +221,7 @@ var mqttInfoRequestPar = new RemoteRequestParameters() { PlatformStr = "ON", - LoginAccessToken = UserInfo.Current.loginTokenString, + LoginAccessToken = MainPage.LoginUser.loginTokenString, RequestVersion = MainPage.VersionString, RequestProtocolType = 0, RequestSource = 1, @@ -257,7 +257,7 @@ } if (CurRemoteMACInfo != null) { - CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.loginTokenString; + CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.loginTokenString; CurRemoteMACInfo.clientId = clientId; mqttEncryptKey = CurRemoteMACInfo.isNewBusproGateway ? CurRemoteMACInfo.aesKey : ""; @@ -304,7 +304,7 @@ //static void ReceiveNotifyBusGateWayInfoChange() //{ // var gatewayListUrl = @"https://developer.hdlcontrol.com/Center/Center/GetGatewayPagger"; //App銆丅uspro杞欢鐧诲綍鍚庤幏鍙栫綉鍏冲垪琛� http 璇锋眰 - // var gatewayListRequestPar = new RemoteRequestParameters() { Mac = CurRemoteMACInfo.mac, LoginAccessToken = UserInfo.Current.loginTokenString, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; + // var gatewayListRequestPar = new RemoteRequestParameters() { Mac = CurRemoteMACInfo.mac, LoginAccessToken = MainPage.LoginUser.loginTokenString, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; // var gatewayListRequestResult = MainPage.RequestHttps("", Newtonsoft.Json.JsonConvert.SerializeObject(gatewayListRequestPar), false, false, gatewayListUrl); // var gatewayListRequestResult_Obj = Newtonsoft.Json.JsonConvert.DeserializeObject<MqttRemoteInfo>(gatewayListRequestResult.ResponseData.ToString()); // if (gatewayListRequestResult_Obj != null && gatewayListRequestResult_Obj.pageData.Count > 0) @@ -322,12 +322,12 @@ if (mMes == PushSignStr) return;//鏄嚜宸辩殑鐧诲綍鎺ㄩ�佷笉澶勭悊 //鏂紑杩滅▼杩炴帴 MainPage.IsRemote = false; - if (! UserInfo.Current.IsLogin) + if (!MainPage.LoginUser.IsLogin) { return; } - UserInfo.Current.lastTime = DateTime.MinValue; - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser.lastTime = DateTime.MinValue; + MainPage.LoginUser.SaveUserInfo(); string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); new System.Threading.Thread(() => @@ -375,7 +375,7 @@ DisConnectRemoteMqttClient("鎸や笅绾�"); Application.RunOnMainThread(() => { - MainPage.GoLoginPage( UserInfo.Current); + MainPage.GoLoginPage(MainPage.LoginUser); }); } diff --git a/HDL_ON/DAL/Server/HttpServerRequestBase.cs b/HDL_ON/DAL/Server/HttpServerRequestBase.cs index b84b637..b1956ba 100644 --- a/HDL_ON/DAL/Server/HttpServerRequestBase.cs +++ b/HDL_ON/DAL/Server/HttpServerRequestBase.cs @@ -20,7 +20,7 @@ webClient.Headers.Add("CONTENT-TYPE", "application/json"); if (needAuthorization) { - webClient.Headers.Add("Authorization", UserInfo.Current.loginTokenString); + webClient.Headers.Add("Authorization", MainPage.LoginUser.loginTokenString); } byte[] bytes = null; try diff --git a/HDL_ON/DAL/Server/HttpUtil.cs b/HDL_ON/DAL/Server/HttpUtil.cs index b0af7fb..c36697b 100644 --- a/HDL_ON/DAL/Server/HttpUtil.cs +++ b/HDL_ON/DAL/Server/HttpUtil.cs @@ -152,9 +152,8 @@ try { - //if (string.IsNullOrEmpty(urlHead)) - //{ - // urlHead = UserInfo.Current.RequestHttpsHost; + //if (string.IsNullOrEmpty (urlHead)) { + // urlHead = APIInfoConfig.Current.RequestHttpsHost; //} //string requestFullUrl = urlHead + apiPath; @@ -172,9 +171,9 @@ if (string.IsNullOrEmpty(replaceToken)) { - if(UserInfo.Current != null) + if (MainPage.LoginUser != null) {/* 濡傛灉涓嶉渶瑕侀獙璇乀oken鍙互涓嶇敤浼犲叆 */ - request.AddHeader("Authorization", UserInfo.Current.loginTokenString); + request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); } } else @@ -228,20 +227,20 @@ } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + HDL_ON.Common.Utlis.WriteLine(ex.Message); return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; } } else { - HDL_ON.Utlis.WriteLine(response.Content); + HDL_ON.Common.Utlis.WriteLine(response.Content); return new ResponsePackNew() { Code = "NETWORK_ERROR" }; } } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + HDL_ON.Common.Utlis.WriteLine(ex.Message); return new ResponsePackNew() { Code = "NETWORK_ERROR" }; } @@ -265,7 +264,7 @@ try { //if (string.IsNullOrEmpty (urlHead)) { - // urlHead = UserInfo.Current.RequestHttpsHost; + // urlHead = APIInfoConfig.Current.RequestHttpsHost; //} //string requestFullUrl = urlHead + apiPath; @@ -281,9 +280,9 @@ if (string.IsNullOrEmpty(replaceToken)) { - if ( UserInfo.Current != null) + if (MainPage.LoginUser != null) {/* 濡傛灉涓嶉渶瑕侀獙璇乀oken鍙互涓嶇敤浼犲叆 */ - request.AddHeader("Authorization", UserInfo.Current.loginTokenString); + request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); } } else @@ -309,7 +308,7 @@ } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + HDL_ON.Common.Utlis.WriteLine(ex.Message); return null; } #endregion @@ -335,7 +334,7 @@ { //if (string.IsNullOrEmpty (urlHead)) { - // urlHead = UserInfo.Current.RequestHttpsHost; + // urlHead = APIInfoConfig.Current.RequestHttpsHost; //} //string requestFullUrl = urlHead + apiPath; @@ -352,9 +351,9 @@ if (string.IsNullOrEmpty(replaceToken)) { - if ( UserInfo.Current != null) + if (MainPage.LoginUser != null) {/* 濡傛灉涓嶉渶瑕侀獙璇乀oken鍙互涓嶇敤浼犲叆 */ - request.AddHeader("Authorization", UserInfo.Current.loginTokenString); + request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); } } else @@ -400,20 +399,20 @@ } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + HDL_ON.Common.Utlis.WriteLine(ex.Message); return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; } } else { - HDL_ON.Utlis.WriteLine(response.Content); + HDL_ON.Common.Utlis.WriteLine(response.Content); return new ResponsePackNew() { Code = "NETWORK_ERROR" }; } } catch (Exception ex) { - HDL_ON.Utlis.WriteLine(ex.Message); + HDL_ON.Common.Utlis.WriteLine(ex.Message); return new ResponsePackNew() { Code = "NETWORK_ERROR" }; } @@ -479,25 +478,11 @@ string str = string.Empty; foreach (KeyValuePair<string, object> item in paramDictionary) { - //Value涓簄ull涓嶅弬鍔犳牎楠� if (item.Value != null) { - //Value.ToString()涓簄ull鎴栬��""涔熶笉鍙傚姞鏍¢獙 - if (!string.IsNullOrEmpty(item.Value.ToString())) - { - //濡傛灉鏄痓ool绫诲瀷锛岃杞皬鍐� - if (item.Value is bool) - { - str += item.Key + "=" + item.Value.ToString().ToLower() + "&"; - } - else - { - str += item.Key + "=" + item.Value.ToString() + "&"; - } - } + str += item.Key + "=" + item.Value.ToString() + "&"; } } - //2.3 鎷兼帴SECRET_KEY str = str.Substring(0, str.Length - 1) + SECRET_KEY; //2.4 MD5杞崲+杞皬鍐� diff --git a/HDL_ON/DriverLayer/Control_Udp_Bus.cs b/HDL_ON/DriverLayer/Control_Udp_Bus.cs index 6b01e14..27a9243 100644 --- a/HDL_ON/DriverLayer/Control_Udp_Bus.cs +++ b/HDL_ON/DriverLayer/Control_Udp_Bus.cs @@ -86,13 +86,13 @@ try { //璐﹀彿娌$櫥褰曚笉鍥炲 - if ( UserInfo.Current == null || ! UserInfo.Current.IsLogin) + if (MainPage.LoginUser == null || !MainPage.LoginUser.IsLogin) { return; } Control.ins.ChangeCommunicationMode(CommunicationMode.tcp_local_server); - var sendStr = UserInfo.Current.accountString; + var sendStr = MainPage.LoginUser.accountString; if (usefullBytes.Length == 0) { SendRemark(sendStr); diff --git a/HDL_ON/DriverLayer/UdpSocket.cs b/HDL_ON/DriverLayer/UdpSocket.cs index 3a3758f..ac83f9b 100644 --- a/HDL_ON/DriverLayer/UdpSocket.cs +++ b/HDL_ON/DriverLayer/UdpSocket.cs @@ -27,7 +27,7 @@ { get { - if ( UserInfo.Current != null && Entity.DB_ResidenceData.residenceData != null) + if (MainPage.LoginUser != null && Entity.DB_ResidenceData.residenceData != null) { return Entity.DB_ResidenceData.residenceData.GatewayType == 0 ? 6000 : 8585; } diff --git a/HDL_ON/Entity/DB_ResidenceData.cs b/HDL_ON/Entity/DB_ResidenceData.cs index 2c4bde6..ff40908 100644 --- a/HDL_ON/Entity/DB_ResidenceData.cs +++ b/HDL_ON/Entity/DB_ResidenceData.cs @@ -33,11 +33,11 @@ } else { - var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); + var curRegion = MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == CurReginID); //if (curRegion == null) //{ - // CurReginID = UserInfo.Current.regionList[0].RegionID; - // return UserInfo.Current.regionList[0]; + // CurReginID = MainPage.LoginUser.regionList[0].RegionID; + // return MainPage.LoginUser.regionList[0]; //} return curRegion; } diff --git a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs index c5bd852..b248f49 100644 --- a/HDL_ON/UI/UI0-Public/AppUnlockPage.cs +++ b/HDL_ON/UI/UI0-Public/AppUnlockPage.cs @@ -9,7 +9,7 @@ { void LoadOption() { - if ( UserInfo.Current == null) + if (MainPage.LoginUser == null) { return; } diff --git a/HDL_ON/UI/UI0-Public/ConfirmDialog.cs b/HDL_ON/UI/UI0-Public/ConfirmDialog.cs deleted file mode 100644 index e3e2527..0000000 --- a/HDL_ON/UI/UI0-Public/ConfirmDialog.cs +++ /dev/null @@ -1,153 +0,0 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; - -namespace HDL_ON.UI -{ - /// <summary> - /// 閫氱敤浜屾纭鐣岄潰 - /// 鍙互鑷畾涔夋寜閽枃瀛� - /// </summary> - public class ConfirmDialog : Dialog - { - /// <summary> - /// - /// </summary> - public ConfirmDialog() - { - - } - - /// <summary> - /// 鍒濆鍖朌ialog - /// </summary> - /// <param name="titleId"></param> - /// <param name="msgId"></param> - /// <param name="okAction"></param> - /// <param name="cancelAction"></param> - /// <param name="cancelID"></param> - /// <param name="confirmID"></param> - void ShowDialogBase(int titleId, int msgId, Action okAction, Action cancelAction, int cancelID = StringId.Cancel, int confirmID = StringId.Confirm) - { - - this.BackgroundColor = CSS_Color.DialogTransparentColor1; - - FrameLayout contentView = new FrameLayout() - { - Gravity = Gravity.Center, - Width = Application.GetRealWidth(270), - Height = Application.GetRealHeight(140), - BackgroundColor = CSS_Color.MainBackgroundColor, - BorderColor = 0x00000000, - BorderWidth = 0, - Radius = (uint)Application.GetMinRealAverage(10), - }; - this.AddChidren(contentView); - - Button btnTitle = new Button() - { - Y = Application.GetRealHeight(16), - Height = Application.GetRealHeight(30), - TextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - TextID = titleId, - }; - contentView.AddChidren(btnTitle); - - Button btnMsg = new Button() - { - Gravity = Gravity.CenterHorizontal, - Height = Application.GetRealHeight(25), - Y = btnTitle.Bottom, - Width = Application.GetRealHeight(200), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = msgId, - }; - contentView.AddChidren(btnMsg); - - Button btnLine = new Button() - { - Y = Application.GetRealHeight(96), - Height = Application.GetRealHeight(1), - Width = Application.GetRealWidth(270 / 2), - BackgroundColor = CSS_Color.DividingLineColor, - }; - contentView.AddChidren(btnLine); - - Button btnCancel = new Button() - { - Y = btnLine.Bottom, - Width = Application.GetRealWidth(135), - Height = Application.GetRealHeight(43), - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextID = cancelID, - }; - contentView.AddChidren(btnCancel); - - Button btnConfirm = new Button() - { - X = btnCancel.Right, - Y = btnLine.Y, - Width = Application.GetRealWidth(135), - Height = Application.GetRealHeight(45), - TextAlignment = TextAlignment.Center, - //TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.MainBackgroundColor, - BackgroundColor = CSS_Color.MainColor, - TextID = confirmID, - }; - contentView.AddChidren(btnConfirm); - //渚嬶細鍙充笅鍦嗚 澶у皬涓�50 - int mRectCornerID = HDLUtils.RectCornerBottomRight; - btnConfirm.SetCornerWithSameRadius((uint)Application.GetMinRealAverage(10), mRectCornerID); - - btnCancel.MouseUpEventHandler += (sender, e) => - { - this.Close(); - cancelAction?.Invoke(); - }; - - btnConfirm.MouseUpEventHandler += (sender, e) => - { - this.Close(); - okAction?.Invoke(); - }; - - this.Show(); - } - - /// <summary> - /// 鍔犺浇鎻愮ずDialog - /// </summary> - /// <param name="titleId"></param> - /// <param name="msgId"></param> - /// <param name="callBackAction"></param> - public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction = null) - { - this.ShowDialogBase(titleId, msgId, okAction, cancelAction); - } - - /// <summary> - /// 鍔犺浇鎻愮ずDialog - /// 鍙互鑷畾涔夋寜閽枃瀛� - /// </summary> - /// <param name="titleId"></param> - /// <param name="msgId"></param> - /// <param name="okAction"></param> - /// <param name="cancelAction"></param> - /// <param name="cancelID"></param> - /// <param name="confirmID"></param> - public void ShowDialog(int titleId, int msgId, Action okAction, Action cancelAction, int cancelID, int confirmID) - { - this.ShowDialogBase(titleId, msgId, okAction, cancelAction, cancelID, confirmID); - } - - } -} diff --git a/HDL_ON/UI/UI0-Public/LineView.cs b/HDL_ON/UI/UI0-Public/LineView.cs deleted file mode 100644 index eaf0f04..0000000 --- a/HDL_ON/UI/UI0-Public/LineView.cs +++ /dev/null @@ -1,20 +0,0 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; - -namespace HDL_ON.UI -{ - /// <summary> - /// 閫氱敤LineView - /// </summary> - public class LineView : FrameLayout - { - public LineView() - { - X = Application.GetRealWidth(16); - Height = Application.GetRealHeight(1); - Width = Application.GetRealWidth(343); - BackgroundColor = CSS_Color.DividingLineColor; - } - } -} diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs index 0b31b9d..84a2cae 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs @@ -20,6 +20,7 @@ /// </summary> FrameLayout contentView; + /// <summary> /// 鍚庨��鎸夐挳 /// </summary> @@ -31,11 +32,6 @@ string title; /// <summary> - /// 鏄惁闇�瑕佸叧闂〉闈� - /// </summary> - bool needClose = true; - - /// <summary> /// 鍚庨��鏃惰Е鍙戝浜嬩欢 /// </summary> Action backAction; @@ -44,19 +40,6 @@ { baseView = frame; title = str; - } - - /// <summary> - /// TopViewDiv - /// </summary> - /// <param name="frame">鐖舵帶浠�</param> - /// <param name="str">鏍囬</param> - /// <param name="needClose">鏄惁闇�瑕佸叧闂〉闈�</param> - public TopViewDiv(FrameLayout frame, string str, bool needClose) - { - baseView = frame; - title = str; - this.needClose = needClose; } /// <summary> diff --git a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs index c2f6a6c..bc222ab 100644 --- a/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs +++ b/HDL_ON/UI/UI0-Public/TopViewDivBLL.cs @@ -15,16 +15,13 @@ { btnBack.MouseUpEventHandler = (sender, e) => { backAction?.Invoke(); - if (needClose) + if (baseView != null) { - if (baseView != null) - { - baseView.RemoveFromParent(); - } - if (baseDialog != null) - { - baseDialog.Close(); - } + baseView.RemoveFromParent(); + } + if (baseDialog != null) + { + baseDialog.Close(); } }; } diff --git a/HDL_ON/UI/UI0-Public/WebViewDialog.cs b/HDL_ON/UI/UI0-Public/WebViewDialog.cs deleted file mode 100644 index 7845cdf..0000000 --- a/HDL_ON/UI/UI0-Public/WebViewDialog.cs +++ /dev/null @@ -1,42 +0,0 @@ -锘縰sing System; -using HDL_ON.UI.CSS; -using Shared; - -namespace HDL_ON.UI -{ - /// <summary> - /// WebViewDialog - /// 鍔犺浇缃戦〉 - /// </summary> - public class WebViewDialog : Dialog - { - FrameLayout bodyView; - public WebViewDialog() - { - bodyView = new FrameLayout(); - } - - - /// <summary> - /// - /// </summary> - /// <param name="titleStr"></param> - /// <param name="url"></param> - public void LoadPage(string titleStr, string url) - { - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - this.AddChidren(bodyView); - new TopViewDiv(this, bodyView, titleStr).LoadTopView(); - - //WebView - var webView = new WebView() { - Y = Application.GetRealHeight(64), - Height = bodyView.Height - Application.GetRealHeight(64), - }; - bodyView.AddChidren(webView); - //鍔犺浇缃戝潃 - webView.LoadRequest(url); - this.Show(); - } - } -} diff --git a/HDL_ON/UI/UI0-Public/Widget/TextButton.cs b/HDL_ON/UI/UI0-Public/Widget/TextButton.cs deleted file mode 100644 index c0a5b02..0000000 --- a/HDL_ON/UI/UI0-Public/Widget/TextButton.cs +++ /dev/null @@ -1,24 +0,0 @@ -锘縰sing System; -using Shared; -#if __IOS__ -using UIKit; -#endif - -namespace HDL_ON.UI -{ - /// <summary> - /// TextButton - /// 瑙e喅iOS 鏂囨湰鍒拌竟妗嗘湁杈硅窛闂 - /// </summary> - public class TextButton : Button - { - public TextButton() - { -#if __IOS__ - //閲嶅啓淇敼鏂囨湰鍒拌竟妗嗙殑鍐呰竟璺濅负0 - (this.uiView as MyButton).ContentEdgeInsets = new UIEdgeInsets(0, 0, 0, 0); -#endif - - } - } -} diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs index 5fccaf0..1d03af1 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPage.cs @@ -255,7 +255,6 @@ TextSize = CSS_FontSize.TextFontSize, PlaceholderTextColor = CSS_Color.PromptingColor1, PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), - IsNumberKeyboardType = true }; accountView.AddChidren(etAccount); diff --git a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs index 33b5fa3..7f1cb99 100644 --- a/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/ForgetPasswordPageBLL.cs @@ -32,7 +32,6 @@ { if (registerType == 0) return; - etAccount.IsNumberKeyboardType = true; etAccount.Text = registerPhone; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -61,7 +60,6 @@ { if (registerType == 1) return; - etAccount.IsNumberKeyboardType = false; etAccount.Text = registerEmail; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -94,11 +92,11 @@ { etAccount.TextChangeEventHandler += (sender, e) => { - //Regex reg = new Regex(@"^[1]+\d{10}"); - //var mFalg = reg.Match(etAccount.Text.Trim()); + Regex reg = new Regex(@"^[1]+\d{10}"); + var mFalg = reg.Match(etAccount.Text.Trim()); if (registerType == 0)//鎵嬫満鑾峰彇楠岃瘉鐮佹寜閽敓鏁堟潯浠� { - if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + if (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11) { btnGetVerificationCode_Phone.IsSelected = false; } @@ -110,7 +108,7 @@ } else//閭鑾峰彇楠岃瘉鐮佹寜閽敓鏁堟潯浠� { - if (!Utlis.CheckEmail(etAccount.Text.Trim())) + if (!mFalg.Success) { btnGetVerificationCode_Mail.IsSelected = false; } @@ -144,8 +142,10 @@ //鎵嬫満鏂瑰紡-楠岃瘉鎵嬫満鍙风爜鏄惁姝g‘ if (registerType == 0) { - btnGetVerificationCode_Phone.IsSelected = false; - if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + btnGetVerificationCode_Phone.IsSelected = false; + Regex reg = new Regex(@"^[1]+\d{9}"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) { btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; btnAccountViewBottomLine.Height = Application.GetRealHeight(2); @@ -169,7 +169,9 @@ { btnGetVerificationCode_Mail.IsSelected = false; //閭鏂瑰紡-楠岃瘉閭鏄惁姝g‘ - if (!Utlis.CheckEmail(etAccount.Text.Trim())) + var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success ) { btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; btnAccountViewBottomLine.Height = Application.GetRealHeight(2); @@ -289,25 +291,6 @@ } /// <summary> - /// 妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲 - /// </summary> - /// <param name="result"></param> - void CheckAndSetUserRequestHost(ResponsePackNew result) { - try - { - var mGlobalRegionListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GlobalRegionListRes>(result.Data.ToString()); - if (UserInfo.Current.RequestHttpsHost != mGlobalRegionListObj.regionUrl) - { - UserInfo.Current.RequestHttpsHost = mGlobalRegionListObj.regionUrl; - UserInfo.Current.GlobalRegion = mGlobalRegionListObj; - UserInfo.Current.SaveUserInfo(); - } - } - catch { } - } - - - /// <summary> /// 鑾峰彇楠岃瘉鐮� /// </summary> void LoadEvent_GetVerificationCode() @@ -324,15 +307,12 @@ var result = pm.GetRegionByAccount(account); if (result.Code != StateCode.SUCCESS) { - IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); return; } else { - //2.1妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲 - CheckAndSetUserRequestHost(result); - - //2.2宸茬粡娉ㄥ唽杩囷紝鍙戦�侀獙璇佺爜鎵惧洖瀵嗙爜 + //2.宸茬粡娉ㄥ唽杩囷紝鍙戦�侀獙璇佺爜鎵惧洖瀵嗙爜 Application.RunOnMainThread(() => { //鐭俊鍙戦�侀棿闅�60s @@ -374,7 +354,7 @@ if (resultObj.Code != StateCode.SUCCESS) { // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); } } }) @@ -443,7 +423,7 @@ waitPage.Hide(); }); // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_ForgetPwd, resultObj.Code); } }); } diff --git a/HDL_ON/UI/UI1-Login/LoginPage.cs b/HDL_ON/UI/UI1-Login/LoginPage.cs index 9dbe678..b8f1b69 100644 --- a/HDL_ON/UI/UI1-Login/LoginPage.cs +++ b/HDL_ON/UI/UI1-Login/LoginPage.cs @@ -240,10 +240,8 @@ }; //璺宠浆鍥藉鍖哄彿閫夋嫨鐣岄潰 - EventHandler<MouseEventArgs> eHandler = (sender, e) => - { - JLCountrycode.CountryCodeView.Current.Show((countryName, code) => - { + EventHandler<MouseEventArgs> eHandler = (sender, e) => { + JLCountrycode.CountryCodeView.Current.Show((countryName, code) => { if (!string.IsNullOrEmpty(code)) { phoneZoneCode = code; @@ -462,7 +460,7 @@ LoadEventList(); account = etAccount.Text.Trim(); -#if DEBUG1211 + #if DEBUG1211 //鏈湴妯″紡 Button btnLocalMode = new Button() { @@ -478,159 +476,14 @@ btnLocalMode.MouseUpEventHandler = (sender, e) => { MainPage.LocalMode = true; - UserInfo.Current = new UserInfo(); + MainPage.LoginUser = new UserInfo(); MainPage.GoUserPage(); }; MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString()); -#endif - - #region 闅愮鏀跨瓥 - AddServiceAgreementControl(bodyView); - #endregion + #endif } - - #region 鈻� 鏈嶅姟鍗忚___________________________ - bool isAgreePrivacyPolicy = false; - /// <summary> - /// 娣诲姞鏈嶅姟鍗忚鎺т欢 - /// </summary> - /// <param name="frameBack"></param> - private void AddServiceAgreementControl(FrameLayout frameLayout) - { - isAgreePrivacyPolicy = UserInfo.Current.isAgreePrivacyPolicy; - var frameRow = new FrameLayout() - { - Height = Application.GetRealHeight(28), - Y = Application.GetRealHeight(628), - }; - frameLayout.AddChidren(frameRow); - - //鍚屾剰鎸夐挳鑳屾櫙 - var agreeView = new FrameLayout() - { - Height = Application.GetRealHeight(28), - Width = Application.GetRealWidth(28), - X = Application.GetRealWidth(82), - }; - frameRow.AddChidren(agreeView); - //鍚屾剰鍥炬爣鎸夐挳 - var agreeBtn = new Button() - { - Width = Application.GetMinRealAverage(28), - Height = Application.GetMinRealAverage(28), - UnSelectedImagePath = "Public/ChooseIcon.png", - SelectedImagePath = "Public/ChooseOnIcon.png", - IsSelected = isAgreePrivacyPolicy, - Gravity = Gravity.Center - }; - agreeView.AddChidren(agreeBtn); - - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { - isAgreePrivacyPolicy = !isAgreePrivacyPolicy; - agreeBtn.IsSelected = isAgreePrivacyPolicy; - UserInfo.Current.isAgreePrivacyPolicy = isAgreePrivacyPolicy; - UserInfo.Current.SaveUserInfo(); - }; - - agreeBtn.MouseUpEventHandler = eventHandler; - agreeView.MouseUpEventHandler = eventHandler; - - //int btnWidth = 0; - //鍚屾剰鏂囨湰 - var agreeTextBtn = new TextButton() - { - X = agreeView.Right, - Width = Application.GetRealWidth(28), - Height = Application.GetRealHeight(28), - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = StringId.Agree - }; - frameRow.AddChidren(agreeTextBtn); - agreeTextBtn.Width = Utlis.GetRealWidthByTextButton(agreeTextBtn); - - //鐢ㄦ埛鍗忚鎸夐挳 - var userAgreementBtn = new TextButton() - { - X = agreeTextBtn.Right, - Width = Application.GetRealWidth(28), - Height = Application.GetRealHeight(28), - TextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = "銆�" + Language.StringByID(StringId.UserAgreement) + "銆�" - }; - frameRow.AddChidren(userAgreementBtn); - userAgreementBtn.Width = Utlis.GetRealWidthByTextButton(userAgreementBtn); - - //鍜屾枃鏈� - var andTextBtn = new TextButton() - { - X = userAgreementBtn.Right, - Width = Application.GetRealWidth(28), - Height = Application.GetRealHeight(28), - TextColor = CSS_Color.TextualColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - TextID = StringId.And - }; - frameRow.AddChidren(andTextBtn); - andTextBtn.Width = Utlis.GetRealWidthByTextButton(andTextBtn); - - //闅愮鏀跨瓥鎸夐挳 - var privacyPolicyBtn = new TextButton() - { - X = andTextBtn.Right, - Width = Application.GetRealWidth(28), - Height = Application.GetRealHeight(28), - TextColor = CSS_Color.MainColor, - TextSize = CSS_FontSize.PromptFontSize_FirstLevel, - Text = "銆�" + Language.StringByID(StringId.PrivacyPolicy) + "銆�" - }; - frameRow.AddChidren(privacyPolicyBtn); - privacyPolicyBtn.Width = Utlis.GetRealWidthByTextButton(privacyPolicyBtn); - - //鎵撳紑鐢ㄦ埛鍗忚 - userAgreementBtn.MouseUpEventHandler = (sender, e) => - { - OpenWebViewPage(false); - }; - - //鎵撳紑闅愮鏀跨瓥 - privacyPolicyBtn.MouseUpEventHandler = (sender, e) => - { - OpenWebViewPage(true); - }; - } - - /// <summary> - /// OpenWebViewPage - /// </summary> - /// <param name="isOpenPrivacyPolicy">鏄惁闅愮鏀跨瓥</param> - private void OpenWebViewPage(bool isOpenPrivacyPolicy) - { - string url = isAgreePrivacyPolicy ? Constant.URL_PrivacyPolicy : Constant.URL_UserAgreement; - string titleStr = isAgreePrivacyPolicy ? Language.StringByID(StringId.PrivacyPolicy) : Language.StringByID(StringId.UserAgreement); - new WebViewDialog().LoadPage(titleStr, url); - } - - /// <summary> - /// 妫�娴嬮殣绉佸崗璁� - /// </summary> - /// <returns></returns> - private bool CheckPrivacyPolicy() - { - if (isAgreePrivacyPolicy == false) - { - //璇峰悓鎰忋�婄敤鎴峰崗璁�嬪拰銆婇殣绉佹斂绛栥�� - Utlis.ShowTip(Language.StringByID(StringId.PleaseReadAndAgreePrivacyPolicyMsg)); - return false; - } - return true; - } - - #endregion } } \ No newline at end of file diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs index 5803f90..d91a9b9 100644 --- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs @@ -28,25 +28,6 @@ } /// <summary> - /// 妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲 - /// </summary> - /// <param name="result"></param> - void CheckAndSetUserRequestHost(ResponsePackNew result) - { - try - { - var mGlobalRegionListObj = Newtonsoft.Json.JsonConvert.DeserializeObject<GlobalRegionListRes>(result.Data.ToString()); - if (UserInfo.Current.RequestHttpsHost != mGlobalRegionListObj.regionUrl) - { - UserInfo.Current.RequestHttpsHost = mGlobalRegionListObj.regionUrl; - UserInfo.Current.GlobalRegion = mGlobalRegionListObj; - UserInfo.Current.SaveUserInfo(); - } - } - catch { } - } - - /// <summary> /// 鐐瑰嚮鎸夐挳鑾峰彇楠岃瘉鐮� /// </summary> void GetVerificationCode() @@ -70,7 +51,7 @@ btnAccountViewBottomLine.Height = Application.GetRealHeight(2); return; } - if (!Utlis.CheckPhoneNumber(phoneNumber, phoneZoneCode)) + if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) { var tip = new Tip() { @@ -92,14 +73,11 @@ var result = pm.GetRegionByAccount(account); if (result.Code != StateCode.SUCCESS) { - IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); return; } else { - //妫�娴嬪綋鍓嶉厤缃煙鍚嶆槸鍚︿竴鑷达紝涓嶄竴鑷村垯鏇挎崲 - CheckAndSetUserRequestHost(result); - // Application.RunOnMainThread(() => { btnGetVerificationCode.IsSelected = false; @@ -135,7 +113,7 @@ btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); }); // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); } } @@ -417,7 +395,7 @@ return; if (loginType == 0) { - if (!Utlis.CheckPhoneNumber(registerPhone, phoneZoneCode)) + if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) { var tip = new Tip() { @@ -440,7 +418,7 @@ } else { - if (!Utlis.CheckEmail(registerEmail)) + if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) { var tip = new Tip() { @@ -515,15 +493,12 @@ { if (btnLogin.IsSelected) { - //鍒ゆ柇鏄惁鍚屾剰浜嗛殣绉佹斂绛� - if (CheckPrivacyPolicy() == false) return; - account = etAccount.Text.Trim(); password = etPassword.Text.Trim(); if (loginType == 0) { - if (!Utlis.CheckPhoneNumber(account, phoneZoneCode)) + if (!Regex.IsMatch(account, @"^[1]+\d{10}") && account.Length == 11) { var tip = new Tip() { @@ -537,7 +512,7 @@ } else { - if (!Utlis.CheckEmail(account)) + if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) { var tip = new Tip() { @@ -609,13 +584,8 @@ var result = pm.GetRegionByAccount(account); if (result.Code != StateCode.SUCCESS) { - IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); return; - } - else - { - //璁剧疆鐢ㄦ埛鎵�娉ㄥ唽鍦板尯鐨勫煙鍚嶏紝鐢ㄦ埛鐩稿叧鎿嶄綔閮界敤杩欎釜鍩熷悕 - CheckAndSetUserRequestHost(result); } } @@ -657,7 +627,7 @@ OnAppConfig.Instance.RefreshUserConfig(); DB_ResidenceData.InitRoomFunction(); } - if ( UserInfo.Current.userEmailInfo == "464027401@qq.com") + if (MainPage.LoginUser.userEmailInfo == "464027401@qq.com") { DB_ResidenceData.residenceData.floors.Add(new Floor() { name = "1F", sid = "09888" }); var r111 = new Room() { sid = "0001", name = "Room-1", floorId = "09888", backgroundImage = "Classification/Room/Roombg.png" }; @@ -931,11 +901,7 @@ else { //2020-11-13 寰呯‘璁� - //鑾峰彇浣忓畢澶辫触锛岄噸鏂版爣璁颁负鏈櫥褰曠姸鎬� - UserInfo.Current.lastTime = DateTime.MinValue; - UserInfo.Current.SaveUserInfo(); - //鐧诲綍澶辫触锛岃鍏堟坊鍔犱綇瀹咃紒 - Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); + MainPage.ShowAlertOnMainThread("鐧诲綍澶辫触锛岃鍏堟坊鍔犱綇瀹呫��"); } } } @@ -979,26 +945,18 @@ if (loginResult.Code == StateCode.SUCCESS) { var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); - // UserInfo.Current = new UserInfo - //{ - // userType = revertData.userType, - // accountString = account, - // password = password, - // lastTime = DateTime.Now, - // ID = revertData.userId, - // loginTokenString = revertData.headerPrefix + revertData.accessToken, - // refreshToken = revertData.refreshToken, - // userName = revertData.name - //}; - UserInfo.Current.userType = revertData.userType; - UserInfo.Current.accountString = account; - //UserInfo.Current.password = password; - UserInfo.Current.lastTime = DateTime.Now; - UserInfo.Current.ID = revertData.userId; - UserInfo.Current.loginTokenString = revertData.headerPrefix + revertData.accessToken; - UserInfo.Current.refreshToken = revertData.refreshToken; - UserInfo.Current.userName = revertData.name; - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser = new UserInfo + { + userType = revertData.userType, + accountString = account, + password = password, + lastTime = DateTime.Now, + ID = revertData.userId, + loginTokenString = revertData.headerPrefix + revertData.accessToken, + refreshToken = revertData.refreshToken, + userName = revertData.name + }; + MainPage.LoginUser.SaveUserInfo(); MainPage.Log("鐧诲綍鎴愬姛銆�"); result = true; //鑾峰彇鐢ㄦ埛淇℃伅 @@ -1073,7 +1031,7 @@ if (responsePack == StateCode.SUCCESS) { //2020-11-13 寰呯‘璁わ紝娌℃湁浣忓畢锛屼笉绠楃櫥褰曟垚鍔� - if ( UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0){ + if (MainPage.LoginUser.regionList != null && MainPage.LoginUser.regionList.Count > 0){ result = true; } //result = true; @@ -1081,7 +1039,7 @@ else { // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(responsePack); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Gethomepager, responsePack); } return result; } diff --git a/HDL_ON/UI/UI1-Login/RegisterPage.cs b/HDL_ON/UI/UI1-Login/RegisterPage.cs index 25dd3d1..da291bd 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPage.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPage.cs @@ -283,7 +283,6 @@ TextSize = CSS_FontSize.TextFontSize, PlaceholderTextColor = CSS_Color.PromptingColor1, PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), - IsNumberKeyboardType = true }; accountView.AddChidren(etAccount); @@ -681,34 +680,25 @@ if (loginResult.Code == StateCode.SUCCESS) { var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); - // UserInfo.Current = new UserInfo - //{ - // userType = revertData.userType, - // accountString = account, - // password = password, - // lastTime = DateTime.Now, - // ID = revertData.userId, - // loginTokenString = revertData.headerPrefix + revertData.accessToken, - // refreshToken = revertData.refreshToken, - // userName = revertData.name - //}; - UserInfo.Current.userType = revertData.userType; - UserInfo.Current.accountString = account; - //UserInfo.Current.password = password; - UserInfo.Current.lastTime = DateTime.Now; - UserInfo.Current.ID = revertData.userId; - UserInfo.Current.loginTokenString = revertData.headerPrefix + revertData.accessToken; - UserInfo.Current.refreshToken = revertData.refreshToken; - UserInfo.Current.userName = revertData.name; - - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser = new UserInfo + { + userType = revertData.userType, + accountString = account, + password = password, + lastTime = DateTime.Now, + ID = revertData.userId, + loginTokenString = revertData.headerPrefix + revertData.accessToken, + refreshToken = revertData.refreshToken, + userName = revertData.name + }; + MainPage.LoginUser.SaveUserInfo(); MainPage.Log("鐧诲綍鎴愬姛銆�"); result = true; } else { //鐧诲綍澶辫触 - IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, loginResult.Code); Application.RunOnMainThread(() => { btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; diff --git a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs index 25fd27b..ce1f7a3 100644 --- a/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs +++ b/HDL_ON/UI/UI1-Login/RegisterPageBLL.cs @@ -30,11 +30,11 @@ { etAccount.TextChangeEventHandler = (sender, e) => { - //Regex reg = new Regex(@"^[1]+\d{10}"); - //var mFalg = reg.Match(etAccount.Text.Trim()); + Regex reg = new Regex(@"^[1]+\d{10}"); + var mFalg = reg.Match(etAccount.Text.Trim()); if (registerType == 0)//鎵嬫満娉ㄥ唽鑾峰彇楠岃瘉鐮佹寜閽敓鏁堟潯浠� { - if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + if (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11) { btnGetVerificationCode_Phone.IsSelected = false; } @@ -46,7 +46,7 @@ } else//閭娉ㄥ唽鑾峰彇楠岃瘉鐮佹寜閽敓鏁堟潯浠� { - if (!Utlis.CheckEmail(etAccount.Text.Trim())) + if (!mFalg.Success) { btnGetVerificationCode_Mail.IsSelected = false; } @@ -72,7 +72,6 @@ { return; } - etAccount.IsNumberKeyboardType = true; etAccount.Text = registerPhone; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -101,8 +100,6 @@ { if (registerType == 1) return; - - etAccount.IsNumberKeyboardType = false; etAccount.Text = registerEmail; etPassword.Text = ""; etRepeatPassword.Text = ""; @@ -151,7 +148,9 @@ { if (registerType == 0) { - if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) + Regex reg = new Regex(@"^[1]+\d{10}"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success || (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11)) { btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; btnAccountViewBottomLine.Height = Application.GetRealHeight(2); @@ -180,7 +179,10 @@ else if (registerType == 1) { //閭娉ㄥ唽-楠岃瘉閭鏄惁姝g‘ - if (!Utlis.CheckEmail(etAccount.Text.Trim())) + var reg = new Regex("^\\s*([A-Za-z0-9_-]+(\\.\\w+)*@(\\w+\\.)+\\w{2,5})\\s*$"); + //Regex.IsMatch(etAccount.Text.Trim(), "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+"); + var mFalg = reg.Match(etAccount.Text.Trim()); + if (!mFalg.Success) { btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; btnAccountViewBottomLine.Height = Application.GetRealHeight(2); @@ -418,17 +420,17 @@ if (resultObj.Code != StateCode.SUCCESS) { // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); } }else if (result.Code.ToUpper() == StateCode.SUCCESS) { //3.鎻愮ず璐﹀彿宸插瓨鍦紝鏃犳硶閲嶅娉ㄥ唽 - Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); + MainPage.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); } else { //4.鎻愮ず鍏跺畠寮傚父閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(result.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); } }) { IsBackground = true }.Start(); @@ -538,7 +540,7 @@ else// 娉ㄥ唽澶辫触 { // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(validateSmsResult.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_Register, validateSmsResult.Code); //2020-11-13 寰呬慨鏀� //string erorrInfo = ""; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/AccountBindInfoPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/AccountBindInfoPage.cs index cc2daf6..d1a0a8d 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/AccountBindInfoPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/AccountBindInfoPage.cs @@ -4,9 +4,6 @@ namespace HDL_ON.UI { - /// <summary> - /// 宸茬粦瀹氭墜鏈烘垨鑰呴偖绠辩殑椤甸潰 - /// </summary> public partial class AccountBindInfoPage : FrameLayout { FrameLayout bodyView; @@ -30,7 +27,7 @@ /// </summary> /// <param name="act">鍒锋柊缁戝畾淇℃伅鏂规硶</param> /// <param name="option">淇淇℃伅鐨勭被鍨�:1:閭锛�2:鎵嬫満</param> - public void LoadPage(Action<string> act, int ot, int tId) + public void LoadPage(Action<string> act,int ot,int tId) { action = act; optionType = ot; @@ -53,7 +50,7 @@ TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, TextAlignment = TextAlignment.CenterLeft, - TextID = optionType == 1 ? StringId.CurrentEmail : StringId.CurPhone, + TextID = optionType == 1 ? StringId.CurrentEmail : StringId.CurPhone, }; rowView.AddChidren(btnTitle); @@ -63,7 +60,7 @@ TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, TextAlignment = TextAlignment.CenterRight, - Text = optionType == 1 ? UserInfo.Current.userEmailInfo : UserInfo.Current.userMobileInfo, + Text = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo, }; rowView.AddChidren(btnContent); @@ -85,8 +82,7 @@ }; bodyView.AddChidren(btnChangeBind); - //鍚屾椂缁戝畾閭鎴栬�呮墜鏈烘墠鏄剧ず"鏇存崲楠岃瘉鏂瑰紡" - if (!string.IsNullOrEmpty( UserInfo.Current.userMobileInfo) && !string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) + if( (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) && optionType == 1) || (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) && optionType == 2)) { Button btnUnbind = new Button() { @@ -115,18 +111,16 @@ /// </summary> void LoadEvent_SkipChangeBandAccountInfo(Button button) { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { var cbe = new ChangeBindAccountPage(); - cbe.isUnbind = false; MainPage.BasePageView.AddChidren(cbe); if (optionType == 1) { - cbe.LoadPage(action, optionType, StringId.ModifyBindingEmail); + cbe.LoadPage(action, optionType, StringId.ModifyBindingEmail, StringId.CurrentEmail); } - else if (optionType == 2) + else if(optionType == 2) { - cbe.LoadPage(action, optionType, StringId.ModifyBindingPhone); + cbe.LoadPage(action, optionType, StringId.ModifyBindingPhone, StringId.CurPhone); } MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; @@ -138,18 +132,16 @@ /// </summary> void LoadEvent_SkipDelBandAccountInfo(Button button) { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { var cbe = new ChangeBindAccountPage(); - cbe.isUnbind = true;//鏄惁涓鸿В缁戞爣璁� MainPage.BasePageView.AddChidren(cbe); if (optionType == 1) { - cbe.LoadPage(action, optionType, StringId.UnbindEmail); + cbe.LoadPage(action, optionType, StringId.UnbindEmail, StringId.CurrentEmail); } - else if (optionType == 2) + else if(optionType == 2) { - cbe.LoadPage(action, optionType, StringId.UnbindPhone); + cbe.LoadPage(action, optionType, StringId.UnbindPhone, StringId.CurPhone); } MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs index 4129820..ad35668 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/BindAccountPage.cs @@ -1,206 +1,206 @@ -锘�//using System; -//using Shared; -//using HDL_ON.UI.CSS; -//using System.Text.RegularExpressions; -//using HDL_ON.DAL.Server; +锘縰sing System; +using Shared; +using HDL_ON.UI.CSS; +using System.Text.RegularExpressions; +using HDL_ON.DAL.Server; -//namespace HDL_ON.UI -//{ -// public partial class BindAccountPage : FrameLayout -// { -// FrameLayout bodyView; -// Button btnBind; -// EditText etContent; -// Action<string> action; -// /// <summary> -// /// 鏍囬ID -// /// </summary> -// int titleId; -// public BindAccountPage() -// { -// bodyView = this; -// } +namespace HDL_ON.UI +{ + public partial class BindAccountPage : FrameLayout + { + FrameLayout bodyView; + Button btnBind; + EditText etContent; + Action<string> action; + /// <summary> + /// 鏍囬ID + /// </summary> + int titleId; + public BindAccountPage() + { + bodyView = this; + } -// public void LoadPage(Action<string> act,int tId) -// { -// action = act; -// titleId = tId; -// bodyView.BackgroundColor = CSS_Color.BackgroundColor; -// new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); + public void LoadPage(Action<string> act,int tId) + { + action = act; + titleId = tId; + bodyView.BackgroundColor = CSS_Color.BackgroundColor; + new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); -// FrameLayout rowView = new FrameLayout() -// { -// Y = Application.GetRealHeight(72), -// Height = Application.GetRealHeight(50), -// BackgroundColor = CSS_Color.MainBackgroundColor, -// }; -// bodyView.AddChidren(rowView); + FrameLayout rowView = new FrameLayout() + { + Y = Application.GetRealHeight(72), + Height = Application.GetRealHeight(50), + BackgroundColor = CSS_Color.MainBackgroundColor, + }; + bodyView.AddChidren(rowView); -// Button btnTitle = new Button() -// { -// X = Application.GetRealWidth(16), -// Width = Application.GetRealWidth(180), -// TextColor = CSS_Color.FirstLevelTitleColor, -// TextSize = CSS_FontSize.SubheadingFontSize, -// TextAlignment = TextAlignment.CenterLeft, -// TextID = titleId == StringId.BindEmail ? StringId.EntryNewEmail : StringId.EntryNewPhone, -// }; -// rowView.AddChidren(btnTitle); + Button btnTitle = new Button() + { + X = Application.GetRealWidth(16), + Width = Application.GetRealWidth(180), + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextAlignment = TextAlignment.CenterLeft, + TextID = titleId == StringId.BindEmail ? StringId.EntryNewEmail : StringId.EntryNewPhone, + }; + rowView.AddChidren(btnTitle); -// etContent = new EditText() -// { -// Width = Application.GetRealWidth(359), -// TextColor = CSS_Color.PromptingColor1, -// TextSize = CSS_FontSize.TextFontSize, -// TextAlignment = TextAlignment.CenterRight, -// Foucs = true -// }; -// rowView.AddChidren(etContent); + etContent = new EditText() + { + Width = Application.GetRealWidth(359), + TextColor = CSS_Color.PromptingColor1, + TextSize = CSS_FontSize.TextFontSize, + TextAlignment = TextAlignment.CenterRight, + Foucs = true + }; + rowView.AddChidren(etContent); -// btnBind = new Button() -// { -// Y = Application.GetRealHeight(213), -// Gravity = Gravity.CenterHorizontal, -// Width = Application.GetRealWidth(220), -// Height = Application.GetRealHeight(44), -// BackgroundColor = CSS_Color.MainColor, -// TextAlignment = TextAlignment.Center, -// TextColor = CSS_Color.MainBackgroundColor, -// TextID = StringId.Confirm, -// TextSize = CSS_FontSize.SubheadingFontSize, -// IsBold = true, -// Radius = (uint)Application.GetRealWidth(22), -// BorderColor = 0x00000000, -// BorderWidth = 0, -// }; -// bodyView.AddChidren(btnBind); + btnBind = new Button() + { + Y = Application.GetRealHeight(213), + Gravity = Gravity.CenterHorizontal, + Width = Application.GetRealWidth(220), + Height = Application.GetRealHeight(44), + BackgroundColor = CSS_Color.MainColor, + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.MainBackgroundColor, + TextID = StringId.Confirm, + TextSize = CSS_FontSize.SubheadingFontSize, + IsBold = true, + Radius = (uint)Application.GetRealWidth(22), + BorderColor = 0x00000000, + BorderWidth = 0, + }; + bodyView.AddChidren(btnBind); -// LoadEvent_BindEmail(); + LoadEvent_BindEmail(); -// } -// } + } + } -// //-------------------------------------------- -// public partial class BindAccountPage -// { -// void LoadEvent_BindEmail() -// { -// btnBind.MouseUpEventHandler = (sender, e) => { -// Application.HideSoftInput(); -// var account = etContent.Text.Trim(); -// if (titleId == StringId.BindEmail) -// { -// if (account == UserInfo.Current.userEmailInfo) -// { -// var tip = new Tip() -// { -// Text = Language.StringByID(StringId.EmailIsSameNoNeedModfiy), -// CloseTime = 1, -// Direction = AMPopTipDirection.None -// }; -// tip.Show(bodyView); -// return; -// } -// if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) -// { -// var tip = new Tip() -// { -// Text = Language.StringByID(StringId.PlsEntryCorrectEmailAddress), -// CloseTime = 1, -// Direction = AMPopTipDirection.None -// }; -// tip.Show(bodyView); -// return; -// } -// } -// else if (titleId == StringId.BindPhone) -// { -// if(account == UserInfo.Current.userMobileInfo) -// { -// var tip = new Tip() -// { -// Text = Language.StringByID(StringId.PhoneNumberIsSameNoNeedModfiy), -// CloseTime = 1, -// Direction = AMPopTipDirection.None -// }; -// tip.Show(bodyView); -// return; -// } -// if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) -// { -// var tip = new Tip() -// { -// Text = Language.StringByID(StringId.PlsEntryCorrectMobilNeumber), -// CloseTime = 1, -// Direction = AMPopTipDirection.None -// }; -// tip.Show(bodyView); -// return; -// } -// } -// new System.Threading.Thread(() => -// { -// var result = new HttpServerRequest().BindAccount(account); -// if (result.ToUpper() == StateCode.SUCCESS) -// { -// Application.RunOnMainThread(() => -// { -// if (titleId == StringId.BindEmail) -// { -// UserInfo.Current.userEmailInfo = account; -// } -// else if (titleId == StringId.BindPhone) -// { -// UserInfo.Current.userMobileInfo = account; -// } -// var page = new OperationResultDisPalyPage(); -// page.Show(); -// if (titleId == StringId.BindEmail) -// { -// page.LoadPage(true, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailSuccess), ""); -// } -// else if (titleId == StringId.BindPhone) -// { -// page.LoadPage(true, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneSuccess), ""); -// } + //-------------------------------------------- + public partial class BindAccountPage + { + void LoadEvent_BindEmail() + { + btnBind.MouseUpEventHandler = (sender, e) => { + Application.HideSoftInput(); + var account = etContent.Text.Trim(); + if (titleId == StringId.BindEmail) + { + if (account == MainPage.LoginUser.userEmailInfo) + { + var tip = new Tip() + { + Text = Language.StringByID(StringId.EmailIsSameNoNeedModfiy), + CloseTime = 1, + Direction = AMPopTipDirection.None + }; + tip.Show(bodyView); + return; + } + if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) + { + var tip = new Tip() + { + Text = Language.StringByID(StringId.PlsEntryCorrectEmailAddress), + CloseTime = 1, + Direction = AMPopTipDirection.None + }; + tip.Show(bodyView); + return; + } + } + else if (titleId == StringId.BindPhone) + { + if(account == MainPage.LoginUser.userMobileInfo) + { + var tip = new Tip() + { + Text = Language.StringByID(StringId.PhoneNumberIsSameNoNeedModfiy), + CloseTime = 1, + Direction = AMPopTipDirection.None + }; + tip.Show(bodyView); + return; + } + if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) + { + var tip = new Tip() + { + Text = Language.StringByID(StringId.PlsEntryCorrectMobilNeumber), + CloseTime = 1, + Direction = AMPopTipDirection.None + }; + tip.Show(bodyView); + return; + } + } + new System.Threading.Thread(() => + { + var result = new HttpServerRequest().BindAccount(account); + if (result.ToUpper() == StateCode.SUCCESS) + { + Application.RunOnMainThread(() => + { + if (titleId == StringId.BindEmail) + { + MainPage.LoginUser.userEmailInfo = account; + } + else if (titleId == StringId.BindPhone) + { + MainPage.LoginUser.userMobileInfo = account; + } + var page = new OperationResultDisPalyPage(); + page.Show(); + if (titleId == StringId.BindEmail) + { + page.LoadPage(true, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailSuccess), ""); + } + else if (titleId == StringId.BindPhone) + { + page.LoadPage(true, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneSuccess), ""); + } -// for (int i = 0; i < 3; i++) -// { -// MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); -// } -// action(account); -// }); -// } -// else -// { -// var tipMsg = ""; + for (int i = 0; i < 3; i++) + { + MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); + } + action(account); + }); + } + else + { + var tipMsg = ""; -// Application.RunOnMainThread(() => -// { -// var page = new OperationResultDisPalyPage(); -// page.Show(); -// if (titleId == StringId.BindEmail) -// { -// if (result == "Exist") -// { -// tipMsg = Language.StringByID(StringId.EmailAlreadyUse); -// } -// page.LoadPage(false, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailFail) + "," + tipMsg, ""); -// } -// else -// { -// if (result == "Exist") -// { -// tipMsg = Language.StringByID(StringId.PhoneNumberAlreadyUse); -// } -// page.LoadPage(false, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneFail) + "," + tipMsg, ""); -// } -// }); -// } -// }) -// { IsBackground = true }.Start(); -// }; -// } -// } -//} + Application.RunOnMainThread(() => + { + var page = new OperationResultDisPalyPage(); + page.Show(); + if (titleId == StringId.BindEmail) + { + if (result == "Exist") + { + tipMsg = Language.StringByID(StringId.EmailAlreadyUse); + } + page.LoadPage(false, Language.StringByID(StringId.BindEmail), Language.StringByID(StringId.BindEmailFail) + "," + tipMsg, ""); + } + else + { + if (result == "Exist") + { + tipMsg = Language.StringByID(StringId.PhoneNumberAlreadyUse); + } + page.LoadPage(false, Language.StringByID(StringId.BindPhone), Language.StringByID(StringId.BindPhoneFail) + "," + tipMsg, ""); + } + }); + } + }) + { IsBackground = true }.Start(); + }; + } + } +} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs index 44b9478..2420826 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindAccountPage.cs @@ -6,40 +6,14 @@ namespace HDL_ON.UI { - /// <summary> - /// 淇敼缁戝畾鎴栬�呰В缁�--鍙戦�侀獙璇佺爜椤甸潰 - /// </summary> public partial class ChangeBindAccountPage : FrameLayout { - /// <summary> - /// - /// </summary> FrameLayout bodyView; - /// <summary> - /// - /// </summary> Action<string> action; /// <summary> /// 鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満 /// </summary> int optionType; - /// <summary> - /// 鏄惁涓鸿В缁戦獙璇� - /// </summary> - public bool isUnbind; - - /// <summary> - /// - /// </summary> - Button btnTitle; - /// <summary> - /// - /// </summary> - Button btnContent; - - /// <summary> - /// ChangeBindAccountPage - /// </summary> public ChangeBindAccountPage() { bodyView = this; @@ -51,18 +25,18 @@ /// <param name="optionType">鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満</param> /// <param name="titleId"></param> /// <param name="contentTitleId"></param> - public void LoadPage(Action<string> act, int opt, int titleId) + public void LoadPage(Action<string> act, int opt, int titleId, int contentTitleId) { action = act; optionType = opt; string account; if (optionType == 0) { - account = UserInfo.Current.userEmailInfo; + account = MainPage.LoginUser.userEmailInfo; } else { - account = UserInfo.Current.userMobileInfo; + account = MainPage.LoginUser.userMobileInfo; } bodyView.BackgroundColor = CSS_Color.BackgroundColor; new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); @@ -75,24 +49,24 @@ }; bodyView.AddChidren(rowView); - btnTitle = new Button() + Button btnTitle = new Button() { X = Application.GetRealWidth(16), Width = Application.GetRealWidth(180), TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.SubheadingFontSize, TextAlignment = TextAlignment.CenterLeft, - //TextID = contentTitleId, + TextID = contentTitleId, }; rowView.AddChidren(btnTitle); - btnContent = new Button() + Button btnContent = new Button() { Width = Application.GetRealWidth(359), TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, TextAlignment = TextAlignment.CenterRight, - //Text = optionType == 1 ? UserInfo.Current.userEmailInfo : UserInfo.Current.userMobileInfo, + Text = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo, }; rowView.AddChidren(btnContent); @@ -114,10 +88,7 @@ }; bodyView.AddChidren(btnChangeBind); - - - //鍚屾椂缁戝畾閭鎴栬�呮墜鏈烘墠鏄剧ず"鏇存崲楠岃瘉鏂瑰紡" - if (!string.IsNullOrEmpty( UserInfo.Current.userMobileInfo) && !string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) + if (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo)) { Button btnChangeGetVer = new Button() { @@ -135,27 +106,7 @@ LoadEvent_ChangeVerificationMethod(btnChangeGetVer, btnTitle, btnContent); } - SetContentTitleId(); LoadEvent_GetVerification(btnChangeBind, titleId); - } - - /// <summary> - /// 璁剧疆鎸夐挳鎻愮ず鏂囧瓧 - /// 淇敼缁戝畾鏃舵彁绀猴細鎵嬫満楠岃瘉銆侀偖绠遍獙璇� - /// 瑙g粦鏃舵彁绀猴細褰撳墠鎵嬫満鎵嬫満鍙风爜銆佸綋鍓嶉偖绠卞湴鍧� - /// </summary> - void SetContentTitleId() - { - if (optionType == 2) - { - btnTitle.TextID = isUnbind ? StringId.CurPhone : StringId.PhoneNumberVerification; - btnContent.Text = UserInfo.Current.userMobileInfo; - } - else - { - btnTitle.TextID = isUnbind ? StringId.CurrentEmail : StringId.EmailVerification; - btnContent.Text = UserInfo.Current.userEmailInfo; - } } } @@ -170,7 +121,16 @@ btn.MouseUpEventHandler = (sender, e) => { optionType = optionType == 1 ? 2 : 1; - SetContentTitleId(); + if (optionType == 2) + { + btnTitle.TextID = StringId.CurPhone; + btnContent.Text = MainPage.LoginUser.userMobileInfo; + } + else + { + btnTitle.TextID = StringId.CurrentEmail; + btnContent.Text = MainPage.LoginUser.userEmailInfo; + } }; } @@ -186,64 +146,47 @@ { new Thread(() => { - //1.鑾峰彇楠岃瘉鐮�,閲囩敤鏁忔劅鏁版嵁楠岃瘉 - ResponsePackNew resultObj; - if (optionType == 1)//閭 + if (optionType == 1) { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, UserInfo.Current.userEmailInfo); - } - else - { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.SENSITIVE_DATA, UserInfo.Current.userMobileInfo, true, UserInfo.Current.areaCode); - } + var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userEmailInfo); - if (resultObj.Code != StateCode.SUCCESS) - { - // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); } - else + else if (optionType == 2) { - if (time == 0) - { - time = 60; - new Thread(() => - { - while (time > 0) - { - time--; - Application.RunOnMainThread(() => - { - button.Text = time.ToString() + "s"; - }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - button.IsSelected = true; - button.TextID = StringId.GetVerificationCode; - button.BackgroundColor = CSS_Color.MainColor; - time = 0; - }); - }) - { IsBackground = true }.Start(); - } - Application.RunOnMainThread(() => - { - button.BackgroundColor = CSS_Color.PromptingColor1; - var vcp = new ChangeBindVerificationCodePage(); - vcp.isUnbind = isUnbind; - MainPage.BasePageView.AddChidren(vcp); - vcp.LoadPage(action, titleId, optionType, time); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }); + var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString()); } - }) { IsBackground = true }.Start(); } - - + if (time == 0) + { + time = 60; + new Thread(() => + { + while (time > 0) + { + time--; + Application.RunOnMainThread(() => + { + button.Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + Application.RunOnMainThread(() => + { + button.IsSelected = true; + button.TextID = StringId.GetVerificationCode; + button.BackgroundColor = CSS_Color.MainColor; + time = 0; + }); + }) + { IsBackground = true }.Start(); + } + button.BackgroundColor = CSS_Color.PromptingColor1; + var vcp = new VerificationCodePage(); + MainPage.BasePageView.AddChidren(vcp); + vcp.LoadPage(action, titleId, optionType, time); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindAccountPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindAccountPage.cs deleted file mode 100644 index 494fc3f..0000000 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindAccountPage.cs +++ /dev/null @@ -1,225 +0,0 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; -using System.Threading; -using System.Text.RegularExpressions; -using HDL_ON.DAL.Server; - - -namespace HDL_ON.UI -{ - /// <summary> - /// 鏂扮粦瀹氭垨鑰呮崲缁�--鎵嬫満鎴栬�呴偖绠卞彂閫侀獙璇佺爜 - /// </summary> - public partial class NewBindAccountPage : FrameLayout - { - FrameLayout bodyView; - Button btnBind; - EditText etContent; - Action<string> action; - - /// <summary> - /// 鏍囬ID - /// </summary> - int titleId; - /// <summary> - /// 鏄惁鎵嬫満 - /// </summary> - bool isPhone; - /// <summary> - /// 鏄惁鎹㈢粦 - /// </summary> - bool isModifyBind; - - /// <summary> - /// 鎵嬫満鍖哄彿 - /// </summary> - string phoneZoneCode = "86"; - - /// <summary> - /// - /// </summary> - public NewBindAccountPage() - { - bodyView = this; - } - - /// <summary> - /// LoadPage - /// </summary> - /// <param name="act"></param> - /// <param name="isPhone">鏄惁缁戝畾鎵嬫満</param> - public void LoadPage(Action<string> act, bool isPhone = false, bool isModifyBind = false) - { - action = act; - this.isPhone = isPhone; - this.isModifyBind = isModifyBind; - if (isModifyBind) - { - //淇敼缁戝畾 - titleId = isPhone ? StringId.ModifyBindingPhone : StringId.ModifyBindingEmail; - } - else - { - //鏂扮粦瀹� - titleId = isPhone ? StringId.BoundMobileInfo : StringId.BoundEmailInfo; - } - - - - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); - - FrameLayout rowView = new FrameLayout() - { - Y = Application.GetRealHeight(72), - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - bodyView.AddChidren(rowView); - - //缁戝畾閭鎴栬�呯粦瀹氭墜鏈哄彿 - Button btnTitle = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(180), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - TextID = titleId, - }; - rowView.AddChidren(btnTitle); - - etContent = new EditText() - { - Width = Application.GetRealWidth(359), - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.CenterRight, - Foucs = true - }; - rowView.AddChidren(etContent); - - btnBind = new Button() - { - Y = Application.GetRealHeight(213), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(220), - Height = Application.GetRealHeight(44), - BackgroundColor = CSS_Color.MainColor, - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.MainBackgroundColor, - TextID = StringId.GetVerificationCode, - TextSize = CSS_FontSize.SubheadingFontSize, - IsBold = true, - Radius = (uint)Application.GetRealWidth(22), - BorderColor = 0x00000000, - BorderWidth = 0, - }; - bodyView.AddChidren(btnBind); - - //鐐瑰嚮鑾峰彇楠岃瘉鐮� - LoadEvent_GetVerification(btnBind); - - } - } - - - //-------------------------------------------- - public partial class NewBindAccountPage - { - /// <summary> - /// 鐐瑰嚮鑾峰彇楠岃瘉鐮� - /// </summary> - void LoadEvent_GetVerification(Button button) - { - button.MouseUpEventHandler = (sender, e) => - { - if (button.Text == Language.StringByID(StringId.GetVerificationCode)) - { - Application.HideSoftInput(); - var account = etContent.Text.Trim(); - #region 姝e垯琛ㄨ揪寮� - //1.妫�娴嬭处鍙锋槸鍚﹀悎娉� - if (!isPhone) - { - if (!Utlis.CheckEmail(account)) - { - Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectEmailAddress)); - return; - } - } - else - { - if (!Utlis.CheckPhoneNumber(account, phoneZoneCode)) - { - Utlis.ShowTip(Language.StringByID(StringId.PlsEntryCorrectMobilNeumber)); - return; - } - } - #endregion - int time = 0; - //2.妫�楠岄�氳繃 - new Thread(() => - { - //2.2 鑾峰彇楠岃瘉鐮� - ResponsePackNew resultObj; - if (!isPhone)//閭 - { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account); - } - else - { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, account, true, phoneZoneCode); - } - - if (resultObj.Code != StateCode.SUCCESS) - { - // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - else - { - if (time == 0) - { - time = 60; - new Thread(() => - { - while (time > 0) - { - time--; - Application.RunOnMainThread(() => - { - button.Text = time.ToString() + "s"; - }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - button.IsSelected = true; - button.TextID = StringId.GetVerificationCode; - button.BackgroundColor = CSS_Color.MainColor; - time = 0; - }); - }) - { IsBackground = true }.Start(); - } - Application.RunOnMainThread(() => - { - button.BackgroundColor = CSS_Color.PromptingColor1; - var vcp = new NewBindVerificationCodePage(); - vcp.phoneZoneCode = phoneZoneCode; - MainPage.BasePageView.AddChidren(vcp); - vcp.LoadPage(action, titleId, account, isPhone, time, isModifyBind); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }); - } - - }) - { IsBackground = true }.Start(); - } - - }; - } - } -} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindVerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindVerificationCodePage.cs deleted file mode 100644 index 91255e5..0000000 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/NewBindVerificationCodePage.cs +++ /dev/null @@ -1,711 +0,0 @@ -锘縰sing System; -using Shared; -using HDL_ON.UI.CSS; -using System.Threading; -using HDL_ON.DAL.Server; - -namespace HDL_ON.UI -{ - /// <summary> - /// 鏂扮粦瀹氭垨鑰呮崲缁�--楠岃瘉鐮侀獙璇佸苟缁戝畾 - /// </summary> - public partial class NewBindVerificationCodePage : FrameLayout - { - FrameLayout bodyView; - - Button btnNum1; - Button btnNum1Line; - - Button btnNum2; - Button btnNum2Line; - - Button btnNum3; - Button btnNum3Line; - - Button btnNum4; - Button btnNum4Line; - - Button btnNum5; - Button btnNum5Line; - - Button btnNum6; - Button btnNum6Line; - - EditText et; - - Button btnResend; - - Button btnTip; - - Action<string> action; - - int titleId; - - ///// <summary> - ///// 鎿嶄綔鐩爣绫诲瀷 1:閭锛�2:鎵嬫満 - ///// </summary> - //int optionType; - /// <summary> - /// 鍊掕鏃舵椂闂� - /// </summary> - int time = 0; - /// <summary> - /// 鏄惁鎵嬫満 - /// </summary> - public bool isPhone; - /// <summary> - /// 鏄惁鎹㈢粦 - /// </summary> - public bool isModifyBind; - - /// <summary> - /// 鏂扮粦瀹氱殑璐﹀彿 - /// </summary> - public string verAccount; - /// <summary> - /// 鎵嬫満鍖哄彿 - /// </summary> - public string phoneZoneCode = "86"; - - - public NewBindVerificationCodePage() - { - bodyView = this; - } - - /// </summary> - /// <param name="act">鍥炴帀鍑芥暟</param> - /// <param name="tId">椤甸潰鏍囬</param> - /// <param name="account">璐﹀彿</param> - /// <param name="bPhone">鏄惁鎵嬫満</param> - /// <param name="t">鍊掕鏃舵椂闂�</param> - /// <param name="isModifyBind">鏄惁涓轰慨鏀圭粦瀹�</param> - public void LoadPage(Action<string> act, int tId, string account, bool bPhone, int t, bool isModifyBind) - { - action = act; - titleId = tId; - bodyView.BackgroundColor = CSS_Color.BackgroundColor; - isPhone = bPhone; - time = t; - this.verAccount = account; - this.isModifyBind = isModifyBind; - - Action backAction = () => { - Application.HideSoftInput(); - BackConfirmAction(); - }; - new TopViewDiv(bodyView, Language.StringByID(tId), false).LoadTopView(backAction); - - btnTip = new Button() - { - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(84), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.TextFontSize, - TextAlignment = TextAlignment.Center, - TextID = StringId.VerificationCodePrompt, - }; - bodyView.AddChidren(btnTip); - - btnNum1 = new Button() - { - X = Application.GetRealWidth(24), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum1); - - btnNum1Line = new Button() - { - X = Application.GetRealWidth(24), - Y = btnNum1.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(2), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - IsSelected = true - }; - bodyView.AddChidren(btnNum1Line); - - btnNum2 = new Button() - { - X = Application.GetRealWidth(80), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum2); - - btnNum2Line = new Button() - { - X = Application.GetRealWidth(80), - Y = btnNum2.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - }; - bodyView.AddChidren(btnNum2Line); - - btnNum3 = new Button() - { - X = Application.GetRealWidth(136), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum3); - - btnNum3Line = new Button() - { - X = Application.GetRealWidth(136), - Y = btnNum3.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - }; - bodyView.AddChidren(btnNum3Line); - - btnNum4 = new Button() - { - X = Application.GetRealWidth(192), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum4); - - btnNum4Line = new Button() - { - X = Application.GetRealWidth(192), - Y = btnNum4.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - }; - bodyView.AddChidren(btnNum4Line); - - btnNum5 = new Button() - { - X = Application.GetRealWidth(248), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum5); - - btnNum5Line = new Button() - { - X = Application.GetRealWidth(248), - Y = btnNum5.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - }; - bodyView.AddChidren(btnNum5Line); - - btnNum6 = new Button() - { - X = Application.GetRealWidth(304), - Y = Application.GetRealHeight(156), - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(38), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.Center, - IsBold = true, - }; - bodyView.AddChidren(btnNum6); - - btnNum6Line = new Button() - { - X = Application.GetRealWidth(304), - Y = btnNum6.Bottom, - Width = Application.GetRealWidth(48), - Height = Application.GetRealHeight(1), - BackgroundColor = CSS_Color.PromptingColor2, - SelectedBackgroundColor = CSS_Color.MainColor, - }; - bodyView.AddChidren(btnNum6Line); - - et = new EditText() - { - Y = Application.GetRealHeight(276), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(100), - Height = Application.GetRealHeight(10), - IsNumberKeyboardType = true, - Foucs = true, - }; - bodyView.AddChidren(et); - - btnResend = new Button() - { - Y = Application.GetRealHeight(276), - Gravity = Gravity.CenterHorizontal, - Width = Application.GetRealWidth(220), - Height = Application.GetRealHeight(44), - SelectedBackgroundColor = CSS_Color.MainColor, - BackgroundColor = CSS_Color.PromptingColor1, - TextAlignment = TextAlignment.Center, - TextColor = CSS_Color.MainBackgroundColor, - TextID = StringId.Resend, - TextSize = CSS_FontSize.SubheadingFontSize, - IsBold = true, - Radius = (uint)Application.GetRealWidth(22), - BorderColor = 0x00000000, - BorderWidth = 0, - }; - bodyView.AddChidren(btnResend); - - LoadThread_SendVerCode(); - LoadEvent_Resend(); - LoadEvent_VerificationEntryEvent(); - } - } - - - //--------------------------------------------- - public partial class NewBindVerificationCodePage - { - /// <summary> - /// 楠岃瘉鐮佽緭鍏ュ彉鍖栦簨浠� - /// </summary> - void LoadEvent_VerificationEntryEvent() - { - EventHandler<MouseEventArgs> clickEvent = (sender, e) => { - et.Foucs = true; - var etCode = et.Text; - switch (etCode.Length) - { - case 0: - btnNum1Line.IsSelected = true; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(2); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - break; - case 1: - btnNum2Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(2); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - break; - case 2: - btnNum3Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(3); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - break; - case 3: - btnNum4Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(4); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - break; - case 4: - btnNum5Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(5); - btnNum6Line.Height = Application.GetRealHeight(1); - break; - case 5: - btnNum6Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(2); - break; - } - }; - btnNum1.MouseUpEventHandler = clickEvent; - btnNum2.MouseUpEventHandler = clickEvent; - btnNum3.MouseUpEventHandler = clickEvent; - btnNum4.MouseUpEventHandler = clickEvent; - btnNum5.MouseUpEventHandler = clickEvent; - btnNum6.MouseUpEventHandler = clickEvent; - - et.TextChangeEventHandler = (sender, e) => { - var etCode = et.Text; - switch (etCode.Length) - { - case 0: - btnNum1Line.IsSelected = true; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1Line.Height = Application.GetRealHeight(2); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - btnNum1.Text = ""; - btnNum2.Text = ""; - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; - break; - case 1: - btnNum2Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum1.Text = etCode.Substring(0, 1); - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(2); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - btnNum2.Text = ""; - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; - break; - case 2: - btnNum3Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum2.Text = etCode.Substring(1, 1); - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(2); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; - break; - case 3: - btnNum4Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum3.Text = etCode.Substring(2, 1); - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(2); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(1); - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; - break; - case 4: - btnNum5Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum6Line.IsSelected = false; - btnNum4.Text = etCode.Substring(3, 1); - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(2); - btnNum6Line.Height = Application.GetRealHeight(1); - btnNum5.Text = ""; - btnNum6.Text = ""; - break; - case 5: - btnNum6Line.IsSelected = true; - btnNum1Line.IsSelected = false; - btnNum2Line.IsSelected = false; - btnNum3Line.IsSelected = false; - btnNum4Line.IsSelected = false; - btnNum5Line.IsSelected = false; - btnNum5.Text = etCode.Substring(4, 1); - btnNum1Line.Height = Application.GetRealHeight(1); - btnNum2Line.Height = Application.GetRealHeight(1); - btnNum3Line.Height = Application.GetRealHeight(1); - btnNum4Line.Height = Application.GetRealHeight(1); - btnNum5Line.Height = Application.GetRealHeight(1); - btnNum6Line.Height = Application.GetRealHeight(2); - btnNum6.Text = ""; - break; - case 6: - btnNum6.Text = etCode.Substring(5, 1); - et.Foucs = false; - new Thread(() => - { - bool result = false; - Action act = () => { }; - Application.RunOnMainThread(() => - { - act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait)); - }); - - var resultObj = new HttpServerRequest().BindAccount(verAccount, etCode, isPhone); - if (resultObj == StateCode.SUCCESS) - { - result = true; - } - else - { - //澶辫触鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(resultObj); - } - Application.RunOnMainThread(() => - { - act(); - }); - if (result) - { - //缁戝畾鎴愬姛 - BindSuccess(); - - } - }) - { IsBackground = true }.Start(); - - break; - } - }; - } - - /// <summary> - /// 缁戝畾鎴愬姛 - /// </summary> - void BindSuccess() - { - Application.RunOnMainThread(() => - { - var tipTitle = ""; - var tipMsg = ""; - if (isPhone) - { - UserInfo.Current.userMobileInfo = verAccount; - //璇蜂娇鐢ㄦ柊鐨勬墜鏈鸿处鍙风櫥褰旳PP - tipMsg = Language.StringByID(StringId.PleaseLoginWithNewMobileAccount); - if (isModifyBind) - { - //鐧诲綍鎵嬫満淇敼瀹屾垚 - tipTitle = Language.StringByID(StringId.LoginMobileAccountModificationCompleted); - } - else - { - //鐧诲綍鎵嬫満缁戝畾瀹屾垚 - tipTitle = Language.StringByID(StringId.LoginMobileAccountBindCompleted); - } - } - else - { - UserInfo.Current.userEmailInfo = verAccount; - //璇蜂娇鐢ㄦ柊鐨勯偖绠辫处鍙风櫥褰旳PP - tipMsg = Language.StringByID(StringId.PleaseLoginWithNewEmailAccount); - if (isModifyBind) - { - //鐧诲綍閭淇敼瀹屾垚 - tipTitle = Language.StringByID(StringId.LoginEmailAccountModificationCompleted); - } - else - { - //鐧诲綍閭缁戝畾瀹屾垚 - tipTitle = Language.StringByID(StringId.LoginEmailAccountBindCompleted); - - } - } - - var page = new OperationResultDisPalyPage(); - page.Show(); - page.LoadPage(true, Language.StringByID(titleId), tipTitle, tipMsg); - - if (isModifyBind) - { - ClosePageWithCount(3); - } - else - { - ClosePageWithCount(2); - } - - action(verAccount); - }); - } - - /// <summary> - /// 鎸囧畾鍏抽棴椤甸潰涓暟 - /// </summary> - /// <param name="countPage"></param> - void ClosePageWithCount(int countPage) - { - //鍏抽棴澶氬皯涓〉闈� - for (int i = 0; i < countPage; i++) - { - MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - } - } - - /// <summary> - /// 閲嶅彂楠岃瘉鐮佺瓑寰呯嚎绋� - /// </summary> - void LoadThread_SendVerCode() - { - btnResend.IsSelected = false; - et.Foucs = true; - if (time == 0) - { - time = 60; - new Thread(() => - { - //2.2 鑾峰彇楠岃瘉鐮� - ResponsePackNew resultObj; - if (!isPhone)//閭 - { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, verAccount); - } - else - { - resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, verAccount, true, phoneZoneCode); - } - - - }) - { IsBackground = true }.Start(); - } - new Thread(() => - { - while (time > 0) - { - time--; - Application.RunOnMainThread(() => - { - btnResend.Text = time.ToString() + "s"; - }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - btnResend.IsSelected = true; - btnResend.TextID = StringId.GetVerificationCode; - time = 0; - }); - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// 閲嶅彂楠岃瘉鐮佷簨浠� - /// </summary> - void LoadEvent_Resend() - { - btnResend.MouseUpEventHandler = (sender, e) => { - LoadThread_SendVerCode(); - }; - } - - /// <summary> - /// 杩斿洖浜屾纭浜嬩欢 - /// </summary> - void BackConfirmAction() - { - //楠岃瘉鐮佸彂閫佹垚鍔燂紝浜屾纭閫�鍑� - if (btnTip.TextID == StringId.VerificationCodePrompt) - { - Action cancelAction = () => - { - if (bodyView != null) - { - bodyView.RemoveFromParent(); - } - }; - new ConfirmDialog().ShowDialog(StringId.Tip, StringId.VerificationCodeMayBeDelayed, null, cancelAction, StringId.ReturnStr, StringId.WaitAMoment); - } - else - { - //鐩存帴鍏抽棴 - if (bodyView != null) - { - bodyView.RemoveFromParent(); - } - } - } - - } -} diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindVerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs similarity index 100% rename from HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/ChangeBindVerificationCodePage.cs rename to HDL_ON/UI/UI2/4-PersonalCenter/AccountBindInfo/VerificationCodePage.cs diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs index d3bf8f2..76a5282 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/ChooseShareMemberTargetListPageBLL.cs @@ -236,7 +236,7 @@ else { //鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Child_FindAll, responePack.Code); //璐﹀彿鎴栬�呭瘑鐮侀敊璇� Application.RunOnMainThread(() => { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs index 79c7a1d..52dbfc3 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberManagementPageBLL.cs @@ -111,7 +111,7 @@ else { //鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Child_FindAll, responePack.Code); //璐﹀彿鎴栬�呭瘑鐮侀敊璇� Application.RunOnMainThread(() => { diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs index 0763905..e97c197 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPageBLL.cs @@ -17,8 +17,8 @@ { Action action = () => { - var responePack = new HttpServerRequest().DeleteResidenceMemberAccount(memberInfo); - if (responePack.Code == StateCode.SUCCESS) + ResponsePack responePack = new HttpServerRequest().DeleteResidenceMemberAccount(memberInfo.SubAccountDistributedMark); + if (responePack.StateCode.ToUpper() == StateCode.SUCCESS) { this.RemoveFromParent(); backAction(); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs index f6d7949..4bcc52c 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalCenterPageBLL.cs @@ -61,10 +61,10 @@ }; dispalyView.AddChidren(contentView); - if ( UserInfo.Current.regionList.Count < 3) + if (MainPage.LoginUser.regionList.Count < 3) { } - else if ( UserInfo.Current.regionList.Count < 4) + else if (MainPage.LoginUser.regionList.Count < 4) { dispalyView = new FrameLayout() { @@ -79,7 +79,7 @@ contentView.Height = Application.GetRealHeight(45 * 3); dispalyView.AddChidren(contentView); } - else if ( UserInfo.Current.regionList.Count < 5) + else if (MainPage.LoginUser.regionList.Count < 5) { dispalyView = new FrameLayout() { @@ -113,7 +113,7 @@ - foreach (var home in UserInfo.Current.regionList) + foreach (var home in MainPage.LoginUser.regionList) { var btnHomeName = new Button() { @@ -130,7 +130,7 @@ }; contentView.AddChidren(btnHomeName); - if ( UserInfo.Current.regionList.IndexOf(home) < UserInfo.Current.regionList.Count - 1) + if (MainPage.LoginUser.regionList.IndexOf(home) < MainPage.LoginUser.regionList.Count - 1) { contentView.AddChidren(new Button() { @@ -145,7 +145,7 @@ var regionId = (string)btnHomeName.Tag; dialog.Close(); //DB_ResidenceData.residenceData.CurReginID = regionId; - LoadEvent_ChangeCurHome( UserInfo.Current.regionList.Find((obj) => obj.RegionID == regionId)); + LoadEvent_ChangeCurHome(MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == regionId)); LoadContentView(); }; } @@ -208,7 +208,7 @@ } //鍊掑嚭鏂颁綇瀹呮暟鎹� FileUtils.RestoreRegionFiles(newRegionRootPath); - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser.SaveUserInfo(); DB_ResidenceData.residenceData.EixtAccount(); DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID; OnAppConfig.Instance.SaveUserConfig(); @@ -270,11 +270,11 @@ { Action updataHeadImage = () => { - userHeadImageView.ImagePath = UserInfo.Current.headImagePagePath; + userHeadImageView.ImagePath = MainPage.LoginUser.headImagePagePath; }; Action updataUserName = () => { - btnUserName.Text = UserInfo.Current.userName; + btnUserName.Text = MainPage.LoginUser.userName; }; var personalDataView = new PersonalDataPage(updataHeadImage, updataUserName); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs index f915cbe..57dd341 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPage.cs @@ -171,7 +171,7 @@ /// </summary> Action updataUserName; - public PersonalDataPage(Action upHeadImage, Action upUserName) + public PersonalDataPage(Action upHeadImage,Action upUserName) { updataHeadImage = upHeadImage; updataUserName = upUserName; @@ -197,7 +197,7 @@ Width = Application.GetMinRealAverage(84), Height = Application.GetMinRealAverage(84), Radius = (uint)Application.GetMinRealAverage(42), - ImagePath = UserInfo.Current.headImagePagePath, + ImagePath = MainPage.LoginUser.headImagePagePath, }; headPortraitView.AddChidren(userHeadImageView); @@ -245,7 +245,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, - Text = string.IsNullOrEmpty( UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName + Text = string.IsNullOrEmpty(MainPage.LoginUser.userName) ? "涓嶆効鎰忛�忛湶濮撳悕鐨勭敤鎴�" : MainPage.LoginUser.userName }; userNameView.AddChidren(btnUserName); /// <summary> @@ -342,7 +342,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, - Text = GetBindAccountText( UserInfo.Current.userEmailInfo) + Text = string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userEmailInfo }; userEmailInfoView.AddChidren(btnUserEmailInfo); /// <summary> @@ -391,7 +391,7 @@ TextAlignment = TextAlignment.CenterRight, TextColor = CSS_Color.PromptingColor1, TextSize = CSS_FontSize.TextFontSize, - Text = GetBindAccountText( UserInfo.Current.userMobileInfo) + Text = string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userMobileInfo }; userPhoneInfoView.AddChidren(btnUserPhoneInfo); /// <summary> @@ -532,7 +532,7 @@ }; bodyView.AddChidren(btnLogout); - if (MainPage.Increase) + if(MainPage.Increase) { btnLogout.Y = Application.GetRealHeight(613); btnLogout.Height = Application.GetRealHeight(50); @@ -540,7 +540,6 @@ } LoadEventList(); - } /// <summary> @@ -617,25 +616,6 @@ pictureOptionView.AddChidren(btnCancel); LoadEvent_PictureOptionViewEventList(pictureBaseView); - } - - /// <summary> - /// 鑾峰彇缁戝畾璐﹀彿鏄剧ず鏂囨湰锛岀┖鐨勬椂鍊欐樉绀轰负鏈粦瀹� - /// </summary> - /// <param name="account"></param> - string GetBindAccountText(string account) - { - return string.IsNullOrEmpty(account) ? Language.StringByID(StringId.Unbound) : account; - } - - /// <summary> - /// 鍒ゆ柇鏄惁涓烘湭缁戝畾 - /// </summary> - /// <param name="account"></param> - /// <returns></returns> - bool CheckIfUnbound(string account) - { - return string.IsNullOrEmpty(account) || account == Language.StringByID(StringId.Unbound); } } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs index c1eab97..e2208cb 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/PersonalDataPageBLL.cs @@ -19,7 +19,6 @@ LoadEvent_ChangeBindEmail(); LoadEvent_ChangeBindPhone(); LoadEvent_SkipModifyPassword(); - GetUserInfo(); } /// <summary> @@ -34,58 +33,46 @@ } /// <summary> - /// 閫�鍑虹櫥褰曟搷浣� - /// </summary> - void Logout() - { - #region 淇濆瓨鏈湴鏁版嵁鑷虫枃浠跺す - string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); - new System.Threading.Thread(() => - { - try - { - var backuplist = FileUtils.ReadFiles(); - FileUtils.DeleteRegionFiles(oldRegionRootPath); - //绉诲姩鏂囦欢 - foreach (var fileName in backuplist) - { - System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); - if (fileInfo.Exists) - { - fileInfo.MoveTo(oldRegionRootPath + fileName); - MainPage.Log("move file : " + fileName); - } - } - } - catch (Exception ex) - { - MainPage.Log($"xxx:{ex.Message}"); - } - finally - { - FileUtils.DeleteAllFile(); - } - }).Start(); - #endregion - - UserInfo.Current.lastTime = DateTime.MinValue; - UserInfo.Current.SaveUserInfo(); - MainPage.GoLoginPage(UserInfo.Current); - DB_ResidenceData.residenceData.EixtAccount(); - } - - /// <summary> /// 閫�鍑鸿处鍙风櫥褰曚簨浠� /// </summary> void LoadEvent_Logout() { btnLogout.MouseUpEventHandler += (sender, e) => { - Action okAction = () => + #region 淇濆瓨鏈湴鏁版嵁鑷虫枃浠跺す + string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); + new System.Threading.Thread(() => { - Logout(); - }; - new ConfirmDialog().ShowDialog(StringId.Tip, StringId.IfConfirmLogout, okAction); + try + { + var backuplist = FileUtils.ReadFiles(); + FileUtils.DeleteRegionFiles(oldRegionRootPath); + //绉诲姩鏂囦欢 + foreach (var fileName in backuplist) + { + System.IO.FileInfo fileInfo = new System.IO.FileInfo(FileUtils.RootPath + fileName); + if (fileInfo.Exists) + { + fileInfo.MoveTo(oldRegionRootPath + fileName); + MainPage.Log("move file : " + fileName); + } + } + } + catch (Exception ex) + { + MainPage.Log($"xxx:{ex.Message}"); + } + finally + { + FileUtils.DeleteAllFile(); + } + }).Start(); + #endregion + + MainPage.LoginUser.lastTime = DateTime.MinValue; + MainPage.LoginUser.SaveUserInfo(); + MainPage.GoLoginPage(MainPage.LoginUser); + DB_ResidenceData.residenceData.EixtAccount(); }; } @@ -98,8 +85,7 @@ { baseView.RemoveFromParent(); }; - baseView.MouseUpEventHandler = (sender, e) => - { + baseView.MouseUpEventHandler = (sender, e) => { baseView.RemoveFromParent(); }; btnCancel.MouseUpEventHandler = (sender, e) => @@ -119,7 +105,7 @@ { if (imagePath != null) { - UserInfo.Current.headImagePagePath = imagePath.ToString(); + MainPage.LoginUser.headImagePagePath = imagePath.ToString(); userHeadImageView.ImagePath = imagePath.ToString(); updataHeadImage(); new System.Threading.Thread(() => @@ -127,7 +113,7 @@ new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); }) { IsBackground = true }.Start(); - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser.SaveUserInfo(); MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); } }), pid.ToString(), 1, 1); @@ -148,7 +134,7 @@ { if (imagePath != null) { - UserInfo.Current.headImagePagePath = imagePath.ToString(); + MainPage.LoginUser.headImagePagePath = imagePath.ToString(); userHeadImageView.ImagePath = imagePath.ToString(); updataHeadImage(); @@ -156,7 +142,7 @@ { new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); }) - { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); + { IsBackground = true }.Start(); MainPage.LoginUser.SaveUserInfo(); MainPage.Log("SelectPicture 瑁佸壀鍥剧墖杩斿洖璺緞: " + imagePath); } }, pid.ToString(), 1, 1); @@ -184,7 +170,7 @@ }.Show(bodyView); return; } - if (str == UserInfo.Current.userName) + if(str == MainPage.LoginUser.userName) { return; } @@ -197,8 +183,8 @@ var resultObj = new HttpServerRequest().EditUserName(str); if (resultObj.Code == StateCode.SUCCESS) { - UserInfo.Current.userName = str; - UserInfo.Current.SaveUserInfo(); + MainPage.LoginUser.userName = str; + MainPage.LoginUser.SaveUserInfo(); Application.RunOnMainThread(() => { btnUserName.Text = str; @@ -208,7 +194,7 @@ else { //澶辫触鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_UpdateMemberInfo, resultObj.Code); } } catch (Exception ex) @@ -225,7 +211,7 @@ }) { IsBackground = true }.Start(); }; - new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, UserInfo.Current.userName, callBack, StringId.UesrNameCannotBeEmpty, 0, new System.Collections.Generic.List<string>()); + new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, MainPage.LoginUser.userName, callBack, StringId.UesrNameCannotBeEmpty, 0, new System.Collections.Generic.List<string>()); }; btnUserName.MouseUpEventHandler = eventHandler; btnEditUserNameIcon.MouseUpEventHandler = eventHandler; @@ -237,65 +223,36 @@ /// </summary> void LoadEvent_ChangeBindEmail() { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { Action<string> action = (email) => { - - btnUserEmailInfo.Text = GetBindAccountText(email); + btnUserEmailInfo.Text = email; }; - if (CheckIfUnbound(btnUserEmailInfo.Text)) - { - //鏈粦瀹�,璺宠浆鏂扮粦瀹氶〉闈� - var aep = new NewBindAccountPage(); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(action); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else - { - var aep = new AccountBindInfoPage(); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(action, 1, StringId.EmailAddress); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - + var aep = new AccountBindInfoPage(); + MainPage.BasePageView.AddChidren(aep); + aep.LoadPage(action,1,StringId.EmailAddress); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnUserEmailInfo.MouseUpEventHandler = eventHandler; btnUserEmailRight.MouseUpEventHandler = eventHandler; userEmailInfoView.MouseUpEventHandler = eventHandler; } - /// <summary> /// 淇敼缁戝畾鎵嬫満 /// </summary> void LoadEvent_ChangeBindPhone() { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { Action<string> action = (phone) => { - btnUserPhoneInfo.Text = GetBindAccountText(phone); + btnUserPhoneInfo.Text = phone; }; - if (CheckIfUnbound(btnUserPhoneInfo.Text)) - { - //鏈粦瀹�,璺宠浆鏂扮粦瀹氶〉闈� - var aep = new NewBindAccountPage(); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(action, true); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - else - { - var aep = new AccountBindInfoPage(); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(action, 2, StringId.PhoneInfo); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - } - - + var aep = new AccountBindInfoPage(); + MainPage.BasePageView.AddChidren(aep); + aep.LoadPage(action, 2, StringId.PhoneInfo); + MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; btnUserPhoneInfo.MouseUpEventHandler = eventHandler; btnUserPhoneRight.MouseUpEventHandler = eventHandler; @@ -326,8 +283,7 @@ /// </summary> void LoadEvent_SkipModifyPassword() { - EventHandler<MouseEventArgs> eventHandler = (sender, e) => - { + EventHandler<MouseEventArgs> eventHandler = (sender, e) => { var page = new ResetPasswordOptionPage(); MainPage.BasePageView.AddChidren(page); page.LoadPage(); @@ -338,16 +294,5 @@ resetPasswordView.MouseUpEventHandler = eventHandler; } - /// <summary> - /// - /// </summary> - void GetUserInfo() - { - new System.Threading.Thread(() => - { - new HttpServerRequest().GetUserInfo(); - }) - { IsBackground = true }.Start(); - } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordOptionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordOptionPage.cs index 84e9419..d2e3ef1 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordOptionPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordOptionPage.cs @@ -93,7 +93,7 @@ { if (verificationOption == 0) { - if (string.IsNullOrEmpty( UserInfo.Current.userMobileInfo)) + if (string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo)) { LoadDialog_UnbindTipInfo(verificationOption); } @@ -102,13 +102,13 @@ this.RemoveFromParent(); var vcp = new ResetPasswordVerificationCodePage(); MainPage.BasePageView.AddChidren(vcp); - vcp.LoadPage(StringId.PhoneNumberVerification, true, UserInfo.Current.userMobileInfo); + vcp.LoadPage(StringId.PhoneNumberVerification,2); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } } else { - if (string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) + if (string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo)) { LoadDialog_UnbindTipInfo(verificationOption); } @@ -117,7 +117,7 @@ this.RemoveFromParent(); var vcp = new ResetPasswordVerificationCodePage(); MainPage.BasePageView.AddChidren(vcp); - vcp.LoadPage(StringId.EmailVerification, false, UserInfo.Current.userEmailInfo); + vcp.LoadPage(StringId.EmailVerification,1); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; } } @@ -134,8 +134,17 @@ dialogView.MouseUpEventHandler = (sender, e) => { dialog.Close(); }; - dialog.AddChidren(dialogView); - + + Button btnTitleIcon = new Button() + { + X = Application.GetRealWidth(108), + Y = Application.GetRealWidth(152), + Width = Application.GetRealWidth(160), + Height = Application.GetRealWidth(160), + UnSelectedImagePath = "PersonalCenter/ResetPassword/DialogTipTitleIcon.png" + }; + dialogView.AddChidren(btnTitleIcon); + FrameLayout contentView = new FrameLayout() { Gravity = Gravity.CenterHorizontal, @@ -147,19 +156,6 @@ }; dialogView.AddChidren(contentView); - Button btnTitleIcon = new Button() - { - X = Application.GetRealWidth(108), - Y = Application.GetRealWidth(152), - Width = Application.GetRealWidth(160), - Height = Application.GetRealWidth(160), - UnSelectedImagePath = "PersonalCenter/ResetPassword/DialogTipTitleIcon.png" - }; - dialogView.AddChidren(btnTitleIcon); - btnTitleIcon.MouseUpEventHandler = (sender, e) => { - dialog.Close(); - }; - Button btnMsg = new Button() { Gravity = Gravity.CenterHorizontal, @@ -168,7 +164,7 @@ Height = Application.GetRealWidth(62), TextColor = CSS_Color.MainColor, TextSize = CSS_FontSize.SubheadingFontSize, - TextID = verificationOption == 0 ? StringId.UnBindPhoneNumberCannotVerification: StringId.UnBindEmailCannotVerification, + TextID = verificationOption == 0?StringId.UnBindPhoneNumberCannotVerification: StringId.UnBindEmailCannotVerification, }; contentView.AddChidren(btnMsg); @@ -181,7 +177,7 @@ TextAlignment = TextAlignment.Center, Radius = (uint)Application.GetRealWidth(22), BackgroundColor = CSS_Color.MainColor, - TextID = StringId.GoBind, + TextID = StringId.PhoneNumberVerification, TextSize = CSS_FontSize.SubheadingFontSize, TextColor = CSS_Color.MainBackgroundColor, }; @@ -191,20 +187,10 @@ { dialog.Close(); Action<string> action = (obj) => { }; - //var vcp = new BindAccountPage(); - //MainPage.BasePageView.AddChidren(vcp); - //vcp.LoadPage(action, verificationOption == 0 ? StringId.BindPhone : StringId.BindEmail); - //MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - - //鏄惁涓烘崲缁戞墜鏈� - var isPhone = verificationOption == 0; - //璺宠浆鏂扮粦瀹氶〉闈� - var aep = new NewBindAccountPage(); - MainPage.BasePageView.AddChidren(aep); - aep.LoadPage(action, isPhone); + var vcp = new BindAccountPage(); + MainPage.BasePageView.AddChidren(vcp); + vcp.LoadPage(action, verificationOption == 0 ? StringId.BindPhone : StringId.BindEmail); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - - }; dialog.Show(); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs index ff630c4..5597092 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordPage.cs @@ -2,46 +2,12 @@ using Shared; using HDL_ON.UI.CSS; using HDL_ON.DAL.Server; -using System.Threading; namespace HDL_ON.UI { public partial class ResetPasswordPage : FrameLayout { - /// <summary> - /// 鏄惁鎵嬫満 - /// </summary> - public bool isPhone; - /// <summary> - /// 璐﹀彿 - /// </summary> - public string account; - /// <summary> - /// 楠岃瘉鐮� - /// </summary> - public string verCode; - - #region 鎺т欢View - /// <summary> - /// 瀵嗙爜鏂囨湰妗� - /// </summary> - EditText etPassword; - /// <summary> - /// 纭瀵嗙爜鏂囨湰妗� - /// </summary> - EditText etRepeatPassword; - - /// <summary> - /// 淇敼鎸夐挳 - /// </summary> - Button btnReset; - - /// <summary> - /// - /// </summary> FrameLayout bodyView; - #endregion - public ResetPasswordPage() { bodyView = this; @@ -49,267 +15,60 @@ public void LoadPage() { - bodyView.BackgroundColor = CSS_Color.BackgroundColor; + bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; new TopViewDiv(bodyView, Language.StringByID(StringId.ModifyPassword)).LoadTopView(); - #region 鏂板瘑鐮� - FrameLayout rowView = new FrameLayout() - { - Y = Application.GetRealHeight(64), - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - bodyView.AddChidren(rowView); - //鏂板瘑鐮� - Button btnTitle = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(180), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - Text = Language.StringByID(StringId.NewPassword) + ":" - }; - rowView.AddChidren(btnTitle); - etPassword = new EditText() - { - Width = Application.GetRealWidth(359), - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.TextFontSize, - SecureTextEntry = true, - TextAlignment = TextAlignment.CenterRight, - Foucs = true - }; - rowView.AddChidren(etPassword); - var lineView = new LineView(); - rowView.AddChidren(lineView); - lineView.Y = rowView.Height - lineView.Height; - #endregion - - #region 鍐嶆杈撳叆鏂板瘑鐮� - FrameLayout rowView2 = new FrameLayout() - { - Y = rowView.Bottom, - Height = Application.GetRealHeight(50), - BackgroundColor = CSS_Color.MainBackgroundColor, - }; - bodyView.AddChidren(rowView2); - - //鍐嶆杈撳叆鏂板瘑鐮� - Button btnTitle2 = new Button() - { - X = Application.GetRealWidth(16), - Width = Application.GetRealWidth(180), - TextColor = CSS_Color.FirstLevelTitleColor, - TextSize = CSS_FontSize.SubheadingFontSize, - TextAlignment = TextAlignment.CenterLeft, - //TextID = StringId.NewPasswordAgain, - Text = Language.StringByID(StringId.NewPasswordAgain) + ":" - }; - rowView2.AddChidren(btnTitle2); - - etRepeatPassword = new EditText() - { - Width = Application.GetRealWidth(359), - TextColor = CSS_Color.PromptingColor1, - TextSize = CSS_FontSize.TextFontSize, - SecureTextEntry = true, - TextAlignment = TextAlignment.CenterRight, - }; - rowView2.AddChidren(etRepeatPassword); - #endregion - - btnReset = new Button() - { - Gravity = Gravity.CenterHorizontal, - Y = Application.GetRealHeight(224), - Width = Application.GetRealWidth(220), - Height = Application.GetRealHeight(44), - Radius = (uint)Application.GetRealHeight(22), - SelectedBackgroundColor = CSS_Color.MainColor, - BackgroundColor = CSS_Color.PromptingColor1, - TextID = StringId.Confirm, - TextSize = CSS_FontSize.SubheadingFontSize, - TextColor = CSS_Color.MainBackgroundColor, - TextAlignment = TextAlignment.Center, - }; - bodyView.AddChidren(btnReset); - - LoadEvent_Reset(); - LoadEvent_EditTextFcousChange(); } } public partial class ResetPasswordPage { - - /// <summary> - /// 鎸囧畾鍏抽棴椤甸潰涓暟 - /// </summary> - /// <param name="countPage"></param> - void ClosePageWithCount(int countPage) + public void ResetPassword(string password,string repeatPassword ) { - //鍏抽棴澶氬皯涓〉闈� - for (int i = 0; i < countPage; i++) - { - MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - } - } - - /// <summary> - /// - /// </summary> - /// <param name="password"></param> - void ResetPassword(string password) - { - - //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 - if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) - { - new Tip() - { - CloseTime = 1, - Direction = AMPopTipDirection.None, - Text = Language.StringByID(StringId.PasswordIsUnqualified) - }.Show(bodyView); - return; - } - - //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� - if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) - { - new Tip() - { - CloseTime = 1, - Direction = AMPopTipDirection.None, - Text = Language.StringByID(StringId.IncorrectRepeatPassword) - }.Show(bodyView); - - return; - } - var waitPage = new Loading(); waitPage.Start("Please wait..."); - - new Thread(() => + var resetResult = new HttpServerRequest().ResetPassword(MainPage.LoginUser.accountString, password, repeatPassword, 86); + if (resetResult.StateCode.ToUpper() == StateCode.SUCCESS) { - try + Application.RunOnMainThread(() => { - // 蹇樿瀵嗙爜 - var resultObj = new HttpServerRequest().ForgetPassword(account, password, verCode, isPhone); - if (resultObj.Code == StateCode.SUCCESS) - { - Application.RunOnMainThread(() => - { - Utlis.ShowTip(Language.StringByID(StringId.PasswordChangeSuccessfully)); - ClosePageWithCount(2); - }); - } - else - { - // 鎻愮ず閿欒 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - } - catch { } - finally - { - Application.RunOnMainThread(() => - { - waitPage.Hide(); - }); - } - }) - { IsBackground = true }.Start(); + var page = new OperationResultDisPalyPage(); + page.Show(); + page.LoadPage(true, Language.StringByID(StringId.UnbindEmail), Language.StringByID(StringId.UnbindEmailSuccess), ""); - } - - /// <summary> - /// 鍔犺浇鏂瑰紡鎸夐挳浜嬩欢 - /// </summary> - void LoadEvent_Reset() - { - btnReset.MouseUpEventHandler += (sender, e) => - { - if (btnReset.IsSelected) - { - ResetPassword(etPassword.Text.ToString()); - } - }; - } - - /// <summary> - /// 鍔犺浇鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� - /// </summary> - void LoadEvent_EditTextFcousChange() { - //瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� - etPassword.FoucsChanged += (sender, e) => - { - if (etPassword.Foucs) - { - - } - else - { - //鏍¢獙瀵嗙爜鏄惁绗﹀悎瑕佹眰 - if (etPassword.Text.Trim().Length < 6 || etPassword.Text.Trim().Length > 13) + for (int i = 0; i < 2; i++) { - new Tip() - { - CloseTime = 1, - Direction = AMPopTipDirection.None, - Text = Language.StringByID(StringId.PasswordIsUnqualified) - }.Show(bodyView); + MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); } - else - { - LoadMothed_EnableResetButton(); - } - } - }; - - //纭瀵嗙爜鏂囨湰妗嗙劍鐐瑰彉鍖栦簨浠� - etRepeatPassword.FoucsChanged += (sender, e) => - { - if (etRepeatPassword.Foucs) - { - - } - else - { - //鏍¢獙涓ゆ杈撳叆鐨勫瘑鐮佹槸鍚︿竴鑷� - if (etPassword.Text.Trim() != etRepeatPassword.Text.Trim()) - { - new Tip() - { - CloseTime = 1, - Direction = AMPopTipDirection.None, - Text = Language.StringByID(StringId.IncorrectRepeatPassword) - }.Show(bodyView); - } - else - { - LoadMothed_EnableResetButton(); - } - } - }; - - } - - /// <summary> - /// 浣胯兘淇敼纭畾鎸夐挳 - /// </summary> - void LoadMothed_EnableResetButton() - { - if (!string.IsNullOrEmpty(etPassword.Text) && (etPassword.Text.Trim() == etRepeatPassword.Text.Trim())) - { - btnReset.IsSelected = true; + }); } else { - btnReset.IsSelected = false; + string erorrInfo = ""; + switch (resetResult.StateCode) + { + case "PwdNoConfirm"://涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷� + erorrInfo = Language.StringByID(StringId.IncorrectRepeatPassword); + break; + case "AccountNoExists"://涓ゆ杈撳叆鐨勫瘑鐮佷笉涓�鑷� + erorrInfo = Language.StringByID(StringId.AccountNotExist); + break; + default: + erorrInfo = "Server error"; + break; + } + Application.RunOnMainThread(() => + { + waitPage.Hide(); + new Tip() + { + CloseTime = 1, + Direction = AMPopTipDirection.None, + Text = erorrInfo, + }.Show(bodyView); + }); } } } diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs index 4f3ed20..812f139 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/ResetAccountPassword/ResetPasswordVerificationCodePage.cs @@ -32,55 +32,25 @@ Button btnResend; - /// <summary> - /// - /// </summary> - Button btnTip; - int titleId; - ///// <summary> - ///// 鎿嶄綔绫诲瀷 1:閭锛�2:鎵嬫満 - ///// </summary> - //int optionType; /// <summary> - /// 鏄惁鎵嬫満 + /// 鎿嶄綔绫诲瀷 1:閭锛�2:鎵嬫満 /// </summary> - bool isPhone; - /// <summary> - /// 璐﹀彿 - /// </summary> - string account; - - + int optionType; public ResetPasswordVerificationCodePage() { bodyView = this; } - /// <summary> - /// - /// </summary> - /// <param name="tId"></param> - /// <param name="isPhone">鏄惁鎵嬫満</param> - /// <param name="account">璐﹀彿</param> - public void LoadPage(int tId, bool isPhone, string account) + public void LoadPage(int tId, int ot) { titleId = tId; - this.isPhone = isPhone; - this.account = account; + optionType = ot; bodyView.BackgroundColor = CSS_Color.BackgroundColor; + new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); - Action backAction = () => - { - Application.HideSoftInput(); - BackConfirmAction(); - }; - new TopViewDiv(bodyView, Language.StringByID(tId), false).LoadTopView(backAction); - - //new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); - - btnTip = new Button() + Button btnTip = new Button() { Y = Application.GetRealHeight(64), X = Application.GetRealWidth(16), @@ -397,12 +367,12 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum1.Text = ""; - btnNum2.Text = ""; - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; + btnNum1Line.Text = ""; + btnNum2Line.Text = ""; + btnNum3Line.Text = ""; + btnNum4Line.Text = ""; + btnNum5Line.Text = ""; + btnNum6Line.Text = ""; break; case 1: btnNum2Line.IsSelected = true; @@ -418,11 +388,11 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum2.Text = ""; - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; + btnNum2Line.Text = ""; + btnNum3Line.Text = ""; + btnNum4Line.Text = ""; + btnNum5Line.Text = ""; + btnNum6Line.Text = ""; break; case 2: btnNum3Line.IsSelected = true; @@ -438,10 +408,10 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum3.Text = ""; - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; + btnNum3Line.Text = ""; + btnNum4Line.Text = ""; + btnNum5Line.Text = ""; + btnNum6Line.Text = ""; break; case 3: btnNum4Line.IsSelected = true; @@ -457,9 +427,9 @@ btnNum4Line.Height = Application.GetRealHeight(2); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum4.Text = ""; - btnNum5.Text = ""; - btnNum6.Text = ""; + btnNum4Line.Text = ""; + btnNum5Line.Text = ""; + btnNum6Line.Text = ""; break; case 4: btnNum5Line.IsSelected = true; @@ -475,8 +445,8 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(2); btnNum6Line.Height = Application.GetRealHeight(1); - btnNum5.Text = ""; - btnNum6.Text = ""; + btnNum5Line.Text = ""; + btnNum6Line.Text = ""; break; case 5: btnNum6Line.IsSelected = true; @@ -492,74 +462,61 @@ btnNum4Line.Height = Application.GetRealHeight(1); btnNum5Line.Height = Application.GetRealHeight(1); btnNum6Line.Height = Application.GetRealHeight(2); - btnNum6.Text = ""; + btnNum6Line.Text = ""; break; case 6: btnNum6.Text = etCode.Substring(5, 1); et.Foucs = false; - //杈撳叆瀹屾垚 - InputComplete(etCode); + new Thread(() => + { + bool result = false; + Action act = () => { }; + Application.RunOnMainThread(() => + { + act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait)); + }); + bool isPhone = optionType == 2; + var resultObj = new HttpServerRequest().ValidatorCode(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userEmailInfo, etCode, isPhone); + if (resultObj.Code == StateCode.SUCCESS) + { + result = true; + } + else + { + //澶辫触鎻愮ず + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Check, resultObj.Code); + } + Application.RunOnMainThread(() => + { + act(); + }); + if (result) + { + Application.RunOnMainThread(() => + { + new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true); + }); + Thread.Sleep(1600); + Application.RunOnMainThread(() => + { + MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); + if (titleId == StringId.EmailVerification) + { + + } + else if (titleId == StringId.PhoneNumberVerification) + { + + } + }); + } + }) + { IsBackground = true }.Start(); + break; } }; } - - /// <summary> - /// 杈撳叆瀹屾垚 - /// </summary> - /// <param name="etCode"></param> - void InputComplete(string etCode) - { - new Thread(() => - { - bool result = false; - Action act = () => { }; - Application.RunOnMainThread(() => - { - act = new PublicAssmebly().TipLoadingMsgDialog(Language.StringByID(StringId.SavingPleaseWait)); - }); - - var resultObj = new HttpServerRequest().ValidatorCode(VerifyType.FIND_PASSWORD, account, etCode, isPhone, false); - if (resultObj.Code == StateCode.SUCCESS) - { - result = true; - } - else - { - //澶辫触鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - Application.RunOnMainThread(() => - { - act(); - }); - if (result) - { - Application.RunOnMainThread(() => - { - new PublicAssmebly().TipMsgAutoClose(Language.StringByID(StringId.ValidationSuccessful), true); - }); - Thread.Sleep(1600); - Application.RunOnMainThread(() => - { - - //MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); - this.RemoveFromParent(); - var vcp = new ResetPasswordPage(); - vcp.isPhone = isPhone; - vcp.account = account; - vcp.verCode = etCode; - MainPage.BasePageView.AddChidren(vcp); - vcp.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - - }); - } - }) - { IsBackground = true }.Start(); - } - - /// <summary> /// 閲嶅彂楠岃瘉鐮佺瓑寰呯嚎绋� /// </summary> @@ -567,102 +524,47 @@ { btnResend.IsSelected = false; int time = 60; - try + + new Thread(() => { - new Thread(() => + if (optionType == 1) { - //2.2 鑾峰彇楠岃瘉鐮� - ResponsePackNew resultObj; - if (!isPhone) - { - resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, account); - } - else - { - resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, account, true, UserInfo.Current.areaCode.ToString()); - } + var resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userEmailInfo); - if (resultObj.Code != StateCode.SUCCESS) - { - //鍙戦�佸け璐� - Application.RunOnMainThread(() => - { - btnTip.TextID = StringId.FailedToSendVerificationCode; - }); - //澶辫触鎻愮ず - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); - } - else - { - //鍙戦�佹垚鍔燂紝寮�濮嬪�掕鏃� - Application.RunOnMainThread(() => - { - btnTip.TextID = StringId.VerificationCodePrompt; - }); - - while (time > 0) - { - time--; - Application.RunOnMainThread(() => - { - btnResend.Text = time.ToString() + "s"; - }); - Thread.Sleep(1000); - } - Application.RunOnMainThread(() => - { - btnResend.IsSelected = true; - btnResend.TextID = StringId.GetVerificationCode; - }); - } - }) - { IsBackground = true }.Start(); - } - - catch { } - finally + } + else if (optionType == 2) + { + var resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString() ); + } + }) + { IsBackground = true }.Start(); + new Thread(() => { - - }; + while (time > 0) + { + time--; + Application.RunOnMainThread(() => + { + btnResend.Text = time.ToString() + "s"; + }); + Thread.Sleep(1000); + } + Application.RunOnMainThread(() => + { + btnResend.IsSelected = true; + btnResend.TextID = StringId.GetVerificationCode; + }); + }) + { IsBackground = true }.Start(); } - /// <summary> /// 閲嶅彂楠岃瘉鐮佷簨浠� /// </summary> void LoadEvent_Resend() { - btnResend.MouseUpEventHandler = (sender, e) => - { + btnResend.MouseUpEventHandler = (sender, e) => { LoadThread_SendVerCode(); }; - } - - /// <summary> - /// 杩斿洖浜屾纭浜嬩欢 - /// </summary> - void BackConfirmAction() - { - //楠岃瘉鐮佸彂閫佹垚鍔燂紝浜屾纭閫�鍑� - if (btnTip.TextID == StringId.VerificationCodePrompt) - { - Action cancelAction = () => - { - if (bodyView != null) - { - bodyView.RemoveFromParent(); - } - }; - new ConfirmDialog().ShowDialog(StringId.Tip, StringId.VerificationCodeMayBeDelayed, null, cancelAction, StringId.ReturnStr, StringId.WaitAMoment); - } - else - { - //鐩存帴鍏抽棴 - if (bodyView != null) - { - bodyView.RemoveFromParent(); - } - - } } } } \ No newline at end of file diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs index c741f27..0bf95fc 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/RoomListManage/ResidentialManagePageBLL.cs @@ -49,7 +49,7 @@ { Application.RunOnMainThread(() => { - // UserInfo.Current.regionList.Find((obj) => obj.Name == btnResidenceName.Text.Trim()).Name = str; + //MainPage.LoginUser.regionList.Find((obj) => obj.Name == btnResidenceName.Text.Trim()).Name = str; btnResidenceName.Text = str; upateResidenceName(); }); diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs index 901a5ab..73c2bd2 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockGesturePage.cs @@ -279,12 +279,12 @@ { if (optionType == "7") { - MainPage.GoLoginPage( UserInfo.Current); + MainPage.GoLoginPage(MainPage.LoginUser); } else { Action<string> action = (pw) => { - var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.accountString, pw); + var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); if (resultObj.Code == StateCode.SUCCESS) { OnAppConfig.Instance.appUnlockPasswrod = ""; @@ -296,7 +296,7 @@ else { //鐧诲綍澶辫触 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, resultObj.Code); } }; diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs index 4186d06..0aa9709 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/UnlockSetting/AppUnlockPasswordPage.cs @@ -363,12 +363,12 @@ { if (optionType == "7") { - MainPage.GoLoginPage( UserInfo.Current); + MainPage.GoLoginPage(MainPage.LoginUser); } else { Action<string> action = (pw) => { - var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.accountString, pw); + var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); if (resultObj.Code.ToUpper() == StateCode.SUCCESS) { OnAppConfig.Instance.appUnlockPasswrod = ""; @@ -380,7 +380,7 @@ else { //鐧诲綍澶辫触 - IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); + IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, resultObj.Code); } }; -- Gitblit v1.8.0