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/4-PersonalCenter/AboutOn/AboutOnPage.cs | 152 ++++++++++++++++++++++++++++++++++++-------------- 1 files changed, 108 insertions(+), 44 deletions(-) diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs index 5ec5870..fa1831f 100644 --- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs +++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs @@ -8,15 +8,42 @@ namespace HDL_ON.UI { + /// <summary> + /// 鍏充簬椤甸潰 + /// </summary> public class AboutOnPage : FrameLayout { + /// <summary> + /// + /// </summary> FrameLayout bodyView; + /// <summary> + /// 鐗堟湰鏇存柊ListCellView + /// </summary> + ListCellView versionUpdateView; + /// <summary> + /// 鏂扮増鏈殑鐗堟湰鍙凤紝鏌ヨ鍒版柊鐗堟湰鎵嶈祴鍊� + /// </summary> + string newAppVersion; + /// <summary> + /// 鏂扮増鏈殑涓嬭浇鍦板潃 + /// iOS 榛樿涓鸿嫻鏋滃晢搴楀湴鍧� + /// Android 浜戠杩斿洖鍦板潃 + /// </summary> + string newAppVersionUrl = ""; + + /// <summary> + /// + /// </summary> public AboutOnPage() { bodyView = this; } + /// <summary> + /// + /// </summary> public void LoadPage() { new TopViewDiv(bodyView, Language.StringByID(StringId.About)).LoadTopView(); @@ -44,6 +71,19 @@ }; 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() { Y = btnOnTitle.Bottom, @@ -70,7 +110,7 @@ Y = lineView.Bottom, }; bodyView.AddChidren(functionView); - functionView.btnTilte.TextID = StringId.FunctionIntroduced; + functionView.BtnTilte.TextID = StringId.FunctionIntroduced; Action functionAction = () => { var mPage = new FunctionIntroductionPage(); @@ -78,7 +118,7 @@ mPage.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - functionView.goAction = functionAction; + functionView.GoAction = functionAction; #endregion #region 鎶曡瘔 @@ -87,7 +127,7 @@ Y = functionView.Bottom, }; bodyView.AddChidren(complaintsView); - complaintsView.btnTilte.TextID = StringId.Complaints; + complaintsView.BtnTilte.TextID = StringId.Complaints; Action complaintsAction = () => { var mPage = new ComplaintsPage(); @@ -95,49 +135,67 @@ mPage.LoadPage(); MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1; }; - complaintsView.goAction = complaintsAction; + complaintsView.GoAction = complaintsAction; #endregion #region 鐗堟湰鏇存柊 - var versionUpdateView = new ListCellView() + versionUpdateView = new ListCellView() { Y = complaintsView.Bottom, }; bodyView.AddChidren(versionUpdateView); - versionUpdateView.btnTilte.TextID = StringId.VersionUpdate; + versionUpdateView.BtnTilte.TextID = StringId.VersionUpdate; Action versionUpdateAction = () => - { - CheckIfNeedUpdateAsync(); - }; - versionUpdateView.goAction = versionUpdateAction; + { + OpenUrl(); + //TestDDDDD(); + //HDLCommon.Current.CheckIfNeedForceUpdate(); + }; + versionUpdateView.GoAction = versionUpdateAction; #endregion + CheckIfNeedUpdateAsync(); + } + + /// <summary> + /// 鍒ゆ柇鏄惁闇�瑕佽皟鏁存柊鐗堟湰涓嬭浇鍦板潃 + /// </summary> + void OpenUrl() + { + if (!string.IsNullOrEmpty(newAppVersion)) + { + HDLUtils.OpenUrl(newAppVersionUrl); + } + else + { + Utlis.ShowTip(Language.StringByID(StringId.IsLatestVersion)); + } } /// <summary> /// 妫�娴嬫槸鍚﹂渶瑕佹洿鏂� + /// Android绛夋帴鍙e疄鐜� /// </summary> /// <returns></returns> - void CheckIfNeedUpdateAsync() + void CheckIfNeedUpdateAsync(bool isTip = false) { new System.Threading.Thread(() => { - var newVersion = CanUpdateAsync(); + newAppVersion = CanUpdateAsync(); Application.RunOnMainThread(() => { - if (!string.IsNullOrEmpty(newVersion)) + if (!string.IsNullOrEmpty(newAppVersion)) { - Action okAction = () => - { - OpenUrl(); - }; - var mesStr = Language.StringByID(StringId.DiscoverNewVersion) + "(" + newVersion + ")"; - new ConfirmDialog().ShowDialog(Language.StringByID(StringId.Tip), mesStr, okAction, null, StringId.Cancel, StringId.Update); + //鍙戠幇鏂扮増鏈� + versionUpdateView.BtnSubtitle.TextColor = CSS_Color.MainColor; + versionUpdateView.BtnSubtitle.Text = Language.StringByID(StringId.DiscoverNewVersion) + "(" + newAppVersion + ")"; } else { - Utlis.ShowTip(Language.StringByID(StringId.IsLatestVersion)); + //宸茬粡鏄渶鏂扮増鏈� + versionUpdateView.BtnSubtitle.TextColor = CSS_Color.PromptingColor1; + versionUpdateView.BtnSubtitle.Text = Language.StringByID(StringId.IsLatestVersion); } }); @@ -168,6 +226,7 @@ //var updateContent = results[0]["releaseNotes"]?.ToString(); if (newVersion.CompareTo(MainPage.VersionString) > 0) { + newAppVersionUrl = Constant.URL_APPSTORE; return newVersion; } return ""; @@ -180,15 +239,15 @@ #else try { - var versionResult = GetAndroidAppVersion(); + var versionResult = CheckAppVersion(); if (versionResult == null) { return ""; } - var newVersion = versionResult.AndroidVersion; + var newVersion = versionResult.version; if (newVersion.CompareTo(MainPage.VersionString) > 0) { - AndroidUrl = versionResult.AndroidUrl; + newAppVersionUrl = versionResult.androidUrl; return newVersion; } return ""; @@ -224,33 +283,22 @@ } } - /// <summary> - /// 璺宠浆鍒癆PP Store - /// </summary> - void OpenUrl() - { - HDLUtils.OpenUrl("https://apps.apple.com/cn/app/on/id1532353432"); - } -#else + //#else - string AndroidUrl = ""; - /// <summary> - /// 璺宠浆鍒癆ndroid 涓嬭浇鍦板潃 - /// </summary> - void OpenUrl() - { - HDLUtils.OpenUrl(AndroidUrl); - } + + + +#endif /// <summary> - /// 鑾峰彇 Android-APP 鐗堟湰淇℃伅 + /// 妫�娴嬫柊鐗堟湰 /// </summary> /// <returns>The https app version async.</returns> - private APPVersion GetAndroidAppVersion() + private AppVersionRes CheckAppVersion() { try { - var result = new HttpServerRequest().GetAppVersion(); + var result = new HttpServerRequest().CheckAppVersion(); if (result.Code == StateCode.SUCCESS) { if (result.Data == null) @@ -258,7 +306,7 @@ return null; } - var responeData = Newtonsoft.Json.JsonConvert.DeserializeObject<APPVersion>(result.Data.ToString()); + var responeData = Newtonsoft.Json.JsonConvert.DeserializeObject<AppVersionRes>(result.Data.ToString()); return responeData; } return null; @@ -269,11 +317,27 @@ } } + int updateType = 0; + void TestDDDDD() + { + updateType = 1; -#endif + 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 { -- Gitblit v1.8.0