黄学彪
2020-09-01 dee21bf452a8979d0515d13e534fbb69ed9715dd
ZigbeeApp/Shared/Phone/Login/AccountLoginForm.cs
@@ -20,7 +20,7 @@
        /// <summary>
        /// 是否同意隐私协议
        /// </summary>
        private bool isAgreePrivacyPolicy = true;
        private bool isAgreePrivacyPolicy = false;
        #endregion
@@ -55,7 +55,7 @@
            //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
@@ -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();
@@ -744,6 +761,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)
            {
@@ -816,6 +835,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 +857,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();
                        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 +958,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));
@@ -1091,11 +1117,6 @@
            //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;
@@ -1111,9 +1132,10 @@
                Config.Instance.Save();
                var resultRegID = CommonPage.Instance.PushRegID();
                var homes = HdlResidenceLogic.Current.GetHomeListsFromDb();
                var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
                //刷新个人中心的内存及线程
                UserCenterLogic.InitUserCenterMenmoryAndThread();
                bool result = UserCenterLogic.InitUserCenterMenmoryAndThread();
                //启动ZigBee
                ZigBee.Common.Application.Init();
@@ -1122,7 +1144,11 @@
                    CommonPage.Loading.Hide();
                    this.RemoveFromParent();
                    CommonPage.Instance.RemoveViewByTag("Login");
                    UserPage.Instance.ReFreshControl();
                    if (result == true)
                    {
                        //false:开启了调试功能
                        UserPage.Instance.ReFreshControl();
                    }
                });
                return;
            }