From eda3fb873e59544ff36301b51e05aef64f87b0f9 Mon Sep 17 00:00:00 2001 From: wei <kaede@kaededeMacBook-Air.local> Date: 星期五, 27 八月 2021 13:21:21 +0800 Subject: [PATCH] Merge branch 'newBranch1' of http://172.16.1.23:6688/r/~wxr/HDL_APP_Project into newBranch1 --- HDL_ON/UI/UI2/UserPage.cs | 156 +++++++++++++++++++++++++++++++-------------------- 1 files changed, 95 insertions(+), 61 deletions(-) diff --git a/HDL_ON/UI/UI2/UserPage.cs b/HDL_ON/UI/UI2/UserPage.cs index 2366b11..0cca652 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() { @@ -102,7 +95,7 @@ bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; ContextView = new FrameLayout() { - Height = Application.GetRealHeight(618 + 20 +10), + Height = Application.GetRealHeight(618 + 17),//瀵艰埅鏍忓簳閮ㄧ晫闄� BackgroundColor = CSS_Color.BackgroundColor, }; bodyView.AddChidren(ContextView); @@ -128,8 +121,19 @@ 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(); +#endif + } catch (Exception ex) { @@ -147,7 +151,7 @@ X = Application.GetRealWidth(0 - 94 * 3), Y = Application.GetMinRealAverage(4), Width = Application.GetRealWidth(94 * 7), - Height = Application.GetMinRealAverage(38), + Height = Application.GetRealWidth(38), BackgroundImagePath = "Navigation/UserPageNavbg.png", }; navigationView.AddChidren(navigationSelectionView); @@ -155,10 +159,10 @@ btnNavigationSelectionIcon = new Button() { Gravity = Gravity.CenterHorizontal, - Y = Application.GetMinRealAverage(6), - Width = Application.GetMinRealAverage(22), - Height = Application.GetMinRealAverage(22), - UnSelectedImagePath = "Navigation/CollectionIconOn.png", + Y = Application.GetRealWidth(6), + Width = Application.GetRealWidth(22), + Height = Application.GetRealWidth(22), + UnSelectedImagePath = "Navigation/HomePageIconOn.png", }; navigationSelectionView.AddChidren(btnNavigationSelectionIcon); @@ -170,7 +174,7 @@ }; navigationView.AddChidren(NavigationSubView); - #region 鏀惰棌鍖哄煙 +#region 鏀惰棌鍖哄煙 collectionView = new FrameLayout() { Width = Application.GetRealWidth(94), }; @@ -180,7 +184,7 @@ Y = Application.GetRealHeight(5), Width = Application.GetMinRealAverage(22), Height = Application.GetMinRealAverage(22), - UnSelectedImagePath = "Navigation/CollectionIcon.png", + UnSelectedImagePath = "Navigation/HomePageIcon.png", SelectedImagePath = "Public/transparent.png", IsSelected = true, }; @@ -198,9 +202,9 @@ IsSelected = true, }; collectionView.AddChidren(btnCollectionText); - #endregion +#endregion - #region 鍒嗙被鍖哄煙 +#region 鍒嗙被鍖哄煙 classificationView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -229,9 +233,9 @@ TextAlignment = TextAlignment.Center, }; classificationView.AddChidren(btnClassificationText); - #endregion +#endregion - #region 鏅鸿兘鍖哄煙 +#region 鏅鸿兘鍖哄煙 intellectualizationView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -260,9 +264,9 @@ TextAlignment = TextAlignment.Center, }; intellectualizationView.AddChidren(btnIntellectualizationText); - #endregion +#endregion - #region 涓汉涓績 +#region 涓汉涓績 personalCenterView = new FrameLayout() { Width = Application.GetRealWidth(94), @@ -293,7 +297,7 @@ TextAlignment = TextAlignment.Center, }; personalCenterView.AddChidren(btnPersonalCenterText); - #endregion +#endregion var homePage = new HomePage(); ContextView.AddChidren(homePage); @@ -303,9 +307,9 @@ /// <summary> /// 鍒囨崲鍒版敹钘忕晫闈� /// </summary> - void ChooseCollection() + public void ChooseCollection() { - if (CurAnimationEffect == 0) + if (MainPage.CurPageIndex == 0) { return; } @@ -316,7 +320,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 +337,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,10 +362,11 @@ btnClassificationText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; } if (index == (total/2)) { - btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/CollectionIconOn.png"; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/HomePageIconOn.png"; } //鏃嬭浆 btnNavigationSelectionIcon.SetRotation(-36f * index); @@ -369,8 +374,13 @@ System.Threading.Thread.Sleep(sleepTime / total); index++; } - }) { IsBackground = true }.Start(); - #endregion + + Application.RunOnMainThread(() => + { + btnNavigationSelectionIcon.SetRotation(0f); + }); + }) { IsBackground = true ,Priority = System.Threading.ThreadPriority.Highest}.Start(); +#endregion ContextView.RemoveAll(); var homePage = new HomePage(); ContextView.AddChidren(homePage); @@ -381,7 +391,7 @@ /// </summary> void ChooseClassification() { - if (CurAnimationEffect == 1) + if (MainPage.CurPageIndex == 1) { return; } @@ -392,7 +402,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; @@ -403,15 +413,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; } @@ -433,6 +443,7 @@ btnCollectionText.IsSelected = false; btnIntellectualizationText.IsSelected = false; btnPersonalCenterText.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/ClassificationIconOn.png"; } if (index == (total / 2 )) { @@ -451,9 +462,14 @@ System.Threading.Thread.Sleep(sleepTime / total); index++; } + + Application.RunOnMainThread(() => + { + 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); @@ -466,7 +482,7 @@ /// </summary> void ChooseIntellectualization() { - if (CurAnimationEffect == 2) + if (MainPage.CurPageIndex == 2) { return; } @@ -477,7 +493,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; @@ -487,15 +503,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; } @@ -517,6 +533,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnPersonalCenterIcon.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/IntellectualizationIconOn.png"; } if (index == (total / 2 )) { @@ -535,24 +552,28 @@ System.Threading.Thread.Sleep(sleepTime / total); index++; } + + Application.RunOnMainThread(() => + { + 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; } @@ -563,7 +584,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; @@ -578,11 +599,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; } @@ -604,6 +625,7 @@ btnCollectionIcon.IsSelected = false; btnClassificationIcon.IsSelected = false; btnIntellectualizationIcon.IsSelected = false; + btnNavigationSelectionIcon.UnSelectedImagePath = "Navigation/PersonalCenterIconOn.png"; } if (index == (total / 2 )) { @@ -615,14 +637,26 @@ System.Threading.Thread.Sleep(sleepTime / total); index++; } + Application.RunOnMainThread(() => + { + 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