From 6920fa0a981c2a55476afdc518358e971d8e0244 Mon Sep 17 00:00:00 2001
From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local>
Date: 星期三, 30 十月 2019 10:45:16 +0800
Subject: [PATCH] 2019.10.30

---
 ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs |   65 +++++++++++++++++++++++++++++---
 1 files changed, 59 insertions(+), 6 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
old mode 100755
new mode 100644
index 145ef10..ddb9ce1
--- a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
@@ -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;
             }

--
Gitblit v1.8.0