From 6d73bf6e816570291865674bef8bce8972e4de3f Mon Sep 17 00:00:00 2001 From: xm <1271024303@qq.com> Date: 星期三, 01 十二月 2021 16:32:57 +0800 Subject: [PATCH] 2021-12-01-01 --- HDL_ON/UI/UI2/UserPage.cs | 136 +++++++++++++++++++++++++++----------------- 1 files changed, 83 insertions(+), 53 deletions(-) diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs index 4cc9c29..e8c5add 100644 --- a/HDL_ON/UI/UI2/UserPage.cs +++ b/HDL_ON/UI/UI2/UserPage.cs @@ -2,12 +2,12 @@ using HDL_ON.Entity; using Shared; using HDL_ON.UI.CSS; +using HDL_ON.DAL.Server; namespace HDL_ON.UI { public partial class UserPage : FrameLayout { - #region 鎺т欢鍒楄〃 /// <summary> /// 褰撳墠鍖哄煙 @@ -17,6 +17,7 @@ /// 鍐呭鍖哄煙 /// </summary> FrameLayout ContextView; + //VerticalRefreshLayout ContextView; /// <summary> /// 瀵艰埅鏍忓尯鍩� /// </summary> @@ -85,14 +86,6 @@ #endregion #endregion - /// <summary> - /// 褰撳墠鍔ㄧ敾鏁堟灉 - /// 0:鏀惰棌 - /// 1:鍒嗙被 - /// 2:鏅鸿兘 - /// 3:涓汉 - /// </summary> - int CurAnimationEffect = 0; public void LoadPage() { @@ -128,8 +121,34 @@ ContextView.AddChidren(homePage); homePage.LoadPage(); - //鍒锋柊鍔熻兘鐘舵�� - DB_ResidenceData.residenceData.RefreshResidenceFunctionStatus(); + if (!MainPage.NoLoginMode) + { + //娉ㄥ唽鎺ㄩ�両D + RegisteredPush(); + } + //2020-12-07 澧炲姞鐗堟湰妫�娴嬫洿鏂版柟娉� + HDLCommon.Current.CheckIfNeedForceUpdate(); + +#if __Android__ + //寮�鍚畾浣嶆湇鍔� + Shared.Application.StartGPSLocationService(); + + if (DB_ResidenceData.Instance.NeedTip) { + DB_ResidenceData.Instance.LastTipTime = DateTime.Now; + if (CN.Jpush.Android.Api.JPushInterface.IsNotificationEnabled(Shared.Application.Activity) != 1) + { + Action action = () => + { + CN.Jpush.Android.Api.JPushInterface.GoToAppNotificationSettings(Shared.Application.Activity); + }; + Shared.Application.RunOnMainThread(() => + { + new HDL_ON.UI.ConfirmDialog().ShowDialog(StringId.Tip, StringId.Android_MessagePushTip, action); + }); + } + } +#endif + } catch (Exception ex) { @@ -170,7 +189,7 @@ }; navigationView.AddChidren(NavigationSubView); - #region 鏀惰棌鍖哄煙 +#region 鏀惰棌鍖哄煙 collectionView = new FrameLayout() { Width = Application.GetRealWidth(94), }; @@ -198,9 +217,9 @@ IsSelected = true, }; collectionView.AddChidren(btnCollectionText); - #endregion +#endregion - #region 鍒嗙被鍖哄煙 +#region 鍒嗙被鍖哄煙 classificationView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -229,9 +248,9 @@ TextAlignment = TextAlignment.Center, }; classificationView.AddChidren(btnClassificationText); - #endregion +#endregion - #region 鏅鸿兘鍖哄煙 +#region 鏅鸿兘鍖哄煙 intellectualizationView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -260,9 +279,9 @@ TextAlignment = TextAlignment.Center, }; intellectualizationView.AddChidren(btnIntellectualizationText); - #endregion +#endregion - #region 涓汉涓績 +#region 涓汉涓績 personalCenterView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -293,7 +312,7 @@ TextAlignment = TextAlignment.Center, }; personalCenterView.AddChidren(btnPersonalCenterText); - #endregion +#endregion var homePage = new HomePage(); ContextView.AddChidren(homePage); @@ -303,9 +322,9 @@ /// <summary> /// 鍒囨崲鍒版敹钘忕晫闈� /// </summary> - void ChooseCollection() + public void ChooseCollection() { - if (CurAnimationEffect == 0) + if (MainPage.CurPageIndex == 0) { return; } @@ -316,7 +335,7 @@ btnClassificationText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; - #region 绉诲姩鍔ㄧ敾 +#region 绉诲姩鍔ㄧ敾 //绉诲姩璺濈 var distance = navigationSelectionView.X - collectionView.X + Application.GetRealWidth(94*3); int total = 10; @@ -333,10 +352,10 @@ distance /= total; new System.Threading.Thread(() => { int index = 0; - CurAnimationEffect = 0; + MainPage.CurPageIndex = 0; while (index < total+1) { - if (CurAnimationEffect != 0) + if (MainPage.CurPageIndex != 0) { break; } @@ -358,6 +377,7 @@ btnClassificationText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; } if (index == (total/2)) { @@ -374,8 +394,8 @@ { btnNavigationSelectionIcon.SetRotation(0f); }); - }) { IsBackground = true }.Start(); - #endregion + }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Highest}.Start(); +#endregion ContextView.RemoveAll(); var homePage = new HomePage(); ContextView.AddChidren(homePage); @@ -386,7 +406,7 @@ /// </summary> void ChooseClassification() { - if (CurAnimationEffect == 1) + if (MainPage.CurPageIndex == 1) { return; } @@ -397,7 +417,7 @@ btnClassificationText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; - #region 绉诲姩鍔ㄧ敾 +#region 绉诲姩鍔ㄧ敾 var distance = navigationSelectionView.X - classificationView.X + Application.GetRealWidth(94 * 3); int total = 10; int sleepTime = 300; @@ -408,15 +428,15 @@ distance /= total; new System.Threading.Thread(() => { - if (CurAnimationEffect == 1) + if (MainPage.CurPageIndex == 1) { return; } - CurAnimationEffect = 1; + MainPage.CurPageIndex = 1; int index = 0; while (index < total+1) { - if (CurAnimationEffect != 1) + if (MainPage.CurPageIndex != 1) { break; } @@ -438,6 +458,7 @@ btnCollectionText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png"; } if (index == (total / 2 )) { @@ -462,8 +483,8 @@ btnNavigationSelectionIcon.SetRotation(0f); }); }) - { IsBackground = true }.Start(); - #endregion + { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); +#endregion ContextView.RemoveAll(); var classificaitionView = new ClassificationPage(); ContextView.AddChidren(classificaitionView); @@ -476,7 +497,7 @@ /// </summary> void ChooseIntellectualization() { - if (CurAnimationEffect == 2) + if (MainPage.CurPageIndex == 2) { return; } @@ -487,7 +508,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnPersonalCenterIcon.IsSelected = false; - #region 绉诲姩鍔ㄧ敾 +#region 绉诲姩鍔ㄧ敾 var distance = navigationSelectionView.X - intellectualizationView.X + Application.GetRealWidth(94 * 3); int total = 10; int sleepTime = 300; @@ -497,15 +518,15 @@ } distance /= total; new System.Threading.Thread(() => { - if (CurAnimationEffect == 2) + if (MainPage.CurPageIndex == 2) { return; } - CurAnimationEffect = 2; + MainPage.CurPageIndex = 2; int index = 0; while (index < total+1) { - if(CurAnimationEffect!=2) + if(MainPage.CurPageIndex!=2) { break; } @@ -527,6 +548,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnPersonalCenterIcon.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png"; } if (index == (total / 2 )) { @@ -551,23 +573,22 @@ btnNavigationSelectionIcon.SetRotation(0f); }); }) - { IsBackground = true }.Start(); - #endregion + { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); +#endregion ContextView.RemoveAll(); + var intelligenceView = new IntelligencePage(); + ContextView.AddChidren(intelligenceView); + intelligenceView.LoadPage(); + + } /// <summary> /// 鍒囨崲鍒颁釜浜轰腑蹇冪晫闈� /// </summary> - void ChoosePersonalCenter() + public void ChoosePersonalCenter() { -#if DEBUG - if(MainPage.LocalMode) - { - return; - } -#endif - if (CurAnimationEffect == 3) + if (MainPage.CurPageIndex == 3) { return; } @@ -578,7 +599,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnIntellectualizationIcon.IsSelected = false; - #region 绉诲姩鍔ㄧ敾 +#region 绉诲姩鍔ㄧ敾 var distance = navigationSelectionView.X - personalCenterView.X + Application.GetRealWidth(94 * 3); int total = 10; int sleepTime = 300; @@ -593,11 +614,11 @@ } distance /= total; new System.Threading.Thread(() => { - CurAnimationEffect = 3; + MainPage.CurPageIndex = 3; int index = 0; while (index < total+1) { - if (CurAnimationEffect != 3) + if (MainPage.CurPageIndex != 3) { break; } @@ -619,6 +640,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnIntellectualizationIcon.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png"; } if (index == (total / 2 )) { @@ -635,13 +657,21 @@ btnNavigationSelectionIcon.SetRotation(0f); }); }) - { IsBackground = true }.Start(); - #endregion + { IsBackground = true, Priority = System.Threading.ThreadPriority.Highest }.Start(); +#endregion ContextView.RemoveAll(); var personalCenterPage = new UI.PersonalCenterPage(); ContextView.AddChidren(personalCenterPage); personalCenterPage.LoadView(); } + + /// <summary> + /// 娉ㄥ唽鎺ㄩ�� + /// </summary> + void RegisteredPush() + { + new HttpServerRequest().RegisteredPush(); + } } } -- Gitblit v1.8.0