From 9c6bc15e002c5315b8c6426f48e990fe567018f4 Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期一, 30 十一月 2020 09:33:23 +0800
Subject: [PATCH] 2020-11-30 1.更新
---
HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs | 111 +++++++++++++++++++++++++++++++++++++++----------------
1 files changed, 79 insertions(+), 32 deletions(-)
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
index 1d9232f..6ad72a9 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();
@@ -99,20 +126,37 @@
#endregion
#region 鐗堟湰鏇存柊
- var versionUpdateView = new ListCellView()
+ versionUpdateView = new ListCellView()
{
Y = complaintsView.Bottom,
};
bodyView.AddChidren(versionUpdateView);
versionUpdateView.BtnTilte.TextID = StringId.VersionUpdate;
Action versionUpdateAction = () =>
- {
- CheckIfNeedUpdateAsync();
- };
+ {
+ OpenUrl();
+ //TestDDDDD();
+ };
versionUpdateView.GoAction = versionUpdateAction;
#endregion
+ CheckIfNeedUpdateAsync();
+ }
+
+ /// <summary>
+ /// 鍒ゆ柇鏄惁闇�瑕佽皟鏁存柊鐗堟湰涓嬭浇鍦板潃
+ /// </summary>
+ void OpenUrl()
+ {
+ if (!string.IsNullOrEmpty(newAppVersion))
+ {
+ HDLUtils.OpenUrl(newAppVersionUrl);
+ }
+ else
+ {
+ Utlis.ShowTip(Language.StringByID(StringId.IsLatestVersion));
+ }
}
/// <summary>
@@ -120,25 +164,24 @@
/// 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);
}
});
@@ -169,6 +212,7 @@
//var updateContent = results[0]["releaseNotes"]?.ToString();
if (newVersion.CompareTo(MainPage.VersionString) > 0)
{
+ newAppVersionUrl = Constant.URL_APPSTORE;
return newVersion;
}
return "";
@@ -186,10 +230,10 @@
{
return "";
}
- var newVersion = versionResult.AndroidVersion;
+ var newVersion = versionResult.NewVersion;
if (newVersion.CompareTo(MainPage.VersionString) > 0)
{
- AndroidUrl = versionResult.AndroidUrl;
+ newAppVersionUrl = versionResult.NewVersionUrl;
return newVersion;
}
return "";
@@ -225,23 +269,7 @@
}
}
- /// <summary>
- /// 璺宠浆鍒癆PP Store
- /// </summary>
- void OpenUrl()
- {
- HDLUtils.OpenUrl("https://apps.apple.com/cn/app/on/id1532353432");
- }
#else
-
- string AndroidUrl = "";
- /// <summary>
- /// 璺宠浆鍒癆ndroid 涓嬭浇鍦板潃
- /// </summary>
- void OpenUrl()
- {
- HDLUtils.OpenUrl(AndroidUrl);
- }
/// <summary>
/// 鑾峰彇 Android-APP 鐗堟湰淇℃伅
@@ -273,8 +301,27 @@
#endif
+ int updateType = 0;
+ void TestDDDDD()
+ {
+ updateType = 1;
+
+ ForceUpdateInfo forceUpdateInfo = new ForceUpdateInfo()
+ {
+ 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