| | |
| | | UserMiddle.updateSensorhreadList.Clear (); |
| | | } |
| | | |
| | | //2020-01-11 |
| | | /// <summary> |
| | | /// 移除GuidePageView |
| | | /// </summary> |
| | | static void removeGuidePageView () |
| | | { |
| | | if (guidePageView != null) { |
| | | if (guidePageView.Parent != null) { |
| | | Utlis.WriteLine ("移除GuidePageView Parent 不为"); |
| | | } |
| | | |
| | | guidePageView.RemoveFromParent (); |
| | | |
| | | } |
| | | } |
| | | /// <summary> |
| | | /// 是否刷新过住宅信息 2022-06-22 14:16:27 |
| | | /// </summary> |
| | | static bool refreshHomeData = false; |
| | | |
| | | /// <summary> |
| | | /// 2020-01-11 |
| | | /// </summary> |
| | | /// <param name="isGuide">是否Guide</param> |
| | | /// <param name="bFromLogin">是否来自登录界面</param> |
| | | public static void Init (bool isGuide = false, bool bFromLogin = false) |
| | | { |
| | | if (MainPage.LoginUser == null) |
| | |
| | | new AccountLogin ().Show (); |
| | | UserConfig.Instance.TipVersionBackup = UserConfig.Instance.VersionNumber; |
| | | } else { |
| | | //2021-03-23 移除GuidePageView |
| | | removeGuidePageView (); |
| | | |
| | | //if (UserConfig.Instance.GatewayList.Count == 0) { |
| | | //2020-01-11 Mac没绑定 是否来只登录界面 |
| | | if (bFromLogin) { |
| | | if (!UserConfig.Instance.CheckHomeGatewaysNotEmpty ()) { |
| | | if (guidePageView != null) { |
| | | guidePageView.RemoveAll (); |
| | | guidePageView.RemoveFromParent (); |
| | | #region 多次迁移住宅导致网关被移除的情况 |
| | | if (!refreshHomeData) { |
| | | refreshHomeData = true; |
| | | //获取住宅列表 |
| | | var revertObjCode = HttpServerRequest.Current.GetHomePager (); |
| | | if (revertObjCode == StateCode.SUCCESS) { |
| | | var mHomeLists = UserConfig.Instance.HomeLists; |
| | | |
| | | if (mHomeLists != null && mHomeLists.Count > 0) { |
| | | var bFind = false; |
| | | foreach (var mHome in mHomeLists) { |
| | | if (mHome.isBindGateway) { |
| | | bFind = true; |
| | | UserConfig.Instance.CurrentRegion = mHome; |
| | | break; |
| | | } |
| | | } |
| | | |
| | | if (!bFind) { |
| | | var findRoom2 = mHomeLists.Find ((obj) => obj.IsOthreShare == false); |
| | | if (findRoom2 != null) { |
| | | UserConfig.Instance.CurrentRegion = findRoom2; |
| | | } else { |
| | | UserConfig.Instance.CurrentRegion = mHomeLists [0]; |
| | | } |
| | | } |
| | | |
| | | IO.FileUtils.DeleteAllFile (); |
| | | } |
| | | SaveUserConfig (mHomeLists); |
| | | } |
| | | return; |
| | | } |
| | | #endregion |
| | | |
| | | |
| | | UserHomePage.FrameLayoutMain.AddChidren (guidePageView); |
| | | var guide = new GuideAddResidence (); |
| | | guide.IsHideBack = true; |
| | |
| | | /// </summary> |
| | | static void InitHomePageView () |
| | | { |
| | | //SystemRemote.LinkRemote ("", "", "",true); |
| | | //SystemRemote.LinkRemote ("", "", "",true); |
| | | |
| | | if (null != UserPageView.Parent) { |
| | | if (guidePageView.Parent != null) { |
| | | guidePageView.RemoveAll (); |
| | | guidePageView.RemoveFromParent (); |
| | | } |
| | | |
| | | CleanPageView (FavoriteBodyView); |
| | | UserPageView.AddChidren (FavoritePageView); |
| | | FavoritePageView.AddChidren (FavoriteBodyView); |
| | |
| | | |
| | | #endregion |
| | | |
| | | |
| | | } |
| | | |
| | | public static void ShowSettingView () |
| | |
| | | UserDeviceToFH.readAllStatus (isRefresh); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | ///// <summary> |
| | | ///// 登录成功后,查询刷新一次当前住宅 网关列表 |
| | |
| | | // } |
| | | //} |
| | | |
| | | /// <summary> |
| | | /// 保存数据 并加载页面 |
| | | /// </summary> |
| | | /// <param name="revertRoomData"></param> |
| | | static void SaveUserConfig (List<RegionInfoRes> revertRoomData) |
| | | { |
| | | UserConfig.Instance.SaveUserConfig (); |
| | | MainPage.LoginUser.LastTime = DateTime.Now; |
| | | if (UserConfig.Instance.CheckHomeGatewaysNotEmpty ()) { |
| | | MainPage.LoginUser.SaveUserInfo (); |
| | | Scene.Refresh (); |
| | | A31MusicModel.Refresh (); |
| | | Application.RunOnMainThread (() => { |
| | | Init (false, true); |
| | | EquipmentPublicClass.CheckLinkRemote (UserConfig.Instance.internetStatus); |
| | | }); |
| | | } else { |
| | | Application.RunOnMainThread (() => { |
| | | Init (false, true); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | } |
| | | } |