From 6cc05bf6044c72f63b289da6b0a542970b16ef75 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期二, 14 十二月 2021 12:36:33 +0800
Subject: [PATCH] On Pro

---
 HDL-ON_Android/Properties/AndroidManifest.xml         |    2 
 HDL-ON_Android/Resources/mipmap-xhdpi/Loading.png     |    0 
 HDL-ON_Android/Assets/Language.ini                    |    2 
 HDL-ON_Android/Resources/mipmap-hdpi/Loading.png      |    0 
 HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs          |   54 ++++++++++++++++++
 HDL_ON/UI/UI0-Public/TopViewDiv.cs                    |   27 +++++++++
 HDL-ON_Android/Resources/mipmap-xxxhdpi/Loading.png   |    0 
 HDL-ON_iOS/Resources/Language.ini                     |    3 
 HDL_ON/Common/HDLCommon.cs                            |    1 
 HDL_ON/UI/UI0-Public/PublicAssmebly.cs                |   16 ++++-
 HDL_ON/Common/R.cs                                    |    5 +
 HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs |   31 ++++++++++
 HDL-ON_Android/Resources/mipmap-mdpi/Loading.png      |    0 
 HDL-ON_Android/Resources/drawable/Loading.png         |    0 
 HDL_ON/UI/MainPage.cs                                 |    2 
 HDL-ON_Android/Resources/mipmap-xxhdpi/Loading.png    |    0 
 16 files changed, 134 insertions(+), 9 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index b268c11..8b1810a 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -501,6 +501,7 @@
 513=Please enter the pairing code
 514=Gateway location information is not configured
 515=Add Security
+516=Withdrawal
  
 1000=Room Humidity
 1001=V-chip
@@ -1625,6 +1626,7 @@
 513=璇疯緭鍏ラ厤瀵圭爜
 514=鏈厤缃綉鍏充綅缃俊鎭�
 515=娣诲姞瀹夐槻
+516=鎾ら攢鍚屾剰
  
 1000=瀹ゅ唴婀垮害
 1001=绔ラ攣
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index b26cc36..29ed200 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -1,5 +1,5 @@
 锘�<?xml version="1.0" encoding="utf-8"?>
-<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112066" android:versionName="1.3.202112066" package="com.hdl.onpro">
+<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="202112131" android:versionName="1.4.3" package="com.hdl.onpro">
 	<uses-sdk android:minSdkVersion="23" android:targetSdkVersion="28" />
 	<!-- 涔愭鍙瀵硅闇�瑕佺殑鏉冮檺 -->
 	<!--<uses-permission android:name="android.permission.INTERNET" />-->
diff --git a/HDL-ON_Android/Resources/drawable/Loading.png b/HDL-ON_Android/Resources/drawable/Loading.png
index 9f84a83..73314f9 100644
--- a/HDL-ON_Android/Resources/drawable/Loading.png
+++ b/HDL-ON_Android/Resources/drawable/Loading.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/mipmap-hdpi/Loading.png b/HDL-ON_Android/Resources/mipmap-hdpi/Loading.png
index 57f5c27..f1bf830 100644
--- a/HDL-ON_Android/Resources/mipmap-hdpi/Loading.png
+++ b/HDL-ON_Android/Resources/mipmap-hdpi/Loading.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/mipmap-mdpi/Loading.png b/HDL-ON_Android/Resources/mipmap-mdpi/Loading.png
index 57f5c27..73314f9 100644
--- a/HDL-ON_Android/Resources/mipmap-mdpi/Loading.png
+++ b/HDL-ON_Android/Resources/mipmap-mdpi/Loading.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/mipmap-xhdpi/Loading.png b/HDL-ON_Android/Resources/mipmap-xhdpi/Loading.png
index 57f5c27..1f0af4e 100644
--- a/HDL-ON_Android/Resources/mipmap-xhdpi/Loading.png
+++ b/HDL-ON_Android/Resources/mipmap-xhdpi/Loading.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/mipmap-xxhdpi/Loading.png b/HDL-ON_Android/Resources/mipmap-xxhdpi/Loading.png
index ea64f54..0e6e665 100644
--- a/HDL-ON_Android/Resources/mipmap-xxhdpi/Loading.png
+++ b/HDL-ON_Android/Resources/mipmap-xxhdpi/Loading.png
Binary files differ
diff --git a/HDL-ON_Android/Resources/mipmap-xxxhdpi/Loading.png b/HDL-ON_Android/Resources/mipmap-xxxhdpi/Loading.png
index 3544e75..b588e7a 100644
--- a/HDL-ON_Android/Resources/mipmap-xxxhdpi/Loading.png
+++ b/HDL-ON_Android/Resources/mipmap-xxxhdpi/Loading.png
Binary files differ
diff --git a/HDL-ON_iOS/Resources/Language.ini b/HDL-ON_iOS/Resources/Language.ini
index 6593cb8..8b1810a 100644
--- a/HDL-ON_iOS/Resources/Language.ini
+++ b/HDL-ON_iOS/Resources/Language.ini
@@ -501,6 +501,7 @@
 513=Please enter the pairing code
 514=Gateway location information is not configured
 515=Add Security
+516=Withdrawal
  
 1000=Room Humidity
 1001=V-chip
@@ -1625,6 +1626,7 @@
 513=璇疯緭鍏ラ厤瀵圭爜
 514=鏈厤缃綉鍏充綅缃俊鎭�
 515=娣诲姞瀹夐槻
+516=鎾ら攢鍚屾剰
  
 1000=瀹ゅ唴婀垮害
 1001=绔ラ攣
@@ -2120,7 +2122,6 @@
 7152=绂诲紑鎴栧埌杈炬煇鍦�
 7153=绂诲紑
 7154=鍒拌揪
-
 
 
 
diff --git a/HDL_ON/Common/HDLCommon.cs b/HDL_ON/Common/HDLCommon.cs
index 861ee89..6a2a061 100644
--- a/HDL_ON/Common/HDLCommon.cs
+++ b/HDL_ON/Common/HDLCommon.cs
@@ -432,7 +432,6 @@
                     new Other.SkipControl().SetData(false, "", "", "","");
                     var sDM = new SiriKit.SceneDateManager();
                     Console.WriteLine($"IsLogin:{sDM.IsLgoin};accessToken:{sDM.AccessToken};refreshToken:{sDM.RefreshToken};RegionUrl:{sDM.RegionUrl};HomeId:{sDM.HomeId}");
-
 #endif
                 }
                 catch (Exception ex)
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index bff908c..5ffb8da 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -4,7 +4,10 @@
 {
     public static class StringId
     {
-
+        /// <summary>
+        /// 鎾ら攢鍚屾剰
+        /// </summary>
+        public const int WithdrawalConsent = 516;
         /// <summary>
         /// 娣诲姞瀹夐槻
         /// </summary>
diff --git a/HDL_ON/UI/MainPage.cs b/HDL_ON/UI/MainPage.cs
index f5be56b..b17177f 100644
--- a/HDL_ON/UI/MainPage.cs
+++ b/HDL_ON/UI/MainPage.cs
@@ -26,7 +26,7 @@
     /// <summary>
     /// 鐗堟湰鍙�
     /// </summary>
-    public static string VersionString = "1.4.1206";
+    public static string VersionString = "1.4.3";
     ///// <summary>
     ///// 瀹㈡埛绔被鍨�
     ///// </summary>
diff --git a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
index e3b259b..618425a 100644
--- a/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
+++ b/HDL_ON/UI/UI0-Public/PublicAssmebly.cs
@@ -129,14 +129,14 @@
                 //TextAlignment = TextAlignment.CenterLeft ,
             };
             editView.AddChidren(etParater);
-            if(encryption)
+            if (encryption)
             {
                 etParater.SecureTextEntry = encryption;
             }
 
             Button btnClear = new Button()
             {
-                X = Application.GetRealWidth(218-25),
+                X = Application.GetRealWidth(218 - 25),
                 Gravity = Gravity.CenterVertical,
                 Width = Application.GetRealWidth(24),
                 Height = Application.GetRealWidth(24),
@@ -235,6 +235,16 @@
         /// <param name="callBackAction"></param>
         public void TipOptionMsg(int titleId, int msgId, Action callBackAction)
         {
+            TipOptionMsg(titleId, Language.StringByID(msgId), callBackAction);
+        }
+        /// <summary>
+        /// 鍔犺浇鎻愮ず寮圭獥
+        /// </summary>
+        /// <param name="titleId"></param>
+        /// <param name="msgId"></param>
+        /// <param name="callBackAction"></param>
+        public void TipOptionMsg(int titleId, string msg, Action callBackAction)
+        {
             Dialog dialog = new Dialog()
             {
                 BackgroundColor = CSS_Color.DialogTransparentColor1,
@@ -273,7 +283,7 @@
                 TextAlignment = TextAlignment.Center,
                 TextColor = CSS_Color.TextualColor,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                TextID = msgId,
+                Text = msg,
                 IsMoreLines = true,
             };
             contentView.AddChidren(btnMsg);
diff --git a/HDL_ON/UI/UI0-Public/TopViewDiv.cs b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
index 688ede5..34c732e 100644
--- a/HDL_ON/UI/UI0-Public/TopViewDiv.cs
+++ b/HDL_ON/UI/UI0-Public/TopViewDiv.cs
@@ -366,6 +366,33 @@
             };
         }
         /// <summary>
+        /// 鍗忚绠$悊椤堕儴
+        /// 甯︽挙閿�鍚屾剰鎸夐挳
+        /// </summary>
+        public void LoadTopView_WithdrawalConsent(Action withdrawalConsentAction)
+        {
+            LoadTopView();
+
+            var btnAddIcon = new Button()
+            {
+                X = Application.GetRealWidth(352-100),
+                Y = Application.GetRealHeight(29),
+                Width = Application.GetMinRealAverage(100),
+                Height = Application.GetMinRealAverage(28),
+                TextID = StringId.WithdrawalConsent,
+                TextAlignment = TextAlignment.CenterRight,
+                TextColor = CSS_Color.MainColor,
+                TextSize = CSS_FontSize.TextFontSize,
+            };
+            contentView.AddChidren(btnAddIcon);
+
+            btnAddIcon.MouseUpEventHandler += (sender, e) =>
+            {
+                withdrawalConsentAction?.Invoke();
+            };
+        }
+
+        /// <summary>
         /// 鎴愬憳椤堕儴鏍�
         /// </summary>
         public void LoadTopView_MemberTopView(Action addAction, Action action)
diff --git a/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs b/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs
index cae77b9..7cfb3f9 100644
--- a/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs
+++ b/HDL_ON/UI/UI0-Public/Widget/WebViewDialog.cs
@@ -71,6 +71,60 @@
             this.Show();
         }
 
+        /// <summary>
+        /// 鍔犺浇椤甸潰
+        /// 闄勫甫鎾ら攢鍚屾剰鎸夐挳
+        /// </summary>
+        /// <param name="titleStr"></param>
+        /// <param name="url"></param>
+        public void LoadPageWithdrawalConsent(string titleStr,string url)
+        {
+            bodyView.BackgroundColor = CSS_Color.MainBackgroundColor;
+            this.AddChidren(bodyView);
+            Action action = () => {
+                string msg = "";
+                if(Language.CurrentLanguage == "Chinese")
+                {
+                    msg = "鎾ゅ洖鎺堟潈鍚庯紝鎮ㄥ皢鏃犳硶缁х画浣跨敤On Pro App";
+                }else
+                {
+                    msg = "After you withdraw your authorization, you will no longer be able to use On Pro app";
+                }
+                Action withdramAction = () => {
+                    OnAppConfig.Instance.isAgreePrivacyPolicy = false;
+                    OnAppConfig.Instance.SaveConfig();
+                    HDLCommon.Current.Logout();
+                    Close();
+                };
+                new PublicAssmebly().TipOptionMsg(StringId.Tip, msg, withdramAction);
+            };
+            new TopViewDiv(this, bodyView, titleStr).LoadTopView_WithdrawalConsent(action);
+            //WebView
+            mWebView = new WebView()
+            {
+                Y = Application.GetRealHeight(64),
+                Height = bodyView.Height - Application.GetRealHeight(64),
+                X = Application.GetRealWidth(16),
+                Width = bodyView.Width - Application.GetRealWidth(32)
+            };
+            bodyView.AddChidren(mWebView);
+
+            try
+            {
+                if (!string.IsNullOrEmpty(url))
+                {
+                    //鍔犺浇缃戝潃
+                    mWebView.LoadRequest(url);
+                }
+            }
+            catch
+            {
+
+            }
+
+            this.Show();
+        }
+
 
         /// <summary>
         /// 鍔犺浇椤甸潰
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
index fa1831f..5c31fd5 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/AboutOn/AboutOnPage.cs
@@ -64,7 +64,7 @@
                 Y = Application.GetRealWidth(184),
                 Height = Application.GetRealWidth(28),
                 TextAlignment = TextAlignment.Center,
-                Text = "ON+",
+                Text = "On Pro",
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.EmphasisFontSize_Secondary,
                 IsBold = true,
@@ -154,6 +154,35 @@
             versionUpdateView.GoAction = versionUpdateAction;
             #endregion
 
+            #region 杞欢鏈嶅姟鍗忚
+            var serviceAgreementView = new ListCellView()
+            {
+                Y = versionUpdateView.Bottom,
+            };
+            bodyView.AddChidren(serviceAgreementView);
+            serviceAgreementView.BtnTilte.TextID = StringId.UserAgreement;
+            Action serviceAgreementAction = () => {
+                string url = Constant.URL_PRIVACYPOLICY;
+                string titleStr = Language.StringByID(StringId.PrivacyPolicy);
+                new WebViewDialog().LoadPageWithdrawalConsent(titleStr, url);
+            };
+            serviceAgreementView.GoAction = serviceAgreementAction;
+            #endregion
+
+            #region 鐢ㄦ埛淇℃伅淇濇姢鍗忚
+            var privacyPolicyView = new ListCellView()
+            {
+                Y = serviceAgreementView.Bottom,
+            };
+            bodyView.AddChidren(privacyPolicyView);
+            privacyPolicyView.BtnTilte.TextID = StringId.PrivacyPolicy;
+            Action privacyPolicyAction = () => {
+                string url =  Constant.URL_USERAGREEMENT;
+                string titleStr = Language.StringByID(StringId.UserAgreement);
+                new WebViewDialog().LoadPageWithdrawalConsent(titleStr, url);
+            };
+            #endregion
+            privacyPolicyView.GoAction = privacyPolicyAction;
             CheckIfNeedUpdateAsync();
         }
 

--
Gitblit v1.8.0