From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码

---
 ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs |   94 +++++++++++++++++++++++++++++++++--------------
 1 files changed, 66 insertions(+), 28 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
old mode 100755
new mode 100644
index 67d3581..7975199
--- a/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
@@ -20,7 +20,7 @@
         /// <summary>
         /// 鏄惁鍚屾剰闅愮鍗忚
         /// </summary>
-        private bool isAgreePrivacyPolicy = true;
+        private bool isAgreePrivacyPolicy = false;
 
         #endregion
 
@@ -55,11 +55,11 @@
             //Evoyo Home鐨勫浘鏍�
             var btnLogoIcon = new PicViewControl(184, 184);
             btnLogoIcon.Y = Application.GetRealHeight(230);
-            btnLogoIcon.UnSelectedImagePath = "Account/Logo_White.png";
+            btnLogoIcon.UnSelectedImagePath = "Account/Logo_WhiteHome.png";
             btnLogoIcon.Gravity = Gravity.CenterHorizontal;
             this.AddChidren(btnLogoIcon);
             //Evoyo Home
-            var btnLogoName = new NormalViewControl(300, 69, true);
+            var btnLogoName = new NormalViewControl(700, 69, true);
             btnLogoName.Y = btnLogoIcon.Bottom;
             btnLogoName.Gravity = Gravity.CenterHorizontal;
             btnLogoName.TextID = R.MyInternationalizationString.AppName;
@@ -127,6 +127,9 @@
             frameMidBack.AddChidren(btnLoginByCode);
             btnLoginByCode.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 if (codeDiv == 1)
                 {
                     //楠岃瘉鐮佺櫥闄�
@@ -166,6 +169,9 @@
             frameMidBack.AddChidren(btnRegister);
             btnRegister.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 var registerPage = new AccountRegister();
                 CommonPage.Instance.AddChidren(registerPage);
                 registerPage.Show();
@@ -176,7 +182,7 @@
             btnWebChat.Y = frameMidBack.Height - Application.GetRealHeight(69) - btnWebChat.IconSize;
             btnWebChat.UnSelectedImagePath = "Account/Wechat.png";
             btnWebChat.Gravity = Gravity.CenterHorizontal;
-            frameMidBack.AddChidren(btnWebChat);
+            //frameMidBack.AddChidren(btnWebChat);
             btnWebChat.ButtonClickEvent += (sender, e) =>
             {
                 //寰俊鐧婚檰
@@ -184,7 +190,7 @@
             };
 
             //娣诲姞鏈嶅姟鍗忚鎺т欢
-            //this.AddServiceAgreementControl(frameMidBack);
+            this.AddServiceAgreementControl(frameMidBack);
 
             //娓稿浣撻獙
             var btnTiyan = new NormalViewControl(300, 100, true);
@@ -197,9 +203,11 @@
             frameMidBack.AddChidren(btnTiyan);
             btnTiyan.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 btnTiyan.CanClick = false;
                 //鏄剧ず鍚姩椤�
-                HomePage.Instance.ShowLoginLoadView();
                 HdlThreadLogic.Current.RunThread(() =>
                 {
                     //鍒濆鍖栧叏閮ㄤ綋楠屾暟鎹�
@@ -381,6 +389,9 @@
             frameWhiteBack.AddChidren(btnForgot);
             btnForgot.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 var forgot = new AccountForgetPWD();
                 CommonPage.Instance.AddChidren(forgot);
                 forgot.Show();
@@ -559,6 +570,9 @@
             rowVerCode.AddChidren(btnSendCode);
             btnSendCode.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 //妫�娴嬭緭鍏ョ殑璐﹀彿
                 nowInputAccount = txtAccount.Text.Trim();
                 if (this.CheckInputAccount("86", nowInputAccount, i_div) == false)
@@ -600,6 +614,9 @@
             frameWhiteBack.AddChidren(btnForgot);
             btnForgot.ButtonClickEvent += (sender, e) =>
             {
+                //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+                if (this.CheckPrivacyPolicy() == false) { return; }
+
                 var forgot = new AccountForgetPWD();
                 CommonPage.Instance.AddChidren(forgot);
                 forgot.Show();
@@ -667,7 +684,8 @@
             btnMsg2.ButtonClickEvent += (sender, e) =>
             {
                 var form = new UserCenter.Abount.SLAForm();
-                this.AddChidren(form);
+                CommonPage.Instance.AddChidren(form);
+
                 form.InitTopFrameLayout();
                 form.InitBodyFrameLayout();
                 form.ShowForm();
@@ -744,6 +762,8 @@
         /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param>
         private void LoginByAccountAndPsw(string i_account, string i_psw, int i_div)
         {
+            //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+            if (this.CheckPrivacyPolicy() == false) { return; }
             //妫�娴嬭处鍙�
             if (this.CheckInputAccount(string.Empty, i_account, i_div) == false)
             {
@@ -759,8 +779,6 @@
                 var pra = new SendDataToServer.LoginObj();
                 pra.Account = i_account;
                 pra.Password = i_psw;
-                pra.Source = CommonPage.Source;
-                pra.Company = CommonPage.Company;
 
                 //璁块棶鎺ュ彛
                 var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(pra);
@@ -816,6 +834,8 @@
         /// </summary>
         private void LoginByWechat()
         {
+            //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+            if (this.CheckPrivacyPolicy() == false) { return; }
 #if Android
             com.hdl.home.Application.WXLogin();
             com.hdl.home.WXEntryActivity.RespAction = (authStr) =>
@@ -836,23 +856,26 @@
                     var re = isBindAuthAsync(authStr);
                     if (re)
                     {
-                        HdlThreadLogic.Current.RunMain(() =>
-                        {
-                            //鐩存帴鐧诲綍
-                            HomePage.Instance.ShowLoginLoadView();
-                        });
+                        ProgressBar.Show(Language.StringByID(R.MyInternationalizationString.Logining));
+
                         var resultRegID = Shared.Common.CommonPage.Instance.PushRegID();
                         var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                         //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
-                        UserCenterLogic.InitUserCenterMenmoryAndThread();
+                        bool result = UserCenterLogic.InitUserCenterMenmoryAndThread();
+
                         //鍚姩ZigBee
                         ZigBee.Common.Application.Init();
 
                         HdlThreadLogic.Current.RunMain(() =>
                         {
+                            ProgressBar.Close();
                             this.RemoveFromParent();
                             CommonPage.Instance.RemoveViewByTag("Login");
-                            UserPage.Instance.ReFreshControl();
+                            if (result == true)
+                            {
+                                //false:寮�鍚簡璋冭瘯鍔熻兘
+                                UserPage.Instance.ReFreshControl();
+                            }
                         });
                     }
                     else
@@ -934,6 +957,8 @@
         /// <param name="i_div">1:鎵嬫満鍙� 2:閭</param>
         private void LoginByVerCode(string i_account, string i_verCode, int i_div)
         {
+            //妫�娴嬫槸鍚﹀悓鎰忔湇鍔″崗璁�
+            if (this.CheckPrivacyPolicy() == false) { return; }
             //鐧婚檰涓�....
             CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
 
@@ -1085,17 +1110,13 @@
                     CommonPage.Instance.FailureToServer();
                     CommonPage.Loading.Hide();
                 });
+                HdlLogLogic.Current.WriteLog(-1, "鐧婚檰鏃�,娌$綉缁�");
                 return;
             }
             var stateCodeStr = revertObj.StateCode.ToUpper();
             //Error 涓嶈兘鐩存帴浠庢湇鍔″櫒鍙栵紝鍙兘鏍规嵁鐘舵�佺爜閫愪竴鍒ゆ柇
             if (stateCodeStr == "SUCCESS")
             {
-                HdlThreadLogic.Current.RunMain(() =>
-                {
-                    //鏄剧ず鍚姩椤�
-                    HomePage.Instance.ShowLoginLoadView();
-                });
                 //瀛樺偍鏁版嵁
                 var responseDataObj = Newtonsoft.Json.JsonConvert.DeserializeObject<Shared.Common.ResponseEntity.UserLoginRes>(revertObj.ResponseData.ToString());
                 var revertData = responseDataObj;
@@ -1113,16 +1134,28 @@
                 var resultRegID = CommonPage.Instance.PushRegID();
                 var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                 //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
-                UserCenterLogic.InitUserCenterMenmoryAndThread();
-                //鍚姩ZigBee
-                ZigBee.Common.Application.Init();
+                bool result = UserCenterLogic.InitUserCenterMenmoryAndThread();
 
+                //鍚姩ZigBee
+                ZigBee.Common.Application.Init();
+
+//#if iOS
+
+//                //鍒濆鍖栧叏瑙嗛��
+//                Shared.IOS.HDLFVSDK.Video.Init("", revertData.UserID.ToString());
+
+//#endif
+
                 HdlThreadLogic.Current.RunMain(() =>
                 {
                     CommonPage.Loading.Hide();
                     this.RemoveFromParent();
                     CommonPage.Instance.RemoveViewByTag("Login");
-                    UserPage.Instance.ReFreshControl();
+                    if (result == true)
+                    {
+                        //false:寮�鍚簡璋冭瘯鍔熻兘
+                        UserPage.Instance.ReFreshControl();
+                    }
                 });
                 return;
             }
@@ -1165,6 +1198,11 @@
                     //璇峰厛鑾峰彇楠岃瘉鐮�
                     btnErrorMsg.TextID = R.MyInternationalizationString.NORECORD;
                 }
+                else if (stateCodeStr == "BERESTRICT")
+                {
+                    //姝よ处鍙锋棤鏉冪櫥褰�
+                    btnErrorMsg.TextID = R.MyInternationalizationString.ThisAccountHasNoAuthorityToLogin;
+                }
                 else if (stateCodeStr == "YOUDATANOISLOCALREGION")
                 {
                     //涓嶅湪鏈尯鍩燂紝闇�瑕侀噸瀹氬悜鍖哄煙鍚庡啀娆¤姹傜櫥褰�
@@ -1193,9 +1231,9 @@
             });
         }
 
-        #endregion
+#endregion
 
-        #region 鈻� 涓�鑸柟娉昣__________________________
+#region 鈻� 涓�鑸柟娉昣__________________________
 
         /// <summary>
         /// 妫�娴嬮殣绉佸崗璁�
@@ -1213,6 +1251,6 @@
             return true;
         }
 
-        #endregion
+#endregion
     }
 }

--
Gitblit v1.8.0