From 4ce5177289b1d34e467de9d8790836559cc5a09e Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期一, 18 十一月 2019 18:06:28 +0800
Subject: [PATCH] 合并了全部的代码
---
ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs | 94 +++++++++++++++++++++++++++++++++++------------
1 files changed, 70 insertions(+), 24 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
index 5dcf41b..f21a869 100755
--- a/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
+++ b/ZigbeeApp/Shared/Phone/Device/Account/AccountLogin.cs
@@ -1,11 +1,7 @@
锘縰sing System;
-using System.Collections.Generic;
-using System.Net;
-using System.Text;
using Shared.Common;
using Shared.Phone.UserView;
using Shared.Phone.Device.CommonForm;
-using Com.Tencent.MM.Sdk.Openapi;
namespace Shared.Phone.Device.Account
{
@@ -265,7 +261,8 @@
Y = Application.GetRealHeight(1737),
Width = Application.GetMinRealAverage(115),
Height = Application.GetMinRealAverage(115),
- UnSelectedImagePath = "Account/Wechat.png"
+ UnSelectedImagePath = "Account/Wechat.png",
+ Gravity=Gravity.CenterHorizontal
};
midFrameLayout.AddChidren(wechatBtn);
@@ -277,7 +274,7 @@
Height = Application.GetMinRealAverage(115),
UnSelectedImagePath = "Account/QQ.png"
};
- midFrameLayout.AddChidren(qqBtn);
+ //midFrameLayout.AddChidren(qqBtn);
#endregion
@@ -370,9 +367,8 @@
{
return;
}
- this.RemoveFromParent();
- UserPage.Instance.Fresh();
+ HomePage.Instance.ShowLoginLoadView();
new System.Threading.Thread(async () =>
{
@@ -401,12 +397,13 @@
var homes = await House.GetHomeLists();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Shared.Common.Room.CanInitAllRoom = true;
Shared.Common.Room.InitAllRoom();
Application.RunOnMainThread(() =>
{
- UserPage.Instance.Fresh();
CommonPage.Loading.Hide();
+ this.RemoveFromParent();
+ CommonPage.Instance.RemoveViewByTag("Login");
+ UserPage.Instance.Fresh();
});
})
{ IsBackground = true }.Start();
@@ -489,15 +486,15 @@
private void LoginByWechat(object sender, MouseEventArgs mouseEventArgs)
{
#if Android
- var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP),
- Language.StringByID(R.MyInternationalizationString.LoginByWechat),
- Language.StringByID(R.MyInternationalizationString.Cancel),
- Language.StringByID(R.MyInternationalizationString.Confrim));
- alert.Show();
- alert.ResultEventHandler += (send, e) =>
- {
- if (e)
- {
+ //var alert = new Alert(Language.StringByID(R.MyInternationalizationString.TIP),
+ // Language.StringByID(R.MyInternationalizationString.LoginByWechat),
+ // Language.StringByID(R.MyInternationalizationString.Cancel),
+ // Language.StringByID(R.MyInternationalizationString.Confrim));
+ //alert.Show();
+ //alert.ResultEventHandler += (send, e) =>
+ //{
+ //if (e)
+ //{
com.hdl.home.Application.WXLogin();
com.hdl.home.WXEntryActivity.RespAction = (authStr) =>
{
@@ -509,25 +506,22 @@
{
new System.Threading.Thread(async () =>
{
-
var re = await isBindAuthAsync(authStr);
if (re)
{
//鐩存帴鐧诲綍
- //this.RemoveFromParent();
-
- //UserPage.Instance.Fresh();
+ HomePage.Instance.ShowLoginLoadView();
//鍚姩ZigBee
ZigBee.Common.Application.Init();
var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
var homes = await House.GetHomeLists();
//鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
- Shared.Common.Room.CanInitAllRoom = true;
Shared.Common.Room.InitAllRoom();
Application.RunOnMainThread(() =>
{
this.RemoveFromParent();
+ CommonPage.Instance.RemoveViewByTag("Login");
UserPage.Instance.Fresh();
});
}
@@ -546,10 +540,62 @@
{ IsBackground = true }.Start();
}
};
+ //}
+ //};
+#endif
+
+#if iOS
+ GateWay.Ios.AppDelegate.WXLogin();
+ GateWay.Ios.AppDelegate.RespAction = (authStr) =>
+ {
+ if (authStr == null)
+ {
+
+ }
+ else
+ {
+ new System.Threading.Thread(async () =>
+ {
+
+ var re = await isBindAuthAsync(authStr);
+ if (re)
+ {
+ //鐩存帴鐧诲綍
+ //this.RemoveFromParent();
+
+ //UserPage.Instance.Fresh();
+ //鍚姩ZigBee
+ ZigBee.Common.Application.Init();
+ var resultRegID = await Shared.Common.CommonPage.Instance.PushRegID();
+ var homes = await House.GetHomeLists();
+ //鍒锋柊涓汉涓績鐨勫唴瀛樺強绾跨▼
+ await UserCenter.UserCenterLogic.InitUserCenterMenmoryAndThread();
+ Shared.Common.Room.InitAllRoom();
+ Application.RunOnMainThread(() =>
+ {
+ this.RemoveFromParent();
+ UserPage.Instance.Fresh();
+ });
+ }
+ else
+ {
+ var authRes = Newtonsoft.Json.JsonConvert.DeserializeObject<Common.ResponseEntity.AuthUserRes>(authStr);
+ Application.RunOnMainThread(() =>
+ {
+ var registerPage = new AccountRegister();
+ Shared.Common.CommonPage.Instance.AddChidren(registerPage);
+ registerPage.OpenID = authRes.openid;
+ registerPage.Show();
+ });
+ }
+ })
+ { IsBackground = true }.Start();
}
};
#endif
+
+
}
/// <summary>
--
Gitblit v1.8.0