From e8147ceaf39253db2c9e6cfe023b505f71ec7ba5 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 24 八月 2023 17:48:30 +0800 Subject: [PATCH] 备份2 --- OnPro/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs | 275 ------------------------------------------------------ 1 files changed, 2 insertions(+), 273 deletions(-) diff --git a/OnPro/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/OnPro/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs index 863d94e..36f880d 100644 --- a/OnPro/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs +++ b/OnPro/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs @@ -17,10 +17,6 @@ /// /// </summary> FrameLayout bodyView; - /// <summary> - /// 鐗堟湰鏇存柊ListCellView - /// </summary> - ListCellView versionUpdateView; /// <summary> /// 鏂扮増鏈殑鐗堟湰鍙凤紝鏌ヨ鍒版柊鐗堟湰鎵嶈祴鍊� @@ -65,25 +61,13 @@ Y = Application.GetRealWidth(184), Height = Application.GetRealWidth(28), TextAlignment = TextAlignment.Center, - Text = "On Pro", + Text = "鑽f偊鏅鸿兘", TextColor = CSS_Color.FirstLevelTitleColor, TextSize = CSS_FontSize.EmphasisFontSize_Secondary, IsBold = true, }; bodyView.AddChidren(btnOnTitle); -#if DEBUG - //btnOnIcon.MouseUpEventHandler += (sender, e) => - //{ - // ESOnVideo.Current.Test(); - //}; - - //btnOnTitle.MouseUpEventHandler += (sender, e) => - //{ - // ESOnVideo.Current.Test(false); - //}; - -#endif Button btnOnVersion = new Button() { @@ -109,60 +93,11 @@ }; bodyView.AddChidren(lineView); - #region 鍔熻兘浠嬬粛 - //var functionView = new ListCellView() - //{ - // Y = lineView.Bottom, - //}; - //bodyView.AddChidren(functionView); - //functionView.BtnTilte.TextID = StringId.FunctionIntroduced; - //Action functionAction = () => - //{ - // var mPage = new FunctionIntroductionPage(); - // MainPage.BasePageView.AddChidren(mPage); - // mPage.LoadPage(); - // MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - //}; - //functionView.GoAction = functionAction; - #endregion - - #region 鎶曡瘔 - var complaintsView = new ListCellView() - { - Y = lineView.Bottom, - }; - bodyView.AddChidren(complaintsView); - complaintsView.BtnTilte.TextID = StringId.Complaints; - Action complaintsAction = () => - { - var mPage = new ComplaintsPage(); - MainPage.BasePageView.AddChidren(mPage); - mPage.LoadPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - complaintsView.GoAction = complaintsAction; - #endregion - - #region 鐗堟湰鏇存柊 - versionUpdateView = new ListCellView() - { - Y = complaintsView.Bottom, - }; - bodyView.AddChidren(versionUpdateView); - versionUpdateView.BtnTilte.TextID = StringId.VersionUpdate; - Action versionUpdateAction = () => - { - OpenUrl(); - //TestDDDDD(); - //HDLCommon.Current.CheckIfNeedForceUpdate(); - }; - versionUpdateView.GoAction = versionUpdateAction; - #endregion #region 杞欢鏈嶅姟鍗忚 var serviceAgreementView = new ListCellView() { - Y = versionUpdateView.Bottom, + Y = lineView.Bottom, }; bodyView.AddChidren(serviceAgreementView); serviceAgreementView.BtnTilte.TextID = StringId.UserAgreement; @@ -188,43 +123,7 @@ }; #endregion privacyPolicyView.GoAction = privacyPolicyAction; - CheckIfNeedUpdateAsync(); -#if __IOS__ - #region 鍥轰欢鍗囩骇 - var firUpdateView = new ListCellView() - { - Y = privacyPolicyView.Bottom, - }; - firUpdateView.BtnTilte.TextID = StringId.FirmwareUpdate; - bodyView.AddChidren(firUpdateView); - Action firmwareUpdateAction = () => - { - var mPage = new HDL_ON.UI.UI2.PersonalCenter.AboutOn.FirmwareUpdateView(); - MainPage.BasePageView.AddChidren(mPage); - mPage.ShowPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - firUpdateView.GoAction = firmwareUpdateAction; - #endregion - - - #region HomeKit鏀寔璇存槑 - var homeKitView = new ListCellView() - { - Y = firUpdateView.Bottom, - }; - bodyView.AddChidren(homeKitView); - homeKitView.BtnTilte.TextID = StringId.SupportHomeKitNotes; - Action homeKitSupportViewAction = () => { - var mPage = new HDL_ON.UI.UI2.PersonalCenter.AboutOn.SupportHomeKitNotesPage(); - MainPage.BasePageView.AddChidren(mPage); - mPage.ShowPage(); - MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; - }; - homeKitView.GoAction = homeKitSupportViewAction; - #endregion -#endif } @@ -244,175 +143,5 @@ } } - /// <summary> - /// 妫�娴嬫槸鍚﹂渶瑕佹洿鏂� - /// Android绛夋帴鍙e疄鐜� - /// </summary> - /// <returns></returns> - void CheckIfNeedUpdateAsync(bool isTip = false) - { - new System.Threading.Thread(() => - { - newAppVersion = CanUpdateAsync(); - Application.RunOnMainThread(() => - { - if (!string.IsNullOrEmpty(newAppVersion)) - { - //鍙戠幇鏂扮増鏈� - versionUpdateView.BtnSubtitle.TextColor = CSS_Color.MainColor; - versionUpdateView.BtnSubtitle.Text = Language.StringByID(StringId.DiscoverNewVersion) + "(" + newAppVersion + ")"; - } - else - { - //宸茬粡鏄渶鏂扮増鏈� - versionUpdateView.BtnSubtitle.TextColor = CSS_Color.PromptingColor1; - versionUpdateView.BtnSubtitle.Text = Language.StringByID(StringId.IsLatestVersion); - } - }); - - }) - { IsBackground = true }.Start(); - } - - /// <summary> - /// 妫�鏌ョ増鏈� - /// </summary> - /// <returns></returns> - string CanUpdateAsync() - { -#if __IOS__ - try - { - var versionResult = RequestHttpsiOSAppVersionAsync(); - if (versionResult == null || versionResult.Results == null) - { - return ""; - } - var results = Newtonsoft.Json.Linq.JArray.Parse(versionResult.Results.ToString()); - if (results[0] == null) - { - return ""; - } - var newVersion = results[0]["version"]?.ToString(); - //var updateContent = results[0]["releaseNotes"]?.ToString(); - if (newVersion.CompareTo(MainPage.VersionString) > 0) - { - newAppVersionUrl = Constant.URL_APPSTORE; - return newVersion; - } - return ""; - } - catch - { - return ""; - } - -#else - try - { - var versionResult = CheckAppVersion(); - if (versionResult == null) - { - return ""; - } - var newVersion = versionResult.version; - if (newVersion.CompareTo(MainPage.VersionString) > 0) - { - newAppVersionUrl = versionResult.packageUrl; - return newVersion; - } - return ""; - } - catch (Exception ex) - { - return ""; - } -#endif - } - - -#if __IOS__ - /// <summary> - /// 鑾峰彇iOS-APP鐗堟湰淇℃伅 - /// </summary> - /// <returns>The https app version async.</returns> - ResultPack RequestHttpsiOSAppVersionAsync() - { - try - { - var webClient = new WebClient { }; - var result = webClient.DownloadData("https://itunes.apple.com/cn/lookup?id=1532353432"); - if (result == null) - { - return null; - } - return Newtonsoft.Json.JsonConvert.DeserializeObject<ResultPack>(Encoding.UTF8.GetString(result)); - } - catch - { - return null; - } - } - - //#else - - - - -#endif - - /// <summary> - /// 妫�娴嬫柊鐗堟湰 - /// </summary> - /// <returns>The https app version async.</returns> - private AppVersionResNew CheckAppVersion() - { - try - { - var result = new HttpServerRequest().CheckAppVersion(); - if (result.Code == StateCode.SUCCESS) - { - if (result.Data == null) - { - return null; - } - - var responeData = Newtonsoft.Json.JsonConvert.DeserializeObject<AppVersionResNew>(result.Data.ToString()); - return responeData; - } - return null; - } - catch (Exception ex) - { - return null; - } - } - - int updateType = 0; - void TestDDDDD() - { - updateType = 1; - - UpdateDialogInfo forceUpdateInfo = new UpdateDialogInfo() - { - UpdateType = updateType, - NewVersionUrl = Constant.URL_APPSTORE, - NewVersion = "1.0.0925", - ReasonStr = "1銆侀椤靛叏鏂版敼鐗堣璁★紝UI鏇存竻鏅� \n2銆佷慨澶岯UG \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳� \n3銆佹柊澧為煶绠卞姛鑳�" - }; - - HDLCommon.Current.ShowForceUpdateDialog(forceUpdateInfo); - } - - } - - /// <summary> - /// 鑻规灉鍟嗗簵鏌ヨ鍝嶅簲鍖呮牸寮� - /// </summary> - [System.Serializable] - public class ResultPack - { - public int ResultCount { get; set; } - public object Results { get; set; } } } -- Gitblit v1.8.0