HDL Home App 第二版本 旧平台金堂用 正在使用
chenqiyang
2022-06-22 dc0309e64f02227d8e1468b7326c07955f804612
ZigbeeApp/Shared/Phone/UserCenter/Abount/AbountForm.cs
old mode 100755 new mode 100644
@@ -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();
@@ -157,6 +159,11 @@
                        //更新最新版
                        btnRightView.TextID = R.MyInternationalizationString.Update;
                        rowUpdate.CanClick = true;
                        if (autoUpdate == true)
                        {
                            //直接升级
                            rowUpdate.ButtonClickEvent?.Invoke(null, null);
                        }
                    }
                    else
                    {
@@ -203,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;
@@ -225,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;
@@ -301,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;
@@ -318,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
@@ -382,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;
            }