gxc
2019-10-30 6920fa0a981c2a55476afdc518358e971d8e0244
ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
old mode 100755 new mode 100644
@@ -8,6 +8,7 @@
using Shared.Phone.UserView;
using System.Net.Http;
using Shared.Phone.Device.CommonForm;
using Com.Tencent.MM.Sdk.Openapi;
namespace Shared.Phone.Device.Account
{
@@ -70,6 +71,14 @@
        /// 密码
        /// </summary>
        private string password;
        /// <summary>
        /// wechat
        /// </summary>
        private Button wechatBtn;
        /// <summary>
        /// qq
        /// </summary>
        private Button qqBtn;
        #endregion
@@ -190,7 +199,7 @@
                Width = Application.GetRealWidth(942),
                Gravity = Gravity.CenterHorizontal,
                BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor,
                Radius = (uint)Application.GetRealHeight(30)
                Radius = (uint)Application.GetRealHeight(17)
            };
            midFrameLayout.AddChidren(accountPwdFL);
@@ -230,7 +239,7 @@
            loginByCodeBtn = new Button()
            {
                X=Application.GetRealWidth(98),
                Y = Application.GetRealHeight(1431),
                Y = Application.GetRealHeight(1466),
                Width = Application.GetRealWidth(300),
                Height = Application.GetRealHeight(49),
                TextID = R.MyInternationalizationString.LoginByCode,
@@ -243,7 +252,7 @@
            registerBtn = new Button()
            {
                X = Application.GetRealWidth(738),
                Y = Application.GetRealHeight(1431),
                Y = Application.GetRealHeight(1466),
                Width = Application.GetRealWidth(244),
                Height = Application.GetRealHeight(49),
                TextID = R.MyInternationalizationString.Register,
@@ -252,6 +261,26 @@
                TextSize = CommonFormResouce.loginTextSize
            };
            midFrameLayout.AddChidren(registerBtn);
            wechatBtn = new Button
            {
                X = Application.GetRealWidth(395),
                Y = Application.GetRealHeight(1737),
                Width = Application.GetMinRealAverage(115),
                Height = Application.GetMinRealAverage(115),
                UnSelectedImagePath = "Account/Wechat.png"
            };
            midFrameLayout.AddChidren(wechatBtn);
            qqBtn = new Button
            {
                X = Application.GetRealWidth(567),
                Y = Application.GetRealHeight(1737),
                Width = Application.GetMinRealAverage(115),
                Height = Application.GetMinRealAverage(115),
                UnSelectedImagePath = "Account/QQ.png"
            };
            midFrameLayout.AddChidren(qqBtn);
            #endregion
@@ -278,7 +307,10 @@
            registerBtn.MouseUpEventHandler += Register;
            //忘记密码
            forgotPasswordBtn.MouseUpEventHandler += ForgetPWD_MouseUpEvent;
            //wechat
            wechatBtn.MouseUpEventHandler += LoginByWechat;
            //qq
            qqBtn.MouseUpEventHandler += LoginByQQ;
        }
        #endregion
@@ -446,10 +478,31 @@
        /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param>
        private void LoginByCode(object sender,MouseEventArgs mouseEventArgs)
        {
            this.RemoveFromParent();
            //this.RemoveFromParent();
            var loginByCodePage = new AccountLoginByCode();
            CommonPage.Instance.AddChidren(loginByCodePage);
            loginByCodePage.Show();
        }
        IWXAPI api;
        /// <summary>
        /// wechat登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="mouseEventArgs"></param>
        private void LoginByWechat(object sender,MouseEventArgs mouseEventArgs)
        {
            var req = new SendAuth.Req { Scope = "snsapi_userinfo", State = "ZigbeeApp" };
            api.SendReq(req);
        }
        /// <summary>
        /// qq登录
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="mouseEventArgs"></param>
        private void LoginByQQ(object sender, MouseEventArgs mouseEventArgs)
        {
        }
        /// <summary>
@@ -550,7 +603,7 @@
        private void Pwd_TextChange(object sender,string mouseEventArgs)
        {
            loginErrorBtn.Text = "";
            if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && phoneRow.AccountET.Text.Trim().Length > 0)
            if (1 <= pwdRow.PasswrodET.Text.Trim().Length && pwdRow.PasswrodET.Text.Trim().Length <= 16 && (phoneRow.AccountET.Text.Trim().Length > 0 || emailRow.AccountET.Text.Trim().Length>0))
            {
                loginBtn.Enable = loginBtn.IsSelected = true;
            }