Revert "Merge branch 'CJL' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into CJL"
This reverts commit eb51679c618d5027070fbd6f3c0519f0f17e7d7d, reversing
changes made to abc4e92e199962da76ae58c611f2616066053194.
6个文件已添加
34个文件已修改
1 文件已重命名
| | |
| | | // UserConfig.Instance.IsAppStoreVersionNewer = Harpy.Harpy.SharedInstance.TestIsAppStoreVersionNewer; |
| | | // UserConfig.Instance.StoreVersion = Harpy.Harpy.SharedInstance.CurrentAppStoreVersion; |
| | | // UserConfig.Instance.SaveUserConfig(); |
| | | // if (Shared.SimpleControl.MainPage.LoginUser.AccountString == @"464027401@qq.com") |
| | | // if (Shared.SimpleControl. UserInfo.Current.AccountString == @"464027401@qq.com") |
| | | // { |
| | | // return $"TestIsAppStoreVersionNewer : {UserConfig.Instance.IsAppStoreVersionNewer};; CurrentAppStoreVersion : {UserConfig.Instance.StoreVersion}"; |
| | | // } |
| | |
| | | |
| | | string nsCount = NSLocale.CurrentLocale.CountryCode; |
| | | |
| | | if (MainPage.LoginUser != null && nsCount != MainPage.LoginUser.areaCode.ToString()) |
| | | if ( UserInfo.Current != null && nsCount != UserInfo.Current.areaCode.ToString()) |
| | | { |
| | | int.TryParse(nsCount,out MainPage.LoginUser.areaCode); |
| | | //int.TryParse(nsCount,out UserInfo.Current.areaCode); |
| | | //2020-11-18 |
| | | UserInfo.Current.areaCode = nsCount; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | | } |
| | | application.IdleTimerDisabled = true; |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | // try |
| | | // { |
| | | // System.Threading.Thread.Sleep(200); |
| | | // //if (!MainPage.LoginUser.IsLogin) { |
| | | // //if (! UserInfo.Current.IsLogin) { |
| | | // // continue; |
| | | // //} |
| | | // if (!CommonPage.IsRemote) continue; |
| | |
| | | |
| | | // var topicFilterPush2 = new TopicFilter |
| | | // { |
| | | // Topic = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze, |
| | | // Topic = $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze, |
| | | // QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce, |
| | | // //QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.ExactlyOnce |
| | | // }; |
| | |
| | | // return; |
| | | // } |
| | | |
| | | // if (!MainPage.LoginUser.IsLogin) |
| | | // if (! UserInfo.Current.IsLogin) |
| | | // { |
| | | // return; |
| | | // } |
| | |
| | | // // ReceiveNotifySqueezeAsync (mMes); |
| | | // //} else |
| | | |
| | | // if (topic == $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze) |
| | | // if (topic == $"/BusGateWayToClient/{ UserInfo.Current.ID}" + PushNotifySqueeze) |
| | | // { |
| | | // var mMes = System.Text.Encoding.UTF8.GetString(e.ApplicationMessage.Payload); |
| | | // //新挤下线主题方案 收到挤下线主题 |
| | |
| | | // var username = MqttInfoConfig.Instance.mMqttInfo.connEmqUserName; |
| | | // var passwordRemote = MqttInfoConfig.Instance.mMqttInfo.connEmqPwd; |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; |
| | | // //获取参数成功,保存到本地并标记为true |
| | | |
| | | // MqttInfoConfig.Instance.IfGetMqttInfoSuccess = true; |
| | |
| | | |
| | | // //断开远程连接 |
| | | // CommonPage.IsRemote = false; |
| | | // if (!MainPage.LoginUser.IsLogin) |
| | | // if (! UserInfo.Current.IsLogin) |
| | | // { |
| | | // return; |
| | | // } |
| | | |
| | | // DisConnectRemoteMqttClient("挤下线"); |
| | | |
| | | // MainPage.LoginUser.LastTime = DateTime.MinValue; |
| | | // MainPage.LoginUser.SaveUserInfo(); |
| | | // UserInfo.Current.LastTime = DateTime.MinValue; |
| | | // UserInfo.Current.SaveUserInfo(); |
| | | // Room.Lists.Clear(); |
| | | // ////删除推送数据 |
| | | // //var webclient = new System.Net.WebClient (); |
| | | // //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, MainPage.LoginUser.LoginTokenString); |
| | | // //webclient.Headers.Add (System.Net.HttpRequestHeader.Authorization, UserInfo.Current.LoginTokenString); |
| | | // //webclient.DownloadStringAsync (new Uri ("https://global.hdlcontrol.com/HangZhouHdlCloudApi/ZigbeeUsers/SignOut")); |
| | | |
| | | |
| | |
| | | // Application.RunOnMainThread(() => |
| | | // { |
| | | // Utlis.ShowAppLinkStatus(AppLinkStatus.WiFi); |
| | | // new Shared.SimpleControl.Phone.AccountLogin(MainPage.LoginUser.AccountString, "").Show(); |
| | | // new Shared.SimpleControl.Phone.AccountLogin( UserInfo.Current.AccountString, "").Show(); |
| | | // SharedMethod.SharedMethod.CurPageLayout = null; |
| | | // //CommonPage.IsRemote = false; |
| | | |
| | |
| | | // //2020-06-30 删除推送数据 |
| | | // ForceUpdateUtlis.Current.SignOut(); |
| | | //#if HDL |
| | | // if (!String.IsNullOrEmpty (MainPage.LoginUser.AllVisionRegisterDevUserNameGuid)) { |
| | | // if (!String.IsNullOrEmpty ( UserInfo.Current.AllVisionRegisterDevUserNameGuid)) { |
| | | // com.freeview.global.Video.Logout (); |
| | | // }///BusGateWayToClient/320c1fea-1866-4708-8277-e2321a4dd236/NotifyGateWayInfoChange |
| | | //#endif |
| | |
| | | // await RemoteMqttClient.PublishAsync(new MqttApplicationMessage { Topic = topicName, Retain = false, QualityOfServiceLevel = MQTTnet.Protocol.MqttQualityOfServiceLevel.AtMostOnce }); |
| | | // break; |
| | | // case 4://发布新方案的挤下线主题 |
| | | // topicName = $"/BusGateWayToClient/{MainPage.LoginUser.ID}" + PushNotifySqueeze; |
| | | // topicName = $"/BusGateWayToClient/{ UserInfo.Current.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; |
| | |
| | | // { |
| | | // var mqttInfoRequestPar = new GetConnMqttInfoObj() |
| | | // { |
| | | // LoginAccessToken = MainPage.LoginUser.LoginTokenString, |
| | | // LoginAccessToken = UserInfo.Current.LoginTokenString, |
| | | // PlatformStr = GetRandomKey(), |
| | | // PublishPayloadJsonStr = PushSignStr, |
| | | // Mac = UserConfig.Instance.GatewayMAC, |
| | |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo = mqttInfoRequestResult_Obj.AccountAllGateways.Find((obj) => obj.mac == UserConfig.Instance.GatewayMAC); |
| | | // if (MqttInfoConfig.Instance.CurRemoteMACInfo != null) |
| | | // { |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.LoginTokenString; |
| | | // //MqttInfoConfig.Instance.CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.LoginTokenString; |
| | | // MqttInfoConfig.Instance.CurRemoteMACInfo.clientId = clientId; |
| | | // //----第三步 开始连接 |
| | | // await MQTTConnectAsync(); |
| | |
| | | using System; |
| | | namespace HDL_ON.Common |
| | | using Shared; |
| | | using System.Text.RegularExpressions; |
| | | |
| | | namespace HDL_ON |
| | | { |
| | | /// <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 ■ 各种正则检测_______________________ |
| | | /// <summary> |
| | | /// 用于中国大陆验证手机号正则表达式 |
| | | /// 以1开头,11位 |
| | | /// </summary> |
| | | public static string PhoneRegexStr = "^[1][0-9]{10}$"; |
| | | /// <summary> |
| | | /// 用于验证非中国大陆手机号正则表达式 |
| | | /// </summary> |
| | | public static string PhoneForForeignRegexStr = "^[0-9]*$"; |
| | | /// <summary> |
| | | /// 用于验证邮箱正则表达式 |
| | | /// </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">地区代码</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 |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | |
| | | { |
| | | //追加:没有远程连接的权限 |
| | | if (remoteMqttIsConnecting |
| | | || remoteIsConnected || !MainPage.LoginUser.IsLogin) |
| | | || remoteIsConnected || ! UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | |
| | | var mqttInfoRequestPar = new RemoteRequestParameters() |
| | | { |
| | | PlatformStr = "ON", |
| | | LoginAccessToken = MainPage.LoginUser.loginTokenString, |
| | | LoginAccessToken = UserInfo.Current.loginTokenString, |
| | | RequestVersion = MainPage.VersionString, |
| | | RequestProtocolType = 0, |
| | | RequestSource = 1, |
| | |
| | | } |
| | | if (CurRemoteMACInfo != null) |
| | | { |
| | | CurRemoteMACInfo.LoginAccessToken = MainPage.LoginUser.loginTokenString; |
| | | CurRemoteMACInfo.LoginAccessToken = UserInfo.Current.loginTokenString; |
| | | CurRemoteMACInfo.clientId = clientId; |
| | | mqttEncryptKey = CurRemoteMACInfo.isNewBusproGateway ? CurRemoteMACInfo.aesKey : ""; |
| | | |
| | |
| | | //static void ReceiveNotifyBusGateWayInfoChange() |
| | | //{ |
| | | // var gatewayListUrl = @"https://developer.hdlcontrol.com/Center/Center/GetGatewayPagger"; //App、Buspro软件登录后获取网关列表 http 请求 |
| | | // var gatewayListRequestPar = new RemoteRequestParameters() { Mac = CurRemoteMACInfo.mac, LoginAccessToken = MainPage.LoginUser.loginTokenString, RequestVersion = "RequestVersion1", RequestProtocolType = 0, RequestSource = 1 }; |
| | | // var gatewayListRequestPar = new RemoteRequestParameters() { Mac = CurRemoteMACInfo.mac, LoginAccessToken = UserInfo.Current.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) |
| | |
| | | if (mMes == PushSignStr) return;//是自己的登录推送不处理 |
| | | //断开远程连接 |
| | | MainPage.IsRemote = false; |
| | | if (!MainPage.LoginUser.IsLogin) |
| | | if (! UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | | MainPage.LoginUser.lastTime = DateTime.MinValue; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.lastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | new System.Threading.Thread(() => |
| | |
| | | DisConnectRemoteMqttClient("挤下线"); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | MainPage.GoLoginPage(MainPage.LoginUser); |
| | | MainPage.GoLoginPage( UserInfo.Current); |
| | | }); |
| | | } |
| | | |
| | |
| | | webClient.Headers.Add("CONTENT-TYPE", "application/json"); |
| | | if (needAuthorization) |
| | | { |
| | | webClient.Headers.Add("Authorization", MainPage.LoginUser.loginTokenString); |
| | | webClient.Headers.Add("Authorization", UserInfo.Current.loginTokenString); |
| | | } |
| | | byte[] bytes = null; |
| | | try |
| | |
| | | try |
| | | { |
| | | |
| | | //if (string.IsNullOrEmpty (urlHead)) { |
| | | // urlHead = APIInfoConfig.Current.RequestHttpsHost; |
| | | //if (string.IsNullOrEmpty(urlHead)) |
| | | //{ |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | |
| | |
| | | |
| | | if (string.IsNullOrEmpty(replaceToken)) |
| | | { |
| | | if (MainPage.LoginUser != null) |
| | | if(UserInfo.Current != null) |
| | | {/* 如果不需要验证Token可以不用传入 */ |
| | | request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); |
| | | request.AddHeader("Authorization", UserInfo.Current.loginTokenString); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(ex.Message); |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(response.Content); |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(ex.Message); |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | } |
| | | |
| | |
| | | try |
| | | { |
| | | //if (string.IsNullOrEmpty (urlHead)) { |
| | | // urlHead = APIInfoConfig.Current.RequestHttpsHost; |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | |
| | |
| | | |
| | | if (string.IsNullOrEmpty(replaceToken)) |
| | | { |
| | | if (MainPage.LoginUser != null) |
| | | if ( UserInfo.Current != null) |
| | | {/* 如果不需要验证Token可以不用传入 */ |
| | | request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); |
| | | request.AddHeader("Authorization", UserInfo.Current.loginTokenString); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(ex.Message); |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return null; |
| | | } |
| | | #endregion |
| | |
| | | { |
| | | |
| | | //if (string.IsNullOrEmpty (urlHead)) { |
| | | // urlHead = APIInfoConfig.Current.RequestHttpsHost; |
| | | // urlHead = UserInfo.Current.RequestHttpsHost; |
| | | //} |
| | | //string requestFullUrl = urlHead + apiPath; |
| | | |
| | |
| | | |
| | | if (string.IsNullOrEmpty(replaceToken)) |
| | | { |
| | | if (MainPage.LoginUser != null) |
| | | if ( UserInfo.Current != null) |
| | | {/* 如果不需要验证Token可以不用传入 */ |
| | | request.AddHeader("Authorization", MainPage.LoginUser.loginTokenString); |
| | | request.AddHeader("Authorization", UserInfo.Current.loginTokenString); |
| | | } |
| | | } |
| | | else |
| | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(ex.Message); |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "DATA_EXCEPTION" }; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(response.Content); |
| | | HDL_ON.Utlis.WriteLine(response.Content); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | } |
| | | |
| | | } |
| | | catch (Exception ex) |
| | | { |
| | | HDL_ON.Common.Utlis.WriteLine(ex.Message); |
| | | HDL_ON.Utlis.WriteLine(ex.Message); |
| | | return new ResponsePackNew() { Code = "NETWORK_ERROR" }; |
| | | } |
| | | |
| | |
| | | string str = string.Empty; |
| | | foreach (KeyValuePair<string, object> item in paramDictionary) |
| | | { |
| | | //Value为null不参加校验 |
| | | if (item.Value != null) |
| | | { |
| | | str += item.Key + "=" + item.Value.ToString() + "&"; |
| | | //Value.ToString()为null或者""也不参加校验 |
| | | if (!string.IsNullOrEmpty(item.Value.ToString())) |
| | | { |
| | | //如果是bool类型,要转小写 |
| | | if (item.Value is bool) |
| | | { |
| | | str += item.Key + "=" + item.Value.ToString().ToLower() + "&"; |
| | | } |
| | | else |
| | | { |
| | | str += item.Key + "=" + item.Value.ToString() + "&"; |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | //2.3 拼接SECRET_KEY |
| | | str = str.Substring(0, str.Length - 1) + SECRET_KEY; |
| | | //2.4 MD5转换+转小写 |
| | |
| | | try |
| | | { |
| | | //账号没登录不回复 |
| | | if (MainPage.LoginUser == null || !MainPage.LoginUser.IsLogin) |
| | | if ( UserInfo.Current == null || ! UserInfo.Current.IsLogin) |
| | | { |
| | | return; |
| | | } |
| | | |
| | | Control.ins.ChangeCommunicationMode(CommunicationMode.tcp_local_server); |
| | | var sendStr = MainPage.LoginUser.accountString; |
| | | var sendStr = UserInfo.Current.accountString; |
| | | if (usefullBytes.Length == 0) |
| | | { |
| | | SendRemark(sendStr); |
| | |
| | | { |
| | | get |
| | | { |
| | | if (MainPage.LoginUser != null && Entity.DB_ResidenceData.residenceData != null) |
| | | if ( UserInfo.Current != null && Entity.DB_ResidenceData.residenceData != null) |
| | | { |
| | | return Entity.DB_ResidenceData.residenceData.GatewayType == 0 ? 6000 : 8585; |
| | | } |
| | |
| | | } |
| | | else |
| | | { |
| | | var curRegion = MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == CurReginID); |
| | | var curRegion = UserInfo.Current.regionList.Find((obj) => obj.RegionID == CurReginID); |
| | | //if (curRegion == null) |
| | | //{ |
| | | // CurReginID = MainPage.LoginUser.regionList[0].RegionID; |
| | | // return MainPage.LoginUser.regionList[0]; |
| | | // CurReginID = UserInfo.Current.regionList[0].RegionID; |
| | | // return UserInfo.Current.regionList[0]; |
| | | //} |
| | | return curRegion; |
| | | } |
| | |
| | | { |
| | | void LoadOption() |
| | | { |
| | | if (MainPage.LoginUser == null) |
| | | if ( UserInfo.Current == null) |
| | | { |
| | | return; |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 通用二次确认界面 |
| | | /// 可以自定义按钮文字 |
| | | /// </summary> |
| | | public class ConfirmDialog : Dialog |
| | | { |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | public ConfirmDialog() |
| | | { |
| | | |
| | | } |
| | | |
| | | /// <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> |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | using 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; |
| | | } |
| | | } |
| | | } |
| | |
| | | /// </summary> |
| | | FrameLayout contentView; |
| | | |
| | | |
| | | /// <summary> |
| | | /// 后退按钮 |
| | | /// </summary> |
| | |
| | | string title; |
| | | |
| | | /// <summary> |
| | | /// 是否需要关闭页面 |
| | | /// </summary> |
| | | bool needClose = true; |
| | | |
| | | /// <summary> |
| | | /// 后退时触发对事件 |
| | | /// </summary> |
| | | Action backAction; |
| | |
| | | } |
| | | |
| | | /// <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> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="dialog">显示的dialog</param> |
| | |
| | | { |
| | | btnBack.MouseUpEventHandler = (sender, e) => { |
| | | backAction?.Invoke(); |
| | | if (baseView != null) |
| | | if (needClose) |
| | | { |
| | | baseView.RemoveFromParent(); |
| | | } |
| | | if (baseDialog != null) |
| | | { |
| | | baseDialog.Close(); |
| | | if (baseView != null) |
| | | { |
| | | baseView.RemoveFromParent(); |
| | | } |
| | | if (baseDialog != null) |
| | | { |
| | | baseDialog.Close(); |
| | | } |
| | | } |
| | | }; |
| | | } |
New file |
| | |
| | | using 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(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using System; |
| | | using Shared; |
| | | #if __IOS__ |
| | | using UIKit; |
| | | #endif |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// TextButton |
| | | /// 解决iOS 文本到边框有边距问题 |
| | | /// </summary> |
| | | public class TextButton : Button |
| | | { |
| | | public TextButton() |
| | | { |
| | | #if __IOS__ |
| | | //重写修改文本到边框的内边距为0 |
| | | (this.uiView as MyButton).ContentEdgeInsets = new UIEdgeInsets(0, 0, 0, 0); |
| | | #endif |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | |
| | | { |
| | | if (registerType == 0) |
| | | return; |
| | | etAccount.IsNumberKeyboardType = true; |
| | | etAccount.Text = registerPhone; |
| | | etPassword.Text = ""; |
| | | etRepeatPassword.Text = ""; |
| | |
| | | { |
| | | if (registerType == 1) |
| | | return; |
| | | etAccount.IsNumberKeyboardType = false; |
| | | etAccount.Text = registerEmail; |
| | | etPassword.Text = ""; |
| | | etRepeatPassword.Text = ""; |
| | |
| | | { |
| | | 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 (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11) |
| | | if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) |
| | | { |
| | | btnGetVerificationCode_Phone.IsSelected = false; |
| | | } |
| | |
| | | } |
| | | else//邮箱获取验证码按钮生效条件 |
| | | { |
| | | if (!mFalg.Success) |
| | | if (!Utlis.CheckEmail(etAccount.Text.Trim())) |
| | | { |
| | | btnGetVerificationCode_Mail.IsSelected = false; |
| | | } |
| | |
| | | //手机方式-验证手机号码是否正确 |
| | | if (registerType == 0) |
| | | { |
| | | 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)) |
| | | btnGetVerificationCode_Phone.IsSelected = false; |
| | | if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | |
| | | { |
| | | btnGetVerificationCode_Mail.IsSelected = false; |
| | | //邮箱方式-验证邮箱是否正确 |
| | | 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 ) |
| | | if (!Utlis.CheckEmail(etAccount.Text.Trim())) |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | |
| | | } |
| | | |
| | | /// <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() |
| | |
| | | var result = pm.GetRegionByAccount(account); |
| | | if (result.Code != StateCode.SUCCESS) |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //2.已经注册过,发送验证码找回密码 |
| | | //2.1检测当前配置域名是否一致,不一致则替换 |
| | | CheckAndSetUserRequestHost(result); |
| | | |
| | | //2.2已经注册过,发送验证码找回密码 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //短信发送间隔60s |
| | |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | } |
| | | }) |
| | |
| | | waitPage.Hide(); |
| | | }); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_ForgetPwd, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | }); |
| | | } |
| | |
| | | }; |
| | | |
| | | //跳转国家区号选择界面 |
| | | 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; |
| | |
| | | LoadEventList(); |
| | | account = etAccount.Text.Trim(); |
| | | |
| | | #if DEBUG1211 |
| | | #if DEBUG1211 |
| | | //本地模式 |
| | | Button btnLocalMode = new Button() |
| | | { |
| | |
| | | btnLocalMode.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | MainPage.LocalMode = true; |
| | | MainPage.LoginUser = new UserInfo(); |
| | | UserInfo.Current = new UserInfo(); |
| | | MainPage.GoUserPage(); |
| | | }; |
| | | |
| | | MainPage.Log("etAccount.TextAlignment : " + etAccount.TextAlignment.ToString()); |
| | | |
| | | #endif |
| | | #endif |
| | | |
| | | #region 隐私政策 |
| | | AddServiceAgreementControl(bodyView); |
| | | #endregion |
| | | |
| | | } |
| | | |
| | | #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 |
| | | } |
| | | } |
| | |
| | | } |
| | | |
| | | /// <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() |
| | |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | | return; |
| | | } |
| | | if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) |
| | | if (!Utlis.CheckPhoneNumber(phoneNumber, phoneZoneCode)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | var result = pm.GetRegionByAccount(account); |
| | | if (result.Code != StateCode.SUCCESS) |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //检测当前配置域名是否一致,不一致则替换 |
| | | CheckAndSetUserRequestHost(result); |
| | | // |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnGetVerificationCode.IsSelected = false; |
| | |
| | | btnPasswordViewBottomLine.Height = Application.GetRealHeight(2); |
| | | }); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | } |
| | | |
| | |
| | | return; |
| | | if (loginType == 0) |
| | | { |
| | | if (!Regex.IsMatch(account, @"^[1]+\d{10}") || (account.Length != 11)) |
| | | if (!Utlis.CheckPhoneNumber(registerPhone, phoneZoneCode)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) |
| | | if (!Utlis.CheckEmail(registerEmail)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | { |
| | | if (btnLogin.IsSelected) |
| | | { |
| | | //判断是否同意了隐私政策 |
| | | if (CheckPrivacyPolicy() == false) return; |
| | | |
| | | account = etAccount.Text.Trim(); |
| | | password = etPassword.Text.Trim(); |
| | | |
| | | if (loginType == 0) |
| | | { |
| | | if (!Regex.IsMatch(account, @"^[1]+\d{10}") && account.Length == 11) |
| | | if (!Utlis.CheckPhoneNumber(account, phoneZoneCode)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | } |
| | | else |
| | | { |
| | | if (!Regex.IsMatch(account, "([a-zA-Z0-9_\\.\\-])+\\@(([a-zA-Z0-9\\-])+\\.)+([a-zA-Z0-9]{2,5})+")) |
| | | if (!Utlis.CheckEmail(account)) |
| | | { |
| | | var tip = new Tip() |
| | | { |
| | |
| | | var result = pm.GetRegionByAccount(account); |
| | | if (result.Code != StateCode.SUCCESS) |
| | | { |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | return; |
| | | } |
| | | else |
| | | { |
| | | //设置用户所注册地区的域名,用户相关操作都用这个域名 |
| | | CheckAndSetUserRequestHost(result); |
| | | } |
| | | } |
| | | |
| | |
| | | OnAppConfig.Instance.RefreshUserConfig(); |
| | | DB_ResidenceData.InitRoomFunction(); |
| | | } |
| | | if (MainPage.LoginUser.userEmailInfo == "464027401@qq.com") |
| | | if ( UserInfo.Current.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" }; |
| | |
| | | else |
| | | { |
| | | //2020-11-13 待确认 |
| | | MainPage.ShowAlertOnMainThread("登录失败,请先添加住宅。"); |
| | | //获取住宅失败,重新标记为未登录状态 |
| | | UserInfo.Current.lastTime = DateTime.MinValue; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | //登录失败,请先添加住宅! |
| | | Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.FailedGetHomeList)); |
| | | } |
| | | } |
| | | } |
| | |
| | | if (loginResult.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); |
| | | 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(); |
| | | // 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.Log("登录成功。"); |
| | | result = true; |
| | | //获取用户信息 |
| | |
| | | if (responsePack == StateCode.SUCCESS) |
| | | { |
| | | //2020-11-13 待确认,没有住宅,不算登录成功 |
| | | if (MainPage.LoginUser.regionList != null && MainPage.LoginUser.regionList.Count > 0){ |
| | | if ( UserInfo.Current.regionList != null && UserInfo.Current.regionList.Count > 0){ |
| | | result = true; |
| | | } |
| | | //result = true; |
| | |
| | | else |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Gethomepager, responsePack); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responsePack); |
| | | } |
| | | return result; |
| | | } |
| | |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | PlaceholderTextColor = CSS_Color.PromptingColor1, |
| | | PlaceholderText = Language.StringByID(StringId.PlsEntryPhoneNumber), |
| | | IsNumberKeyboardType = true |
| | | }; |
| | | accountView.AddChidren(etAccount); |
| | | |
| | |
| | | if (loginResult.Code == StateCode.SUCCESS) |
| | | { |
| | | var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<UserLoginRes>(loginResult.Data.ToString()); |
| | | 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(); |
| | | // 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.Log("登录成功。"); |
| | | result = true; |
| | | } |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, loginResult.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | |
| | | { |
| | | 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 (btnGlobalRoaming.Text == "+86" && etAccount.Text.Trim().Length != 11) |
| | | if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) |
| | | { |
| | | btnGetVerificationCode_Phone.IsSelected = false; |
| | | } |
| | |
| | | } |
| | | else//邮箱注册获取验证码按钮生效条件 |
| | | { |
| | | if (!mFalg.Success) |
| | | if (!Utlis.CheckEmail(etAccount.Text.Trim())) |
| | | { |
| | | btnGetVerificationCode_Mail.IsSelected = false; |
| | | } |
| | |
| | | { |
| | | return; |
| | | } |
| | | etAccount.IsNumberKeyboardType = true; |
| | | etAccount.Text = registerPhone; |
| | | etPassword.Text = ""; |
| | | etRepeatPassword.Text = ""; |
| | |
| | | { |
| | | if (registerType == 1) |
| | | return; |
| | | |
| | | etAccount.IsNumberKeyboardType = false; |
| | | etAccount.Text = registerEmail; |
| | | etPassword.Text = ""; |
| | | etRepeatPassword.Text = ""; |
| | |
| | | { |
| | | if (registerType == 0) |
| | | { |
| | | 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)) |
| | | if (!Utlis.CheckPhoneNumber(etAccount.Text.Trim(), phoneZoneCode)) |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | |
| | | else if (registerType == 1) |
| | | { |
| | | //邮箱注册-验证邮箱是否正确 |
| | | 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) |
| | | if (!Utlis.CheckEmail(etAccount.Text.Trim())) |
| | | { |
| | | btnAccountViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2; |
| | | btnAccountViewBottomLine.Height = Application.GetRealHeight(2); |
| | |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Verification_Send, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }else if (result.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | //3.提示账号已存在,无法重复注册 |
| | | MainPage.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); |
| | | Utlis.ShowAlertOnMainThread(Language.StringByID(StringId.AccountAlreadyUse)); |
| | | } else |
| | | { |
| | | //4.提示其它异常错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_GetRegionByAccount, result.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(result.Code); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | |
| | | else// 注册失败 |
| | | { |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_Register, validateSmsResult.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(validateSmsResult.Code); |
| | | |
| | | //2020-11-13 待修改 |
| | | //string erorrInfo = ""; |
| | |
| | | |
| | | namespace HDL_ON.UI |
| | | { |
| | | /// <summary> |
| | | /// 已绑定手机或者邮箱的页面 |
| | | /// </summary> |
| | | public partial class AccountBindInfoPage : FrameLayout |
| | | { |
| | | FrameLayout bodyView; |
| | |
| | | /// </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; |
| | |
| | | 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); |
| | | |
| | |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Text = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo, |
| | | Text = optionType == 1 ? UserInfo.Current.userEmailInfo : UserInfo.Current.userMobileInfo, |
| | | }; |
| | | rowView.AddChidren(btnContent); |
| | | |
| | |
| | | }; |
| | | bodyView.AddChidren(btnChangeBind); |
| | | |
| | | if( (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) && optionType == 1) || (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) && optionType == 2)) |
| | | //同时绑定邮箱或者手机才显示"更换验证方式" |
| | | if (!string.IsNullOrEmpty( UserInfo.Current.userMobileInfo) && !string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) |
| | | { |
| | | Button btnUnbind = new Button() |
| | | { |
| | |
| | | /// </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, StringId.CurrentEmail); |
| | | cbe.LoadPage(action, optionType, StringId.ModifyBindingEmail); |
| | | } |
| | | else if(optionType == 2) |
| | | else if (optionType == 2) |
| | | { |
| | | cbe.LoadPage(action, optionType, StringId.ModifyBindingPhone, StringId.CurPhone); |
| | | cbe.LoadPage(action, optionType, StringId.ModifyBindingPhone); |
| | | } |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | |
| | | /// </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, StringId.CurrentEmail); |
| | | cbe.LoadPage(action, optionType, StringId.UnbindEmail); |
| | | } |
| | | else if(optionType == 2) |
| | | else if (optionType == 2) |
| | | { |
| | | cbe.LoadPage(action, optionType, StringId.UnbindPhone, StringId.CurPhone); |
| | | cbe.LoadPage(action, optionType, StringId.UnbindPhone); |
| | | } |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | }; |
| | |
| | | using System; |
| | | using Shared; |
| | | using HDL_ON.UI.CSS; |
| | | using System.Text.RegularExpressions; |
| | | using HDL_ON.DAL.Server; |
| | | //using 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 == 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), ""); |
| | | } |
| | | // //-------------------------------------------- |
| | | // 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), ""); |
| | | // } |
| | | |
| | | 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(); |
| | | // }; |
| | | // } |
| | | // } |
| | | //} |
| | |
| | | |
| | | 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; |
| | |
| | | /// <param name="optionType">操作目标类型 1:邮箱,2:手机</param> |
| | | /// <param name="titleId"></param> |
| | | /// <param name="contentTitleId"></param> |
| | | public void LoadPage(Action<string> act, int opt, int titleId, int contentTitleId) |
| | | public void LoadPage(Action<string> act, int opt, int titleId) |
| | | { |
| | | action = act; |
| | | optionType = opt; |
| | | string account; |
| | | if (optionType == 0) |
| | | { |
| | | account = MainPage.LoginUser.userEmailInfo; |
| | | account = UserInfo.Current.userEmailInfo; |
| | | } |
| | | else |
| | | { |
| | | account = MainPage.LoginUser.userMobileInfo; |
| | | account = UserInfo.Current.userMobileInfo; |
| | | } |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(titleId)).LoadTopView(); |
| | |
| | | }; |
| | | bodyView.AddChidren(rowView); |
| | | |
| | | Button btnTitle = new 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); |
| | | |
| | | Button btnContent = new Button() |
| | | btnContent = new Button() |
| | | { |
| | | Width = Application.GetRealWidth(359), |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | Text = optionType == 1 ? MainPage.LoginUser.userEmailInfo : MainPage.LoginUser.userMobileInfo, |
| | | //Text = optionType == 1 ? UserInfo.Current.userEmailInfo : UserInfo.Current.userMobileInfo, |
| | | }; |
| | | rowView.AddChidren(btnContent); |
| | | |
| | |
| | | }; |
| | | bodyView.AddChidren(btnChangeBind); |
| | | |
| | | if (!string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo)) |
| | | |
| | | |
| | | //同时绑定邮箱或者手机才显示"更换验证方式" |
| | | if (!string.IsNullOrEmpty( UserInfo.Current.userMobileInfo) && !string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) |
| | | { |
| | | Button btnChangeGetVer = new Button() |
| | | { |
| | |
| | | LoadEvent_ChangeVerificationMethod(btnChangeGetVer, btnTitle, btnContent); |
| | | } |
| | | |
| | | SetContentTitleId(); |
| | | LoadEvent_GetVerification(btnChangeBind, titleId); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 设置按钮提示文字 |
| | | /// 修改绑定时提示:手机验证、邮箱验证 |
| | | /// 解绑时提示:当前手机手机号码、当前邮箱地址 |
| | | /// </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; |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | btn.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | optionType = optionType == 1 ? 2 : 1; |
| | | if (optionType == 2) |
| | | { |
| | | btnTitle.TextID = StringId.CurPhone; |
| | | btnContent.Text = MainPage.LoginUser.userMobileInfo; |
| | | } |
| | | else |
| | | { |
| | | btnTitle.TextID = StringId.CurrentEmail; |
| | | btnContent.Text = MainPage.LoginUser.userEmailInfo; |
| | | } |
| | | SetContentTitleId(); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | new Thread(() => |
| | | { |
| | | if (optionType == 1) |
| | | //1.获取验证码,采用敏感数据验证 |
| | | ResponsePackNew resultObj; |
| | | if (optionType == 1)//邮箱 |
| | | { |
| | | var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userEmailInfo); |
| | | 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); |
| | | } |
| | | |
| | | } |
| | | else if (optionType == 2) |
| | | if (resultObj.Code != StateCode.SUCCESS) |
| | | { |
| | | var resultObj = new HttpServerRequest().VerificationCodeSend(VerifyType.REGISTER_USER_SYSTEM, MainPage.LoginUser.userMobileInfo, true, MainPage.LoginUser.areaCode.ToString()); |
| | | // 提示错误 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | if (time == 0) |
| | | { |
| | | time = 60; |
| | | new Thread(() => |
| | | { |
| | | while (time > 0) |
| | | else |
| | | { |
| | | time--; |
| | | 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.Text = time.ToString() + "s"; |
| | | 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; |
| | | }); |
| | | 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; |
| | | |
| | | |
| | | }; |
| | | } |
| | | } |
New file |
| | |
| | | using 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 正则表达式 |
| | | //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(); |
| | | } |
| | | |
| | | }; |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | using 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; |
| | | //请使用新的手机账号登录APP |
| | | tipMsg = Language.StringByID(StringId.PleaseLoginWithNewMobileAccount); |
| | | if (isModifyBind) |
| | | { |
| | | //登录手机修改完成 |
| | | tipTitle = Language.StringByID(StringId.LoginMobileAccountModificationCompleted); |
| | | } |
| | | else |
| | | { |
| | | //登录手机绑定完成 |
| | | tipTitle = Language.StringByID(StringId.LoginMobileAccountBindCompleted); |
| | | } |
| | | } |
| | | else |
| | | { |
| | | UserInfo.Current.userEmailInfo = verAccount; |
| | | //请使用新的邮箱账号登录APP |
| | | 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(); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | |
| | | else |
| | | { |
| | | //提示 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Child_FindAll, responePack.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); |
| | | //账号或者密码错误 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | else |
| | | { |
| | | //提示 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Child_FindAll, responePack.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(responePack.Code); |
| | | //账号或者密码错误 |
| | | Application.RunOnMainThread(() => |
| | | { |
| | |
| | | { |
| | | Action action = () => |
| | | { |
| | | ResponsePack responePack = new HttpServerRequest().DeleteResidenceMemberAccount(memberInfo.SubAccountDistributedMark); |
| | | if (responePack.StateCode.ToUpper() == StateCode.SUCCESS) |
| | | var responePack = new HttpServerRequest().DeleteResidenceMemberAccount(memberInfo); |
| | | if (responePack.Code == StateCode.SUCCESS) |
| | | { |
| | | this.RemoveFromParent(); |
| | | backAction(); |
| | |
| | | }; |
| | | dispalyView.AddChidren(contentView); |
| | | |
| | | if (MainPage.LoginUser.regionList.Count < 3) |
| | | if ( UserInfo.Current.regionList.Count < 3) |
| | | { |
| | | } |
| | | else if (MainPage.LoginUser.regionList.Count < 4) |
| | | else if ( UserInfo.Current.regionList.Count < 4) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | contentView.Height = Application.GetRealHeight(45 * 3); |
| | | dispalyView.AddChidren(contentView); |
| | | } |
| | | else if (MainPage.LoginUser.regionList.Count < 5) |
| | | else if ( UserInfo.Current.regionList.Count < 5) |
| | | { |
| | | dispalyView = new FrameLayout() |
| | | { |
| | |
| | | |
| | | |
| | | |
| | | foreach (var home in MainPage.LoginUser.regionList) |
| | | foreach (var home in UserInfo.Current.regionList) |
| | | { |
| | | var btnHomeName = new Button() |
| | | { |
| | |
| | | }; |
| | | contentView.AddChidren(btnHomeName); |
| | | |
| | | if (MainPage.LoginUser.regionList.IndexOf(home) < MainPage.LoginUser.regionList.Count - 1) |
| | | if ( UserInfo.Current.regionList.IndexOf(home) < UserInfo.Current.regionList.Count - 1) |
| | | { |
| | | contentView.AddChidren(new Button() |
| | | { |
| | |
| | | var regionId = (string)btnHomeName.Tag; |
| | | dialog.Close(); |
| | | //DB_ResidenceData.residenceData.CurReginID = regionId; |
| | | LoadEvent_ChangeCurHome(MainPage.LoginUser.regionList.Find((obj) => obj.RegionID == regionId)); |
| | | LoadEvent_ChangeCurHome( UserInfo.Current.regionList.Find((obj) => obj.RegionID == regionId)); |
| | | LoadContentView(); |
| | | }; |
| | | } |
| | |
| | | } |
| | | //倒出新住宅数据 |
| | | FileUtils.RestoreRegionFiles(newRegionRootPath); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | DB_ResidenceData.residenceData.EixtAccount(); |
| | | DB_ResidenceData.residenceData.CurReginID = homeTemp.RegionID; |
| | | OnAppConfig.Instance.SaveUserConfig(); |
| | |
| | | { |
| | | Action updataHeadImage = () => |
| | | { |
| | | userHeadImageView.ImagePath = MainPage.LoginUser.headImagePagePath; |
| | | userHeadImageView.ImagePath = UserInfo.Current.headImagePagePath; |
| | | }; |
| | | Action updataUserName = () => |
| | | { |
| | | btnUserName.Text = MainPage.LoginUser.userName; |
| | | btnUserName.Text = UserInfo.Current.userName; |
| | | }; |
| | | |
| | | var personalDataView = new PersonalDataPage(updataHeadImage, updataUserName); |
| | |
| | | /// </summary> |
| | | Action updataUserName; |
| | | |
| | | public PersonalDataPage(Action upHeadImage,Action upUserName) |
| | | public PersonalDataPage(Action upHeadImage, Action upUserName) |
| | | { |
| | | updataHeadImage = upHeadImage; |
| | | updataUserName = upUserName; |
| | |
| | | Width = Application.GetMinRealAverage(84), |
| | | Height = Application.GetMinRealAverage(84), |
| | | Radius = (uint)Application.GetMinRealAverage(42), |
| | | ImagePath = MainPage.LoginUser.headImagePagePath, |
| | | ImagePath = UserInfo.Current.headImagePagePath, |
| | | }; |
| | | headPortraitView.AddChidren(userHeadImageView); |
| | | |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userName) ? "不愿意透露姓名的用户" : MainPage.LoginUser.userName |
| | | Text = string.IsNullOrEmpty( UserInfo.Current.userName) ? Language.StringByID(StringId.UsersWhoNameIsEmpty) : UserInfo.Current.userName |
| | | }; |
| | | userNameView.AddChidren(btnUserName); |
| | | /// <summary> |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userEmailInfo |
| | | Text = GetBindAccountText( UserInfo.Current.userEmailInfo) |
| | | }; |
| | | userEmailInfoView.AddChidren(btnUserEmailInfo); |
| | | /// <summary> |
| | |
| | | TextAlignment = TextAlignment.CenterRight, |
| | | TextColor = CSS_Color.PromptingColor1, |
| | | TextSize = CSS_FontSize.TextFontSize, |
| | | Text = string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo) ? Language.StringByID(StringId.Unbound) : MainPage.LoginUser.userMobileInfo |
| | | Text = GetBindAccountText( UserInfo.Current.userMobileInfo) |
| | | }; |
| | | userPhoneInfoView.AddChidren(btnUserPhoneInfo); |
| | | /// <summary> |
| | |
| | | }; |
| | | bodyView.AddChidren(btnLogout); |
| | | |
| | | if(MainPage.Increase) |
| | | if (MainPage.Increase) |
| | | { |
| | | btnLogout.Y = Application.GetRealHeight(613); |
| | | btnLogout.Height = Application.GetRealHeight(50); |
| | |
| | | } |
| | | |
| | | LoadEventList(); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | |
| | | 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); |
| | | } |
| | | } |
| | | } |
| | |
| | | LoadEvent_ChangeBindEmail(); |
| | | LoadEvent_ChangeBindPhone(); |
| | | LoadEvent_SkipModifyPassword(); |
| | | GetUserInfo(); |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | } |
| | | |
| | | /// <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) => |
| | | { |
| | | #region 保存本地数据至文件夹 |
| | | string oldRegionRootPath = FileUtils.CreateRegionBackup(DB_ResidenceData.residenceData.CurReginID.ToString()); |
| | | new System.Threading.Thread(() => |
| | | Action 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(); |
| | | Logout(); |
| | | }; |
| | | new ConfirmDialog().ShowDialog(StringId.Tip, StringId.IfConfirmLogout, okAction); |
| | | }; |
| | | } |
| | | |
| | |
| | | { |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | baseView.MouseUpEventHandler = (sender, e) => { |
| | | baseView.MouseUpEventHandler = (sender, e) => |
| | | { |
| | | baseView.RemoveFromParent(); |
| | | }; |
| | | btnCancel.MouseUpEventHandler = (sender, e) => |
| | |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | MainPage.LoginUser.headImagePagePath = imagePath.ToString(); |
| | | UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | userHeadImageView.ImagePath = imagePath.ToString(); |
| | | updataHeadImage(); |
| | | new System.Threading.Thread(() => |
| | |
| | | new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }), pid.ToString(), 1, 1); |
| | |
| | | { |
| | | if (imagePath != null) |
| | | { |
| | | MainPage.LoginUser.headImagePagePath = imagePath.ToString(); |
| | | UserInfo.Current.headImagePagePath = imagePath.ToString(); |
| | | userHeadImageView.ImagePath = imagePath.ToString(); |
| | | updataHeadImage(); |
| | | |
| | |
| | | { |
| | | new DAL.Server.HttpServerRequest().UpdataUserHeadImage(imagePath); |
| | | }) |
| | | { IsBackground = true }.Start(); MainPage.LoginUser.SaveUserInfo(); |
| | | { IsBackground = true }.Start(); UserInfo.Current.SaveUserInfo(); |
| | | MainPage.Log("SelectPicture 裁剪图片返回路径: " + imagePath); |
| | | } |
| | | }, pid.ToString(), 1, 1); |
| | |
| | | }.Show(bodyView); |
| | | return; |
| | | } |
| | | if(str == MainPage.LoginUser.userName) |
| | | if (str == UserInfo.Current.userName) |
| | | { |
| | | return; |
| | | } |
| | |
| | | var resultObj = new HttpServerRequest().EditUserName(str); |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | MainPage.LoginUser.userName = str; |
| | | MainPage.LoginUser.SaveUserInfo(); |
| | | UserInfo.Current.userName = str; |
| | | UserInfo.Current.SaveUserInfo(); |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnUserName.Text = str; |
| | |
| | | else |
| | | { |
| | | //失败提示 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Member_UpdateMemberInfo, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | } |
| | | catch (Exception ex) |
| | |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | }; |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, MainPage.LoginUser.userName, callBack, StringId.UesrNameCannotBeEmpty, 0, new System.Collections.Generic.List<string>()); |
| | | new PublicAssmebly().LoadDialog_EditParater(StringId.ChangeName, UserInfo.Current.userName, callBack, StringId.UesrNameCannotBeEmpty, 0, new System.Collections.Generic.List<string>()); |
| | | }; |
| | | btnUserName.MouseUpEventHandler = eventHandler; |
| | | btnEditUserNameIcon.MouseUpEventHandler = eventHandler; |
| | |
| | | /// </summary> |
| | | void LoadEvent_ChangeBindEmail() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | Action<string> action = (email) => |
| | | { |
| | | btnUserEmailInfo.Text = email; |
| | | |
| | | btnUserEmailInfo.Text = GetBindAccountText(email); |
| | | }; |
| | | |
| | | var aep = new AccountBindInfoPage(); |
| | | MainPage.BasePageView.AddChidren(aep); |
| | | aep.LoadPage(action,1,StringId.EmailAddress); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | 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; |
| | | } |
| | | |
| | | }; |
| | | 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 = phone; |
| | | btnUserPhoneInfo.Text = GetBindAccountText(phone); |
| | | }; |
| | | |
| | | var aep = new AccountBindInfoPage(); |
| | | MainPage.BasePageView.AddChidren(aep); |
| | | aep.LoadPage(action, 2, StringId.PhoneInfo); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | 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; |
| | | } |
| | | |
| | | |
| | | }; |
| | | btnUserPhoneInfo.MouseUpEventHandler = eventHandler; |
| | | btnUserPhoneRight.MouseUpEventHandler = eventHandler; |
| | |
| | | /// </summary> |
| | | void LoadEvent_SkipModifyPassword() |
| | | { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => { |
| | | EventHandler<MouseEventArgs> eventHandler = (sender, e) => |
| | | { |
| | | var page = new ResetPasswordOptionPage(); |
| | | MainPage.BasePageView.AddChidren(page); |
| | | page.LoadPage(); |
| | |
| | | resetPasswordView.MouseUpEventHandler = eventHandler; |
| | | } |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | void GetUserInfo() |
| | | { |
| | | new System.Threading.Thread(() => |
| | | { |
| | | new HttpServerRequest().GetUserInfo(); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | if (verificationOption == 0) |
| | | { |
| | | if (string.IsNullOrEmpty(MainPage.LoginUser.userMobileInfo)) |
| | | if (string.IsNullOrEmpty( UserInfo.Current.userMobileInfo)) |
| | | { |
| | | LoadDialog_UnbindTipInfo(verificationOption); |
| | | } |
| | |
| | | this.RemoveFromParent(); |
| | | var vcp = new ResetPasswordVerificationCodePage(); |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(StringId.PhoneNumberVerification,2); |
| | | vcp.LoadPage(StringId.PhoneNumberVerification, true, UserInfo.Current.userMobileInfo); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (string.IsNullOrEmpty(MainPage.LoginUser.userEmailInfo)) |
| | | if (string.IsNullOrEmpty( UserInfo.Current.userEmailInfo)) |
| | | { |
| | | LoadDialog_UnbindTipInfo(verificationOption); |
| | | } |
| | |
| | | this.RemoveFromParent(); |
| | | var vcp = new ResetPasswordVerificationCodePage(); |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(StringId.EmailVerification,1); |
| | | vcp.LoadPage(StringId.EmailVerification, false, UserInfo.Current.userEmailInfo); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | } |
| | | } |
| | |
| | | dialogView.MouseUpEventHandler = (sender, e) => { |
| | | dialog.Close(); |
| | | }; |
| | | |
| | | 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); |
| | | |
| | | dialog.AddChidren(dialogView); |
| | | |
| | | FrameLayout contentView = new FrameLayout() |
| | | { |
| | | Gravity = Gravity.CenterHorizontal, |
| | |
| | | }; |
| | | 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, |
| | |
| | | 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); |
| | | |
| | |
| | | TextAlignment = TextAlignment.Center, |
| | | Radius = (uint)Application.GetRealWidth(22), |
| | | BackgroundColor = CSS_Color.MainColor, |
| | | TextID = StringId.PhoneNumberVerification, |
| | | TextID = StringId.GoBind, |
| | | TextSize = CSS_FontSize.SubheadingFontSize, |
| | | TextColor = CSS_Color.MainBackgroundColor, |
| | | }; |
| | |
| | | { |
| | | dialog.Close(); |
| | | Action<string> action = (obj) => { }; |
| | | var vcp = new BindAccountPage(); |
| | | MainPage.BasePageView.AddChidren(vcp); |
| | | vcp.LoadPage(action, verificationOption == 0 ? StringId.BindPhone : StringId.BindEmail); |
| | | //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); |
| | | MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; |
| | | |
| | | |
| | | }; |
| | | |
| | | dialog.Show(); |
| | |
| | | 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; |
| | |
| | | |
| | | public void LoadPage() |
| | | { |
| | | bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | 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 |
| | | { |
| | | public void ResetPassword(string password,string repeatPassword ) |
| | | |
| | | /// <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> |
| | | /// <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..."); |
| | | var resetResult = new HttpServerRequest().ResetPassword(MainPage.LoginUser.accountString, password, repeatPassword, 86); |
| | | if (resetResult.StateCode.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | var page = new OperationResultDisPalyPage(); |
| | | page.Show(); |
| | | page.LoadPage(true, Language.StringByID(StringId.UnbindEmail), Language.StringByID(StringId.UnbindEmailSuccess), ""); |
| | | |
| | | for (int i = 0; i < 2; i++) |
| | | new Thread(() => |
| | | { |
| | | try |
| | | { |
| | | // 忘记密码 |
| | | var resultObj = new HttpServerRequest().ForgetPassword(account, password, verCode, isPhone); |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | MainPage.BasePageView.GetChildren(MainPage.BasePageView.ChildrenCount - 1).RemoveFromParent(); |
| | | 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(); |
| | | |
| | | } |
| | | |
| | | /// <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) |
| | | { |
| | | new Tip() |
| | | { |
| | | CloseTime = 1, |
| | | Direction = AMPopTipDirection.None, |
| | | Text = Language.StringByID(StringId.PasswordIsUnqualified) |
| | | }.Show(bodyView); |
| | | } |
| | | 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 |
| | | { |
| | | 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); |
| | | }); |
| | | btnReset.IsSelected = false; |
| | | } |
| | | } |
| | | } |
| | |
| | | |
| | | Button btnResend; |
| | | |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | Button btnTip; |
| | | |
| | | int titleId; |
| | | |
| | | ///// <summary> |
| | | ///// 操作类型 1:邮箱,2:手机 |
| | | ///// </summary> |
| | | //int optionType; |
| | | /// <summary> |
| | | /// 操作类型 1:邮箱,2:手机 |
| | | /// 是否手机 |
| | | /// </summary> |
| | | int optionType; |
| | | bool isPhone; |
| | | /// <summary> |
| | | /// 账号 |
| | | /// </summary> |
| | | string account; |
| | | |
| | | |
| | | public ResetPasswordVerificationCodePage() |
| | | { |
| | | bodyView = this; |
| | | } |
| | | |
| | | public void LoadPage(int tId, int ot) |
| | | /// <summary> |
| | | /// |
| | | /// </summary> |
| | | /// <param name="tId"></param> |
| | | /// <param name="isPhone">是否手机</param> |
| | | /// <param name="account">账号</param> |
| | | public void LoadPage(int tId, bool isPhone, string account) |
| | | { |
| | | titleId = tId; |
| | | optionType = ot; |
| | | this.isPhone = isPhone; |
| | | this.account = account; |
| | | bodyView.BackgroundColor = CSS_Color.BackgroundColor; |
| | | new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); |
| | | |
| | | Button btnTip = new Button() |
| | | Action backAction = () => |
| | | { |
| | | Application.HideSoftInput(); |
| | | BackConfirmAction(); |
| | | }; |
| | | new TopViewDiv(bodyView, Language.StringByID(tId), false).LoadTopView(backAction); |
| | | |
| | | //new TopViewDiv(bodyView, Language.StringByID(tId)).LoadTopView(); |
| | | |
| | | btnTip = new Button() |
| | | { |
| | | Y = Application.GetRealHeight(64), |
| | | X = Application.GetRealWidth(16), |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Height = Application.GetRealHeight(1); |
| | | btnNum6Line.Height = Application.GetRealHeight(1); |
| | | btnNum1Line.Text = ""; |
| | | btnNum2Line.Text = ""; |
| | | btnNum3Line.Text = ""; |
| | | btnNum4Line.Text = ""; |
| | | btnNum5Line.Text = ""; |
| | | btnNum6Line.Text = ""; |
| | | btnNum1.Text = ""; |
| | | btnNum2.Text = ""; |
| | | btnNum3.Text = ""; |
| | | btnNum4.Text = ""; |
| | | btnNum5.Text = ""; |
| | | btnNum6.Text = ""; |
| | | break; |
| | | case 1: |
| | | btnNum2Line.IsSelected = true; |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Height = Application.GetRealHeight(1); |
| | | btnNum6Line.Height = Application.GetRealHeight(1); |
| | | btnNum2Line.Text = ""; |
| | | btnNum3Line.Text = ""; |
| | | btnNum4Line.Text = ""; |
| | | btnNum5Line.Text = ""; |
| | | btnNum6Line.Text = ""; |
| | | btnNum2.Text = ""; |
| | | btnNum3.Text = ""; |
| | | btnNum4.Text = ""; |
| | | btnNum5.Text = ""; |
| | | btnNum6.Text = ""; |
| | | break; |
| | | case 2: |
| | | btnNum3Line.IsSelected = true; |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Height = Application.GetRealHeight(1); |
| | | btnNum6Line.Height = Application.GetRealHeight(1); |
| | | btnNum3Line.Text = ""; |
| | | btnNum4Line.Text = ""; |
| | | btnNum5Line.Text = ""; |
| | | btnNum6Line.Text = ""; |
| | | btnNum3.Text = ""; |
| | | btnNum4.Text = ""; |
| | | btnNum5.Text = ""; |
| | | btnNum6.Text = ""; |
| | | break; |
| | | case 3: |
| | | btnNum4Line.IsSelected = true; |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(2); |
| | | btnNum5Line.Height = Application.GetRealHeight(1); |
| | | btnNum6Line.Height = Application.GetRealHeight(1); |
| | | btnNum4Line.Text = ""; |
| | | btnNum5Line.Text = ""; |
| | | btnNum6Line.Text = ""; |
| | | btnNum4.Text = ""; |
| | | btnNum5.Text = ""; |
| | | btnNum6.Text = ""; |
| | | break; |
| | | case 4: |
| | | btnNum5Line.IsSelected = true; |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Height = Application.GetRealHeight(2); |
| | | btnNum6Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Text = ""; |
| | | btnNum6Line.Text = ""; |
| | | btnNum5.Text = ""; |
| | | btnNum6.Text = ""; |
| | | break; |
| | | case 5: |
| | | btnNum6Line.IsSelected = true; |
| | |
| | | btnNum4Line.Height = Application.GetRealHeight(1); |
| | | btnNum5Line.Height = Application.GetRealHeight(1); |
| | | btnNum6Line.Height = Application.GetRealHeight(2); |
| | | btnNum6Line.Text = ""; |
| | | 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)); |
| | | }); |
| | | 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(); |
| | | |
| | | //输入完成 |
| | | InputComplete(etCode); |
| | | 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> |
| | |
| | | { |
| | | btnResend.IsSelected = false; |
| | | int time = 60; |
| | | |
| | | new Thread(() => |
| | | try |
| | | { |
| | | if (optionType == 1) |
| | | new Thread(() => |
| | | { |
| | | var resultObj = new DAL.Server.HttpServerRequest().VerificationCodeSend(VerifyType.FIND_PASSWORD, MainPage.LoginUser.userEmailInfo); |
| | | |
| | | } |
| | | 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(() => |
| | | //2.2 获取验证码 |
| | | ResponsePackNew resultObj; |
| | | if (!isPhone) |
| | | { |
| | | btnResend.Text = time.ToString() + "s"; |
| | | }); |
| | | Thread.Sleep(1000); |
| | | } |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | btnResend.IsSelected = true; |
| | | btnResend.TextID = StringId.GetVerificationCode; |
| | | }); |
| | | }) |
| | | { IsBackground = true }.Start(); |
| | | 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()); |
| | | } |
| | | |
| | | 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 |
| | | { |
| | | |
| | | }; |
| | | } |
| | | |
| | | /// <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(); |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | { |
| | | Application.RunOnMainThread(() => |
| | | { |
| | | //MainPage.LoginUser.regionList.Find((obj) => obj.Name == btnResidenceName.Text.Trim()).Name = str; |
| | | // UserInfo.Current.regionList.Find((obj) => obj.Name == btnResidenceName.Text.Trim()).Name = str; |
| | | btnResidenceName.Text = str; |
| | | upateResidenceName(); |
| | | }); |
| | |
| | | { |
| | | if (optionType == "7") |
| | | { |
| | | MainPage.GoLoginPage(MainPage.LoginUser); |
| | | MainPage.GoLoginPage( UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.accountString, pw); |
| | | if (resultObj.Code == StateCode.SUCCESS) |
| | | { |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |
| | |
| | | { |
| | | if (optionType == "7") |
| | | { |
| | | MainPage.GoLoginPage(MainPage.LoginUser); |
| | | MainPage.GoLoginPage( UserInfo.Current); |
| | | } |
| | | else |
| | | { |
| | | Action<string> action = (pw) => { |
| | | var resultObj = new HttpServerRequest().LoginByPassword(MainPage.LoginUser.accountString, pw); |
| | | var resultObj = new HttpServerRequest().LoginByPassword( UserInfo.Current.accountString, pw); |
| | | if (resultObj.Code.ToUpper() == StateCode.SUCCESS) |
| | | { |
| | | OnAppConfig.Instance.appUnlockPasswrod = ""; |
| | |
| | | else |
| | | { |
| | | //登录失败 |
| | | IMessageCommon.Current.ShowErrorInfoAlter(NewAPI.API_POST_Login, resultObj.Code); |
| | | IMessageCommon.Current.ShowErrorInfoAlter(resultObj.Code); |
| | | } |
| | | |
| | | }; |