From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001
From: wjc <1243177876@qq.com>
Date: 星期四, 01 十二月 2022 09:56:25 +0800
Subject: [PATCH] 2022年12月01日09:56:23

---
 ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs |   47 +++++++++++++++++++++++++++++------------------
 1 files changed, 29 insertions(+), 18 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
index a09b052..6d04527 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
@@ -42,12 +42,13 @@
         /// <summary>
         /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓)
         /// </summary>
-        public void ShowForm()
+        /// <param name="autoUpdate">鎵撳紑鐣岄潰涔嬪悗,濡傛灉鏈夋柊鐗堟湰,鏄惁鐩存帴鍗囩骇</param>
+        public void ShowForm(bool autoUpdate)
         {
             //璁剧疆鏍囬淇℃伅
             base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAboutMe));
             //鍒濆鍖栦腑閮ㄦ帶浠�
-            this.InitMiddleFrame();
+            this.InitMiddleFrame(autoUpdate);
         }
         /// <summary>
         /// Closes the form.
@@ -65,7 +66,8 @@
         /// <summary>
         /// 鍒濆鍖栦腑閮ㄦ帶浠�
         /// </summary>
-        private void InitMiddleFrame()
+        /// <param name="autoUpdate">鎵撳紑鐣岄潰涔嬪悗,濡傛灉鏈夋柊鐗堟湰,鏄惁鐩存帴鍗囩骇</param>
+        private void InitMiddleFrame(bool autoUpdate)
         {
             //澶撮儴鐧借壊鑳屾櫙
             var frameLogo = new FrameLayoutBase();
@@ -106,11 +108,17 @@
             listView.Height = Application.GetRealHeight(500);
             bodyFrameLayout.AddChidren(listView);
             //鏈嶅姟鍗忚
-            //var rowService = new FrameRowControl(listView.rowSpace / 2);
-            //listView.AddChidren(rowService);
-            //rowService.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SLA), 400);
-            //rowService.AddRightArrow();
-            //rowService.AddBottomLine();
+            var rowService = new FrameRowControl(listView.rowSpace / 2);
+            listView.AddChidren(rowService);
+            rowService.AddLeftCaption(Language.StringByID(R.MyInternationalizationString.SLA), 400);
+            rowService.AddRightArrow();
+            rowService.AddBottomLine();
+            rowService.ButtonClickEvent += (sender, e) =>
+            {
+                var form = new SLAForm();
+                form.AddForm();
+            };
+
             //鐗堟湰鏇存柊
             this.rowUpdate = new FrameRowControl(listView.rowSpace / 2);
             listView.AddChidren(rowUpdate);
@@ -151,6 +159,11 @@
                         //鏇存柊鏈�鏂扮増
                         btnRightView.TextID = R.MyInternationalizationString.Update;
                         rowUpdate.CanClick = true;
+                        if (autoUpdate == true)
+                        {
+                            //鐩存帴鍗囩骇
+                            rowUpdate.ButtonClickEvent?.Invoke(null, null);
+                        }
                     }
                     else
                     {
@@ -219,7 +232,7 @@
                 {
                     return false;
                 }
-                if (int.Parse(versionResult.FirmwareVersion.Replace(".", "")) > int.Parse(CommonPage.CodeIDString.Replace(".", "")))
+                if (versionResult.FirmwareVersion.CompareTo(CommonPage.CodeIDString) > 0)
                 {
                     distributedMark = versionResult.DistributedMark;
                     return true;
@@ -295,7 +308,7 @@
             try
             {
                 var webClient = new WebClient { };
-                var result = await webClient.DownloadDataTaskAsync("https://itunes.apple.com/lookup?id=1461693569");
+                var result = await webClient.DownloadDataTaskAsync("https://itunes.apple.com/lookup?id=1528702586");
                 if (result == null)
                 {
                     return null;
@@ -312,7 +325,7 @@
         /// </summary>
         public void OpenUrl()
         {
-            Uri url = new Uri("https://itunes.apple.com/cn/app/hdl-home/id1461693569?mt=8");
+            Uri url = new Uri("https://itunes.apple.com/cn/app/hdl-home/id1528702586?mt=8");
             UIKit.UIApplication.SharedApplication.OpenUrl(url);
         }
 #elif Android
@@ -376,19 +389,17 @@
                     {
                         return null;
                     }
-                    int MaxIndex = 0;
-                    int NewVersion = 0;
+
+                    Common.ResponseEntity.ApkInfoOBJ apkInfoOBJ = null;
                     for (int i = 0; i < responeData.pageData.Count; i++)
                     {
                         var apkInfo = responeData.pageData[i];
-                        var version = int.Parse(apkInfo.FirmwareVersion.Replace(".", ""));
-                        if (version > NewVersion)
+                        if (apkInfoOBJ == null || apkInfo.FirmwareVersion.CompareTo(apkInfoOBJ.FirmwareVersion) > 0)
                         {
-                            NewVersion = version;
-                            MaxIndex = i;
+                            apkInfoOBJ = apkInfo;
                         }
                     }
-                    return responeData.pageData[MaxIndex];
+                    return apkInfoOBJ;
                 }
                 return null;
             }

--
Gitblit v1.8.0