From 5a5a2b696866f947b6025d26c3302e8ffef46435 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 11 一月 2021 16:11:20 +0800
Subject: [PATCH] 2021-01-11 1.更新MQTT连接和本地搜索网关方法。2.子账号相关接口完善

---
 Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs |   53 ++++++++++++++++++++++++++++++++---------------------
 1 files changed, 32 insertions(+), 21 deletions(-)

diff --git a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
index 19c0095..1f481e5 100644
--- a/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
+++ b/Crabtree/SmartHome/UI/SimpleControl/Phone/Register/AccountView.cs
@@ -1,6 +1,5 @@
 锘縰sing System;
 using System.Collections.Generic;
-using service.hdlcontrol.com_push;
 
 namespace Shared.SimpleControl.Phone
 {
@@ -60,7 +59,7 @@
             Button btnUserIcon = new Button () {
                 X = Application.GetRealWidth (27),
                 Width = Application.GetRealWidth (96),
-                Height = Application.GetRealHeight (96),
+                Height = Application.GetRealWidth (96),
                 Gravity = Gravity.CenterVertical,
                 Radius = 5,
                 BorderColor = SkinStyle.Current.Transparent,
@@ -79,12 +78,12 @@
                         Room.Lists.Clear ();
                         new AccountLogin (MainPage.LoginUser.AccountString, "").Show ();
 
-                        System.Threading.Tasks.Task.Run (() => {
-                            WebServicePush webPush = new WebServicePush ();
-                            webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
-                            if (string.IsNullOrEmpty (UserConfig.Instance.RemoteModeFile))
-                                return;
-                        });
+                        //System.Threading.Tasks.Task.Run (() => {
+                        //    WebServicePush webPush = new WebServicePush ();
+                        //    webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
+                        //    if (string.IsNullOrEmpty (UserConfig.Instance.RemoteModeFile))
+                        //        return;
+                        //});
                         CommonPage.IsRemote = false;
                     }
                 };
@@ -217,7 +216,7 @@
                     tipView.AddChidren (btnTipMsg);
 
                     var bottomView = new FrameLayout () {
-                        Y = btnTipMsg.Bottom,
+                        Y = tipView.Height - Application.GetRealHeight (120),
                         Height = Application.GetRealHeight (120),
                         BackgroundColor = SkinStyle.Current.MainColor,
                     };
@@ -258,7 +257,7 @@
                         alertDialog.Close ();
                         IO.FileUtils.DeleteAllFile ();
                         foreach (var tempHome in UserConfig.Instance.HomeLists) {
-                            IO.FileUtils.DeleteRegionFiles (IO.FileUtils.CreateRegionBackup (tempHome.Name));
+                            IO.FileUtils.DeleteRegionFiles (IO.FileUtils.CreateRegionBackup (tempHome.Id));
                         }
                         MainPage.LoginUser.LastTime = DateTime.MinValue;
                         MainPage.LoginUser.SaveUserInfo ();
@@ -266,11 +265,17 @@
                         new AccountLogin (MainPage.LoginUser.AccountString, "").Show ();
                         this.RemoveFromParent ();
                         SharedMethod.SharedMethod.CurPageLayout = null;
-                        System.Threading.Tasks.Task.Run (() => {
-                            var webPush = new WebServicePush ();
-                            webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
-                        });
-                        CommonPage.IsRemote = false;
+                        //System.Threading.Tasks.Task.Run (() => {
+                        //    var webPush = new WebServicePush ();
+                        //    webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
+                        //});
+                        //2020-02-17 閫�鍑虹櫥褰曪紝鏂紑杩滅▼杩炴帴
+                        if (CommonPage.IsRemote) {
+                            Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline);
+                            CommonPage.IsRemote = false;
+                            SmartHome.MqttCommon.DisConnectRemote ("Logout");
+                        }
+                        //CommonPage.IsRemote = false;
                     };
 
                     btnNo.MouseUpEventHandler += (sdd, ff) => {
@@ -280,11 +285,17 @@
                         Room.Lists.Clear ();
                         new AccountLogin (MainPage.LoginUser.AccountString, "").Show ();
                         this.RemoveFromParent ();
-                        System.Threading.Tasks.Task.Run (() => {
-                            var webPush = new WebServicePush ();
-                            webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
-                        });
-                        CommonPage.IsRemote = false;
+                        //System.Threading.Tasks.Task.Run (() => {
+                        //    var webPush = new WebServicePush ();
+                        //    webPush.DeleteToken_Push (UserConfig.Instance.tokenID);
+                        //});
+                        //CommonPage.IsRemote = false;
+                        //2020-02-17 閫�鍑虹櫥褰曪紝鏂紑杩滅▼杩炴帴
+                        if (CommonPage.IsRemote) {
+                            Utlis.ShowAppLinkStatus (AppLinkStatus.WiFiOffline);
+                            CommonPage.IsRemote = false;
+                            SmartHome.MqttCommon.DisConnectRemote ("Logout");
+                        }
                     };
 
                     alertDialog.Show ();
@@ -295,7 +306,7 @@
                     //    if (e2) {
                     //        IO.FileUtils.DeleteAllFile ();
                     //        foreach (var tempHome in UserConfig.Instance.HomeLists) {
-                    //            IO.FileUtils.DeleteRegionFiles (IO.FileUtils.CreateRegionBackup (tempHome.RegionName));
+                    //            IO.FileUtils.DeleteRegionFiles (IO.FileUtils.CreateRegionBackup (tempHome.Id));
                     //        }
                     //    }
                     //    MainPage.LoginUser.LastTime = DateTime.MinValue;

--
Gitblit v1.8.0