From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径

---
 ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs |   81 ++++++++++++++++++++++------------------
 1 files changed, 44 insertions(+), 37 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
old mode 100755
new mode 100644
index 6d9e61b..e10d95a
--- 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,32 +66,28 @@
         /// <summary>
         /// 鍒濆鍖栦腑閮ㄦ帶浠�
         /// </summary>
-        private void InitMiddleFrame()
+        /// <param name="autoUpdate">鎵撳紑鐣岄潰涔嬪悗,濡傛灉鏈夋柊鐗堟湰,鏄惁鐩存帴鍗囩骇</param>
+        private void InitMiddleFrame(bool autoUpdate)
         {
             //澶撮儴鐧借壊鑳屾櫙
             var frameLogo = new FrameLayoutBase();
             frameLogo.Height = Application.GetRealHeight(484);
             frameLogo.BackgroundColor = ZigbeeColor.Current.GXCBackgroundColor;
             bodyFrameLayout.AddChidren(frameLogo);
-            //鍥炬爣鐨勫鍣�
-            var frameLogoBackground = new FrameLayoutBase();
-            frameLogoBackground.Y = Application.GetRealHeight(104);
-            frameLogoBackground.Width = this.GetPictrueRealSize(167);
-            frameLogoBackground.Height = this.GetPictrueRealSize(167);
-            frameLogoBackground.Gravity = Gravity.CenterHorizontal;
-            frameLogoBackground.BackgroundColor = ZigbeeColor.Current.GXCButtonBlackSelectedColor;
-            frameLogoBackground.Radius = (uint)Application.GetRealHeight(37);
-            frameLogo.AddChidren(frameLogoBackground);
             //鍥炬爣
-            var btnLogo = new IconViewControl(144);
-            btnLogo.UnSelectedImagePath = "Account/Logo_White.png";
-            btnLogo.Gravity = Gravity.Center;
-            frameLogoBackground.AddChidren(btnLogo);
-            //HDL Home
+            var btnLogo = new ImageView();
+            btnLogo.Y = Application.GetRealHeight(104);
+            btnLogo.Width = this.GetPictrueRealSize(167);
+            btnLogo.Height = this.GetPictrueRealSize(167);
+            btnLogo.Radius = (uint)Application.GetRealHeight(37);
+            btnLogo.ImagePath = "Account/Logo_Evoyo.png";
+            btnLogo.Gravity = Gravity.CenterHorizontal;
+            frameLogo.AddChidren(btnLogo);
+            //Evoyo Home
             var btnName = new NormalViewControl(700, 60, true);
             btnName.Y = Application.GetRealHeight(294);
             btnName.Gravity = Gravity.CenterHorizontal;
-            btnName.Text = "HDL Home";
+            btnName.Text = "Evoyo Home";
             btnName.TextSize = 15;
             btnName.TextColor = ZigbeeColor.Current.GXCTextDeepBlackColor;
             btnName.TextAlignment = TextAlignment.Center;
@@ -111,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);
@@ -156,6 +159,11 @@
                         //鏇存柊鏈�鏂扮増
                         btnRightView.TextID = R.MyInternationalizationString.Update;
                         rowUpdate.CanClick = true;
+                        if (autoUpdate == true)
+                        {
+                            //鐩存帴鍗囩骇
+                            rowUpdate.ButtonClickEvent?.Invoke(null, null);
+                        }
                     }
                     else
                     {
@@ -202,9 +210,10 @@
                     if (results[0] == null)
                     {
                         return false;
-                    }
-                    var newVersion = results[0]["version"]?.ToString();
-                    var updateContent = results[0]["releaseNotes"]?.ToString();
+                    }
+                var newVersion = results[0]["version"]?.ToString();
+
+                var updateContent = results[0]["releaseNotes"]?.ToString();
                     if (newVersion.CompareTo(CommonPage.CodeIDString) > 0)
                     {
                         return true;
@@ -224,7 +233,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;
@@ -300,7 +309,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;
@@ -317,7 +326,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
@@ -338,7 +347,7 @@
             if (Android.OS.BuildVersionCodes.M < Android.OS.Build.VERSION.SdkInt)
             {
                 //鍙傛暟1 涓婁笅鏂�, 鍙傛暟2 Provider涓绘満鍦板潃 鍜岄厤缃枃浠朵腑淇濇寔涓�鑷�   鍙傛暟3  鍏变韩鐨勬枃浠�
-                var apkUri = Android.Support.V4.Content.FileProvider.GetUriForFile(context, "com.hdl.home.fileProvider", file);
+                var apkUri = Android.Support.V4.Content.FileProvider.GetUriForFile(context, "com.evoyo.home.fileProvider", file);
                 //娣诲姞杩欎竴鍙ヨ〃绀哄鐩爣搴旂敤涓存椂鎺堟潈璇ri鎵�浠h〃鐨勬枃浠�
                 intent.AddFlags(Android.Content.ActivityFlags.GrantReadUriPermission);
                 intent.SetDataAndType(apkUri, "application/vnd.android.package-archive");
@@ -381,19 +390,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