From 16b65f9019f8df3b154ab835b92879ca618be1c3 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期三, 03 二月 2021 16:28:10 +0800
Subject: [PATCH] 2021-02-03 1.增加丰林可视对讲测试验证

---
 HDL_ON/UI/UI1-Login/LoginPageBLL.cs |  183 ++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 177 insertions(+), 6 deletions(-)

diff --git a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
index 879c8c2..3383d85 100644
--- a/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
+++ b/HDL_ON/UI/UI1-Login/LoginPageBLL.cs
@@ -6,6 +6,8 @@
 using Shared;
 using HDL_ON.Entity;
 using HDL_ON.DAL.Server;
+using System.Security.Cryptography;
+using System.Text;
 
 namespace HDL_ON.UI.UI1Login
 {
@@ -598,7 +600,7 @@
                             if (verAccount == etPassword.Text.Trim())
                             {
                                 //璺宠浆椤甸潰----
-                                MainPage.GoUserPage();
+                                MainPage.GoUserPage(true);
                                 return;
                             }
                         });
@@ -629,12 +631,20 @@
                             //}
                             Application.RunOnMainThread(() =>
                             {
+                                //20201223-鐧诲綍鎴愬姛涔嬪悗锛屽皢涓嬭浇鏁版嵁瀹屾垚鏍囪鏍囪涓篺alse锛岄槻姝富椤垫彁鍓嶅姞杞�
+                                Common.ApiUtlis.Ins.DownloadDataComplete = false;
                                 //璺宠浆椤甸潰----
-                                MainPage.GoUserPage();
+                                MainPage.GoUserPage(true);
                             });
                         }
                         else
                         {
+                            BindingResidencePage page = new BindingResidencePage();
+                            MainPage.BaseView.AddChidren(page);
+                            page.LoadView();
+
+
+
                             //2020-11-13 寰呯‘璁�
                             //鑾峰彇浣忓畢澶辫触锛岄噸鏂版爣璁颁负鏈櫥褰曠姸鎬�
                             UserInfo.Current.LastTime = DateTime.MinValue;
@@ -719,8 +729,7 @@
                 //鑾峰彇鐢ㄦ埛淇℃伅
                 new Thread(() =>
                 {
-                    pm.GetUserHeadImage(revertData.userId);
-                    pm.GetUserInfo(false);
+                    pm.GetUserInfo();
                 })
                 { IsBackground = true }.Start();
             }
@@ -730,6 +739,8 @@
                 //璐﹀彿鎴栬�呭瘑鐮侀敊璇�
                 Application.RunOnMainThread(() =>
                 {
+                    waitPage.Hide();
+
                     if (loginResult.Code == "10008")
                     {
                         //鐢ㄦ埛鍚嶆垨瀵嗙爜閿欒
@@ -747,12 +758,53 @@
                         btnPasswordViewBottomLine.BackgroundColor = CSS_Color.AuxiliaryColor2;
                         btnPasswordViewBottomLine.Height = Application.GetRealHeight(2);
                     }
-                    waitPage.Hide();
+                    else if (loginResult.Code == StateCode.AccountLoginLock)
+                    {
+                        ShowAccountLoginLockTip(loginResult);
+                        //var tipStr = Language.StringByID(StringId.AccountLoginLock) + "\r\n" + Language.StringByID(StringId.PleaseTryToForgetPassword);
+                        //Utlis.ShowTip(tipStr);
+                        return;
+                    }
+                    IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code);
                 });
 
-                IMessageCommon.Current.ShowErrorInfoAlter(loginResult.Code);
+            
             }
             return result;
+        }
+
+        /// <summary>
+        /// 瑙f瀽鎻愮ず鐢ㄦ埛瑙i攣鏃堕棿
+        /// 瀵嗙爜閿欒娆℃暟杩囧锛岃处鍙疯閿佸畾锛佽閫氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴杮0}鍒嗛挓鍚庨噸璇�.
+        /// </summary>
+        /// <param name="loginResult"></param>
+        void ShowAccountLoginLockTip(ResponsePackNew loginResult)
+        {
+            //瀵嗙爜閿欒娆℃暟杩囧锛岃处鍙疯閿佸畾锛�
+            var tipStr = Language.StringByID(StringId.AccountLoginLock);
+            try
+            {
+                if (loginResult.extra != null)
+                {
+                    //璇烽�氳繃蹇樿瀵嗙爜鎵惧洖瀵嗙爜鎴杮0}鍒嗛挓鍚庨噸璇�.
+                    var revertData = Newtonsoft.Json.JsonConvert.DeserializeObject<AccountLoginLockExtraRes>(loginResult.extra.ToString());
+                    string msg = Language.StringByID(StringId.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>
@@ -787,6 +839,15 @@
         {
             btnRegister.MouseUpEventHandler += (sender, e) =>
             {
+                //2020-12-22 澧炲姞鐐瑰嚮闅愯棌閿洏浜嬩欢
+                Application.HideSoftInput();
+
+
+#if DEBUG
+                TestEZSDK();
+                return;
+#endif
+
                 //鍒ゆ柇鏄惁鍚屾剰浜嗛殣绉佹斂绛�
                 if (CheckPrivacyPolicy() == false) return;
 
@@ -801,11 +862,83 @@
                         MainPage.Log($"login callBackAction : {ex.Message}");
                     }
                 };
+               
 
                 var registerPage = new RegisterPage(autoLoginAction);
                 registerPage.Show();
                 registerPage.ShowDialog();
             };
+        }
+
+
+        void TestESVideo()
+        {
+            var mESVideoInfo = new ESVideoInfo()
+            {
+                DeviceName = "瀹ゅ鏈�88",
+                ESVideoUUID = "JJY000019VPLLF",
+                ESRoomID = 801,
+                RoomName = "801"
+
+            };
+
+#if __Android__
+
+            Android.Content.Intent intent = new Android.Content.Intent(Application.Activity, typeof(HDL_ON_Android.VideoActivity));
+            intent.PutExtra("DeviceName", mESVideoInfo.DeviceName);//瀹ゅ鏈虹殑鍚嶇О锛屼緥锛屽澶栨満
+            intent.PutExtra("ESRoomID", mESVideoInfo.ESRoomID);//褰撳墠鐢ㄦ埛鐨勬埧闂� ID
+            intent.PutExtra("ESVideoUUID", mESVideoInfo.ESVideoUUID);//瀹ゅ鏈篣UID锛屼緥:JJY000007FSEYX
+            intent.PutExtra("IsCollect", mESVideoInfo.IsCollect);//鏄惁鏀惰棌
+            intent.PutExtra("RoomName", mESVideoInfo.RoomName);//鎴块棿鍛藉悕锛屼緥 8鏍�1鍗曞厓0801
+            intent.AddFlags(Android.Content.ActivityFlags.NewTask);
+            intent.PutExtra("Type", 0);//绫诲瀷锛�0 鐩戞帶锛�1鍙嶅懠
+            Application.Activity.StartActivity(intent);
+#else
+            //EZSDK.IOS.EZSDK.Go2EZvizMonitor();
+            Shared.ESVideoInfo eSVideoInfo = new Shared.ESVideoInfo();
+            eSVideoInfo.DeviceName = "瀹ゅ鏈�88";
+            eSVideoInfo.ESVideoUUID = "JJY000019VPLLF";
+            eSVideoInfo.ESRoomID = 801;
+            eSVideoInfo.RoomName = "0801";
+            Shared.ESVideo.ShowESVideoMonitor(eSVideoInfo);
+            return;
+#endif
+
+        }
+
+        /// <summary>
+        /// 
+        /// </summary>
+        /// <param name="signstr"></param>
+        /// <returns></returns>
+        static string SignMD5Encrypt(string s)
+        {
+            byte[] sign = MD5.Create().ComputeHash(UTF8Encoding.UTF8.GetBytes(s));
+            string signstr = string.Empty;
+            foreach (byte item in sign)
+            {
+                signstr += item.ToString("X2");
+            }
+            return signstr.ToLower();
+        }
+
+        void TestEZSDK()
+        {
+
+#if __Android__
+#else
+            //璁剧疆瀛愯处鍙稟ccessToken鏂规
+            EZSDK.IOS.EZSDK.SetEZAccessToken("ra.cekz6j9y1zg7mqgj3rmb099p49fuf6w3-9keosamseq-00wktld-brmhuciz1");
+
+            EZSDK.IOS.EZSDK.Go2EZvizMonitor();
+
+
+            //var psw = SignMD5Encrypt("1aa98a90489b4838b966b57018b4b04b#123456");
+
+            //Utlis.WriteLine("MD5 psw: " + psw);
+            return;
+#endif
+
         }
 
         /// <summary>
@@ -815,6 +948,14 @@
         {
             btnForgetPassword.MouseUpEventHandler += (sender, e) =>
             {
+                //2020-12-22 澧炲姞鐐瑰嚮闅愯棌閿洏浜嬩欢
+                Application.HideSoftInput();
+
+#if DEBUG
+                TestESVideo();
+                return;
+#endif
+
                 //鍒ゆ柇鏄惁鍚屾剰浜嗛殣绉佹斂绛�
                 if (CheckPrivacyPolicy() == false) return;
 
@@ -830,6 +971,7 @@
                         MainPage.Log($"login callBackAction : {ex.Message}");
                     }
                 };
+
                 var forgetPasswordDialog = new ForgetPasswordPage(autoLoginAction);
                 forgetPasswordDialog.Show();
                 forgetPasswordDialog.ShowDialog();
@@ -875,4 +1017,33 @@
             new PublicAssmebly().LoadPage_WaitPage(loginThread, bodyView, waitPage);
         }
     }
+
+    public class ESVideoInfo
+    {
+        /// <summary>
+        /// 瀹ゅ鏈虹殑UUID
+        /// 渚嬶細JJY000007FSEYX
+        /// </summary>
+        public string ESVideoUUID = string.Empty;
+        /// <summary>
+        /// 褰撳墠鐢ㄦ埛鐨勬埧闂碔D
+        /// 渚嬶細0801
+        /// </summary>
+        public int ESRoomID;
+        /// <summary>
+        /// 瀹ゅ鏈虹殑鍚嶇О
+        /// 渚嬶細瀹ゅ鏈�
+        /// </summary>
+        public string DeviceName = string.Empty;
+        /// <summary>
+        /// 鎴块棿鍛藉悕
+        /// 渚嬶細8鏍�1鍗曞厓0801
+        /// </summary>
+        public string RoomName = string.Empty;
+        /// <summary>
+        /// 鏄惁鏀惰棌
+        /// </summary>
+        public bool IsCollect;
+
+    }
 }
\ No newline at end of file

--
Gitblit v1.8.0