From 83f5dcf34d961ac18cf393a21687bf5aca199181 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期五, 11 三月 2022 09:26:50 +0800
Subject: [PATCH] 引入全视通dll库
---
ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs | 210 ++++++++++++++++++++++++++-------------------------
1 files changed, 107 insertions(+), 103 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
old mode 100755
new mode 100644
index 9e28391..9766a3c
--- a/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
+++ b/ZigbeeApp/Shared/Phone/Login/AccountRegisterSuccess.cs
@@ -1,18 +1,18 @@
锘縰sing System;
using System.Text;
using Shared.Common;
-using Shared.Phone.UserCenter;
+using Shared.Phone.UserCenter;
using Shared.Phone.UserView;
namespace Shared.Phone.Login
{
- /// <summary>
- /// 璐﹀彿娉ㄥ唽鎴愬姛鐨勬彁绀虹晫闈�
+ /// <summary>
+ /// 璐﹀彿娉ㄥ唽鎴愬姛鐨勬彁绀虹晫闈�
/// </summary>
public class AccountRegisterSuccess : FrameLayout
- {
- #region 鈻� 鍒濆鍖朹____________________________
-
+ {
+ #region 鈻� 鍒濆鍖朹____________________________
+
/// <summary>
/// 鍒濆鍖�
/// </summary>
@@ -22,72 +22,72 @@
public void ShowForm(string account, string password, string OpenID = "")
{
//鏁翠釜鑳屾櫙
- var frameBack = new FrameLayout();
+ var frameBack = new FrameLayout();
frameBack.BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor;
this.AddChidren(frameBack);
//涓婇儴榛戣壊閮ㄥ垎
var frameBlack = new FrameLayout();
- frameBlack.Y = Application.GetRealHeight(527);
- frameBlack.Width = Application.GetRealWidth(688);
- frameBlack.Height = Application.GetRealHeight(274);
- frameBlack.Gravity = Gravity.CenterHorizontal;
+ frameBlack.Y = Application.GetRealHeight(527);
+ frameBlack.Width = Application.GetRealWidth(688);
+ frameBlack.Height = Application.GetRealHeight(274);
+ frameBlack.Gravity = Gravity.CenterHorizontal;
frameBlack.BackgroundColor = ZigbeeColor.Current.GXCBlackBackgroundColor;
frameBlack.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerTopLeft | HDLUtils.RectCornerTopRight);
this.AddChidren(frameBlack);
//涓嬮儴鐧借壊閮ㄥ垎
- var frameWhite = new FrameLayout();
- frameWhite.Y = frameBlack.Bottom;
- frameWhite.Width = Application.GetRealWidth(688);
- frameWhite.Height = Application.GetRealHeight(579);
- frameWhite.Gravity = Gravity.CenterHorizontal;
+ var frameWhite = new FrameLayout();
+ frameWhite.Y = frameBlack.Bottom;
+ frameWhite.Width = Application.GetRealWidth(688);
+ frameWhite.Height = Application.GetRealHeight(579);
+ frameWhite.Gravity = Gravity.CenterHorizontal;
frameWhite.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
frameWhite.SetCornerWithSameRadius(Application.GetRealHeight(17), HDLUtils.RectCornerBottomLeft | HDLUtils.RectCornerBottomRight);
this.AddChidren(frameWhite);
//璐﹀彿澶村儚
- var btnAccountIcon = new PicViewControl(294, 316);
- btnAccountIcon.Y = Application.GetRealHeight(648);
- btnAccountIcon.Gravity = Gravity.CenterHorizontal;
+ var btnAccountIcon = new PicViewControl(294, 316);
+ btnAccountIcon.Y = Application.GetRealHeight(648);
+ btnAccountIcon.Gravity = Gravity.CenterHorizontal;
btnAccountIcon.UnSelectedImagePath = "Account/Cat.png";
this.AddChidren(btnAccountIcon);
//璐﹀彿
- var btnAccount = new NormalViewControl(500, 80, true);
- btnAccount.Y = btnAccountIcon.Bottom;
- btnAccount.Gravity = Gravity.CenterHorizontal;
- btnAccount.Text = account;
- btnAccount.TextColor = ZigbeeColor.Current.GXCTextGrayColor2;
+ var btnAccount = new NormalViewControl(500, 80, true);
+ btnAccount.Y = btnAccountIcon.Bottom;
+ btnAccount.Gravity = Gravity.CenterHorizontal;
+ btnAccount.Text = account;
+ btnAccount.TextColor = ZigbeeColor.Current.GXCTextGrayColor2;
btnAccount.TextAlignment = TextAlignment.Center;
this.AddChidren(btnAccount);
//鎭枩娉ㄥ唽鎴愬姛锛�
- var btnTip = new NormalViewControl(500, 80, true);
- btnTip.Y = Application.GetRealHeight(1143);
- btnTip.Gravity = Gravity.CenterHorizontal;
- btnTip.TextID = R.MyInternationalizationString.RegisterSuccessTip;
- btnTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor2;
- btnTip.TextAlignment = TextAlignment.Center;
+ var btnTip = new NormalViewControl(500, 80, true);
+ btnTip.Y = Application.GetRealHeight(1143);
+ btnTip.Gravity = Gravity.CenterHorizontal;
+ btnTip.TextID = R.MyInternationalizationString.RegisterSuccessTip;
+ btnTip.TextColor = ZigbeeColor.Current.GXCTextBlackColor2;
+ btnTip.TextAlignment = TextAlignment.Center;
btnTip.TextSize = 16;
btnTip.IsBold = true;
this.AddChidren(btnTip);
//鍗冲皢鑷姩鐧诲綍
- var btnWillLogin = new NormalViewControl(500, 80, true);
- btnWillLogin.Y = btnTip.Bottom + Application.GetRealHeight(15);
- btnWillLogin.Gravity = Gravity.CenterHorizontal;
- btnWillLogin.TextID = R.MyInternationalizationString.WillAutoLogin;
+ var btnWillLogin = new NormalViewControl(500, 80, true);
+ btnWillLogin.Y = btnTip.Bottom + Application.GetRealHeight(15);
+ btnWillLogin.Gravity = Gravity.CenterHorizontal;
+ btnWillLogin.TextID = R.MyInternationalizationString.WillAutoLogin;
btnWillLogin.TextColor = ZigbeeColor.Current.GXCTextGrayColor;
btnWillLogin.TextAlignment = TextAlignment.Center;
AddChidren(btnWillLogin);
HdlThreadLogic.Current.RunThread(() =>
- {
- System.Threading.Thread.Sleep(2000);
- //2绉掑悗鑷姩鐧诲綍
- this.LoginByAccountAndPsw(account, password, OpenID);
- });
- }
-
+ {
+ System.Threading.Thread.Sleep(2000);
+ //2绉掑悗鑷姩鐧诲綍
+ this.LoginByAccountAndPsw(account, password, OpenID);
+ });
+ }
+
#endregion
-
- #region 鈻� 鑷姩鐧诲綍___________________________
-
+
+ #region 鈻� 鑷姩鐧诲綍___________________________
+
/// <summary>
/// AutoLogin
/// </summary>
@@ -96,56 +96,60 @@
private void LoginByAccountAndPsw(string account, string password, string OpenID = "")
{
HdlThreadLogic.Current.RunMain(() =>
- {
- //鎵撳紑鍚姩椤�
- HomePage.Instance.ShowLoginLoadView();
- CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
-
- HdlThreadLogic.Current.RunThread(async () =>
- {
- //璐﹀彿瀵嗙爜鐧婚檰
- var loginSuccess = await HomePage.Instance.LoginByPWDAsync(account, password);
- if (loginSuccess == 1)
- {
- if (string.IsNullOrEmpty(OpenID) == false)
- {
- //缁戝畾绗笁鏂�
- await BindAuthUser(Config.Instance.Guid, OpenID);
- }
- var homes = await House.GetHomeLists();
-
- //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
- await UserCenterLogic.InitUserCenterMenmoryAndThread();
- //鍚姩ZigBee
- ZigBee.Common.Application.Init();
-
- HdlThreadLogic.Current.RunMain(() =>
- {
- CommonPage.Loading.Hide();
- this.RemoveFromParent();
- CommonPage.Instance.RemoveViewByTag("Register");
- CommonPage.Instance.RemoveViewByTag("Login");
- UserPage.Instance.ReFreshControl();
- });
- }
- else
- {
- HdlThreadLogic.Current.RunMain(() =>
- {
- //鏈櫥褰曟垚鍔熷脊鍑虹櫥褰曠晫闈� 鍚屾椂闇�瑕佹爣璁颁负鏈櫥褰曠姸鎬�
- Config.Instance.LoginDateTime = new DateTime(1970, 1, 1);
- Config.Instance.Save();
- var login = new AccountLoginForm();
- CommonPage.Instance.AddChidren(login);
- login.ShowForm(account);
- });
- }
- });
+ {
+ //鎵撳紑鍚姩椤�
+ CommonPage.Loading.Start(Language.StringByID(R.MyInternationalizationString.Logining));
+
+ HdlThreadLogic.Current.RunThread(() =>
+ {
+ //璐﹀彿瀵嗙爜鐧婚檰
+ var loginSuccess = HomePage.Instance.LoginByPWDAsync(account, password);
+ if (loginSuccess == 1)
+ {
+ if (string.IsNullOrEmpty(OpenID) == false)
+ {
+ //缁戝畾绗笁鏂�
+ BindAuthUser(Config.Instance.Guid, OpenID);
+ }
+ var homes = HdlResidenceLogic.Current.GetHomeListsFromDb(false);
+
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ bool result = UserCenterLogic.InitUserCenterMenmoryAndThread();
+
+ //鍚姩ZigBee
+ ZigBee.Common.Application.Init();
+
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ CommonPage.Loading.Hide();
+ this.RemoveFromParent();
+ CommonPage.Instance.RemoveViewByTag("Register");
+ CommonPage.Instance.RemoveViewByTag("Login");
+ if (result == true)
+ {
+ //false:寮�鍚簡璋冭瘯鍔熻兘
+ UserPage.Instance.ReFreshControl();
+ }
+ });
+ }
+ else
+ {
+ HdlThreadLogic.Current.RunMain(() =>
+ {
+ //鏈櫥褰曟垚鍔熷脊鍑虹櫥褰曠晫闈� 鍚屾椂闇�瑕佹爣璁颁负鏈櫥褰曠姸鎬�
+ Config.Instance.LoginDateTime = new DateTime(1970, 1, 1);
+ Config.Instance.Save();
+ var login = new AccountLoginForm();
+ CommonPage.Instance.AddChidren(login);
+ login.ShowForm(account);
+ });
+ }
+ });
});
- }
-
- #endregion
-
+ }
+
+ #endregion
+
#region 鈻� 缁戝畾绗笁鏂筥________________________
/// <summary>
@@ -153,16 +157,16 @@
/// </summary>
/// <param name="guid"></param>
/// <param name="openId"></param>
- private async System.Threading.Tasks.Task BindAuthUser(string guid, string openId)
- {
- var auth = new SendDataToServer.BindAuthUser();
- auth.AccountGuid = guid;
- auth.OpenID = openId;
-
- var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth);
- await CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson));
- }
-
+ private void BindAuthUser(string guid, string openId)
+ {
+ var auth = new SendDataToServer.BindAuthUser();
+ auth.AccountGuid = guid;
+ auth.OpenID = openId;
+
+ var requestJson = Newtonsoft.Json.JsonConvert.SerializeObject(auth);
+ CommonPage.Instance.RequestHttpsZigbeeAsync("ZigbeeUsers/BindAuthUserToAccount", Encoding.UTF8.GetBytes(requestJson));
+ }
+
#endregion
}
}
--
Gitblit v1.8.0