From 7ed9cc5bb6a07a8358a2705797bd2b31c6e39fd4 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 07 一月 2021 18:33:34 +0800
Subject: [PATCH] 2021-01-07 1.注册功能,忘记密码功能相关接口替换,UI界面修改调整。

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs |  145 ++++++++++++++++++++---------------------------
 1 files changed, 62 insertions(+), 83 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
index 8f0de85..60c1c33 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountLogin.cs
@@ -1,9 +1,6 @@
-锘縰sing Shared.SimpleControl;
-using System;
+锘縰sing System;
 using System.Collections.Generic;
-using System.Security.Cryptography;
-using System.Text;
-using System.Text.RegularExpressions;
+using Shared.SimpleControl.R;
 
 namespace Shared.SimpleControl.Phone
 {
@@ -81,7 +78,10 @@
             //etAccount.Text = "18926269190@189.cn";
             //etAccount.Text = "721343314@qq.com";
             //etAccount.Text = "crabtreel12019@gmail.com";
-            etAccount.Text = "2791308028@qq.com";
+            //etAccount.Text = "2791308028@qq.com";
+            etAccount.Text = "551775569@qq.com";
+
+            //etAccount.Text = "cjl@hdlchina.com.cn";
 #endif
 
             accountView.AddChidren (etAccount);
@@ -134,7 +134,8 @@
                 Text = password,
             };
 #if DEBUG
-            etPasswrod.Text = "123456";
+            //etPasswrod.Text = "123456";
+            etPasswrod.Text = "123456-Aa";
 #endif
             passwrodView.AddChidren (etPasswrod);
 
@@ -267,10 +268,10 @@
                     return;
                 }
 
-                //妫�娴嬭处鍙锋槸鍚﹂攣瀹�
-                if (CommonConfig.Current.CheckIfLock (account)) {
-                    return;
-                }
+                ////妫�娴嬭处鍙锋槸鍚﹂攣瀹�
+                //if (CommonConfig.Current.CheckIfLock (account)) {
+                //    return;
+                //}
 
                 System.Threading.Tasks.Task.Run (() => {
                     try {
@@ -284,7 +285,6 @@
                         if (UserConfig.Instance.internetStatus == 0) {
                             Application.RunOnMainThread (() => {
                                 Utlis.ShowTip ("Network abnormal, unable to connect to the Internet");
-
                                 //new Tip () { Text = "Network abnormal, unable to connect to the Internet", Direction = AMPopTipDirection.Down, CloseTime = 3 }.Show (btnLogo);
                             });
                             return;
@@ -397,54 +397,6 @@
 
         }
 
-
-        /// <summary>
-        /// 
-        /// </summary>
-        /// <param name="stateCodeStr"></param>
-        void ShowGetHomePagerErrorInfo (string stateCodeStr)
-        {
-            string mes = "";
-            //2020-01-06 寰呰ˉ鍏�
-            if (stateCodeStr == ErrorCode.NetworkError) {
-                mes = ErrorCode.NetworkError;
-            } else {
-                mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr;
-
-            }
-            if (!string.IsNullOrEmpty (mes)) {
-                Application.RunOnMainThread (() => {
-                    new Alert ("", mes, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
-                });
-            }
-
-
-        }
-
-
-        ///// <summary>
-        ///// 
-        ///// </summary>
-        ///// <param name="stateCodeStr"></param>
-        //void ShowGetAllBindGatewarysPaggerErrorInfo (string stateCodeStr)
-        //{
-        //    string mes = "";
-        //    //2020-01-06 寰呰ˉ鍏�
-        //    if (stateCodeStr == ErrorCode.NetworkError) {
-        //        mes = ErrorCode.NetworkError;
-        //    } else {
-        //        mes = ErrorCode.OperationFailed + ErrorCode.Reason + stateCodeStr;
-
-        //    }
-        //    if (!string.IsNullOrEmpty (mes)) {
-        //        Application.RunOnMainThread (() => {
-        //            new Alert ("", mes, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
-        //        });
-        //    }
-
-
-        //}
-
         /// <summary>
         /// 鐧诲綍 2020-01-11 
         /// </summary>
@@ -504,7 +456,6 @@
                             Room.InitAllRoom ();
                         } else {
 
-                            //if (findRoom == null) {
                             if (mHomeLists != null && mHomeLists.Count > 0) {
                                 var bFind = false;
                                 foreach (var mHome in mHomeLists) {
@@ -514,9 +465,7 @@
                                         break;
                                     }
                                 }
-                                //if (!bFind) {
-                                //    UserConfig.Instance.CurrentRegion = revertRoomData [0];
-                                //}
+
                                 if (!bFind) {
                                     var findRoom2 = mHomeLists.Find ((obj) => obj.IsOthreShare == false);
                                     if (findRoom2 != null) {
@@ -528,15 +477,9 @@
 
                                 IO.FileUtils.DeleteAllFile ();
                             }
-                            //}else {
-                            //    //鍒锋柊浣忓畢 瑙e喅瀛愯处鍙烽棶棰�
-                            //    UserConfig.Instance.CurrentRegion = findRoom;
-                            //    Room.InitAllRoom ();
-                            //}
                         }
+                    }
 
-
-                }
                     ////鍘熸柟妗�
                     //GetAllBindGatewarysPagger (revertRoomData);
                     ////鑾峰彇褰撳墠浣忓畢缃戝叧鏂规
@@ -547,20 +490,28 @@
                     IMessageCommon.Current.ShowErrorInfoAlter (revertObjCode);
                 }
             } else {
+
+                //鎻愮ず鐧诲綍閿佸畾
+                if (revertObj.Code == StateCode.AccountLoginLock) {
+                    Application.RunOnMainThread (() => {
+                        ShowAccountLoginLockTip (revertObj);
+                    });
+                    return;
+                }
                 IMessageCommon.Current.ShowErrorInfoAlter (revertObj.Code);
             }
         }
 
-        private void SetMqttHost (string URL) {
-            string pattern = @"(http|https)://(?<domain>[^(:|/]*)";
+        //private void SetMqttHost (string URL) {
+        //    string pattern = @"(http|https)://(?<domain>[^(:|/]*)";
 
-            Regex reg = new Regex (pattern, RegexOptions.IgnoreCase);
-            Match m = reg.Match (URL);
-            string mResult = m.Value;
-            if (!string.IsNullOrEmpty (mResult)) {
-                MainPage.RequestHttpsHostMqtt = mResult;
-            }
-        }
+        //    Regex reg = new Regex (pattern, RegexOptions.IgnoreCase);
+        //    Match m = reg.Match (URL);
+        //    string mResult = m.Value;
+        //    if (!string.IsNullOrEmpty (mResult)) {
+        //        MainPage.RequestHttpsHostMqtt = mResult;
+        //    }
+        //}
 
         /// <summary>
         /// 淇濆瓨鏁版嵁 骞跺姞杞介〉闈�
@@ -591,8 +542,36 @@
 
         }
 
+        /// <summary>
+        /// 瑙f瀽鎻愮ず鐢ㄦ埛瑙i攣鏃堕棿
+        /// 瀵嗙爜閿欒娆℃暟杩囧锛岃处鍙疯閿佸畾锛佽閫氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴杮0}鍒嗛挓鍚庨噸璇�.
+        /// </summary>
+        /// <param name="loginResult"></param>
+        void ShowAccountLoginLockTip (ResponsePackNew loginResult)
+        {
+            //瀵嗙爜閿欒娆℃暟杩囧锛岃处鍙疯閿佸畾锛�
+            var tipStr = Language.StringByID (MyInternationalizationString.AccountLoginLock);
+            try {
+                if (loginResult.extra != null) {
+                    //璇烽�氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴杮0}鍒嗛挓鍚庨噸璇�.
+                    var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountLoginLockExtraRes> (loginResult.extra.ToString ());
+                    string msg = Language.StringByID (MyInternationalizationString.PleaseTryToForgetPassword);
+                    //var unlockTime = Utlis.UnixToDateTimeWithFormatMS(revertData.unlockTime, "HH:mm");
+                    //msg = msg.Replace("{0}", unlockTime);
 
-       
+                    var unlockDatetime = Utlis.UnixToDateTimeMS (revertData.unlockTime);
+                    var unlockTimeInt = unlockDatetime.Minute - DateTime.Now.Minute;
+                    if (unlockTimeInt <= 0) {
+                        unlockTimeInt = 1;
+                    }
+                    msg = msg.Replace ("{0}", unlockTimeInt.ToString ());
+                    tipStr = tipStr + "\r\n" + msg;
+                }
+            } catch { }
+
+            Utlis.ShowTip (tipStr);
+        }
+
 
         ///// <summary>
         ///// 鏌ヨ褰撳墠浣忓畢 缃戝叧鍒楄〃
@@ -643,7 +622,7 @@
         //        Application.RunOnMainThread (() => {
         //            new Alert ("", ErrorCode.FailedGetGatewaysForHome, Language.StringByID (R.MyInternationalizationString.Close)).Show ();
         //        });
-               
+
         //    }
 
 
@@ -692,7 +671,7 @@
         //        ShowGetAllBindGatewarysPaggerErrorInfo (gatewayListRevertObj.StateCode);
         //    }
         //}
-        
+
 
 
 

--
Gitblit v1.8.0