From e0a0e3dc5c665a54a94cc170d99ce7404d774885 Mon Sep 17 00:00:00 2001
From: lss <lsc@hdlchina.com.cn>
Date: 星期一, 27 六月 2022 10:53:42 +0800
Subject: [PATCH] 2022-6-27

---
 HDL-ON_Android/Properties/AndroidManifest.xml                |    9 ++
 HDL-ON_Android/Assets/Language.ini                           |    7 ++
 HDL_ON/Common/R.cs                                           |    4 +
 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs  |  109 +++++++++++++++++++++---------------
 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs |    4 
 5 files changed, 84 insertions(+), 49 deletions(-)

diff --git a/HDL-ON_Android/Assets/Language.ini b/HDL-ON_Android/Assets/Language.ini
index cae01a5..00e4bb2 100644
--- a/HDL-ON_Android/Assets/Language.ini
+++ b/HDL-ON_Android/Assets/Language.ini
@@ -529,6 +529,8 @@
 541=Monitoring
 542=Wandering alarm
 543=Get more
+
+2532=Visitor Invitation Record
 2533=Visitor management
 2534=Visitor Invitation
 2535=Record
@@ -1709,7 +1711,8 @@
 541=鐩戞帶涓�
 542=寰樺緤鎶ヨ
 543=鑾峰彇鏇村
- 
+
+2532=璁垮閭�璇疯褰�
 2533=璁垮绠$悊
 2534=璁垮閭�璇�
 2535=璁垮璁板綍
@@ -2870,6 +2873,8 @@
 541=Monitoring
 542=Wandering alarm
 543=Get more
+
+2532=Visitor Invitation Record
 2533=Visitor management
 2534=Visitor Invitation
 2535=Record
diff --git a/HDL-ON_Android/Properties/AndroidManifest.xml b/HDL-ON_Android/Properties/AndroidManifest.xml
index 3bcb874..aa1f563 100644
--- a/HDL-ON_Android/Properties/AndroidManifest.xml
+++ b/HDL-ON_Android/Properties/AndroidManifest.xml
@@ -88,7 +88,13 @@
 	<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
 	<uses-permission android:name="android.permission.READ_LOGS" />
 	<!-- 鏋佸厜鎺ㄩ�佺粨鏉� -->
-	<application android:allowBackup="true" android:debuggable="false" android:icon="@drawable/Icon" android:networkSecurityConfig="@xml/network_security_config" android:largeHeap="true" android:label="On Pro">
+	<application android:allowBackup="true"
+		android:debuggable="false"
+		android:icon="@drawable/Icon"
+		android:requestLegacyExternalStorage="true"
+		android:networkSecurityConfig="@xml/network_security_config"
+		android:largeHeap="true"
+		android:label="On Pro">
 		<!--/鎵弿浜岀淮鐮乤ctivity-->
 		<!--<activity
             android:name="com.journeyapps.barcodescanner.CaptureActivity"
@@ -99,6 +105,7 @@
             android:name=".CustomCaptureActivity"
             android:screenOrientation="portrait"
             tools:replace="screenOrientation" />-->
+
 		<provider android:name="android.support.v4.content.FileProvider" android:authorities="com.hdl.onpro.fileProvider" android:grantUriPermissions="true" android:exported="false">
 			<meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/file_paths" />
 		</provider>
diff --git a/HDL_ON/Common/R.cs b/HDL_ON/Common/R.cs
index f415d7c..cd21a50 100644
--- a/HDL_ON/Common/R.cs
+++ b/HDL_ON/Common/R.cs
@@ -107,6 +107,10 @@
         /// </summary>
         public const int VisitorTip = 2536;
         /// <summary>
+        /// 璁垮閭�璇疯褰�
+        /// </summary>
+        public const int VisitorInvitationRecord = 2532;
+        /// <summary>
         /// 璁垮璁板綍
         /// </summary>
         public const int VisitorRecord = 2535;
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
index 8fe3476..4e1dc4d 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
@@ -37,7 +37,7 @@
 
             #region 璁垮璁板綍鎸夐挳
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorInvitation)).LoadTopView();
+            new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorRecord)).LoadTopView();
             #endregion
 
             bodyScrolView = new VerticalScrolViewLayout()
@@ -62,7 +62,7 @@
                 {
                     Height = Application.GetRealWidth(20),
                     Y = Application.GetRealWidth(6),
-                    Text = Language.StringByID(StringId.VisitorQRCode),
+                    Text = Language.StringByID(StringId.VisitorInvitationRecord),
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.text1Color,
                     TextSize = CSS_FontSize.TextFontSize,
diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs
index fb79e54..efd1ad3 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorQRCodePage.cs
@@ -46,7 +46,7 @@
         public void LoadPage()
         {
             #region 椤堕儴瀵艰埅鏍�
-            if (tempPassword == null|| tempPassword.id==null)
+            if (tempPassword == null || tempPassword.id == null)
             {
                 tempPassword = new VisitorTempPassword();
 
@@ -112,34 +112,17 @@
                 Width = Application.GetRealWidth(335),
                 TextSize = CSS_FontSize.TextFontSize,
                 TextColor = CSS_Color.FirstLevelTitleColor,
-                
+
                 PlaceholderText = Language.StringByID(StringId.InputPhoneNumberOfTheVisitor),
                 Text = tempPassword.phone,
                 IsNumberKeyboardType = true,
                 PlaceholderTextColor = CSS_Color.PromptingColor1,
             };
             bodyScrolView.AddChidren(phoneNumberEditText);
-            phoneNumberEditText.Foucs = true;
-            phoneNumberEditText.FoucsChanged = (sender, e) =>
-            {
-                if (!phoneNumberEditText.Foucs)
-                {
-                    //鎵嬫満鍙风爜閿欒鎻愮ず
-                    if (!Utlis.CheckPhoneNumber(phoneNumberEditText.Text.Trim(), "86"))
-                    {
-                        var tip_dialog = new Tip()
-                        {
-                            Text = Language.StringByID(StringId.PhoneNumberErrorTip),
-                            CloseTime = 2,
-                            Direction = AMPopTipDirection.None
-                        };
-                        tip_dialog.Show(MainPage.BaseView);
-                    }
-                }
-            };
+            //phoneNumberEditText.Foucs = true;
 
-             // 鍒嗗壊绾�
-             bodyScrolView.AddChidren(new Button()
+            // 鍒嗗壊绾�
+            bodyScrolView.AddChidren(new Button()
             {
                 X = Application.GetRealWidth(20),
                 Width = Application.GetRealWidth(335),
@@ -177,20 +160,6 @@
                 PlaceholderTextColor = CSS_Color.PromptingColor1,
             };
             pwdLayout.AddChidren(pwdEditText);
-            pwdEditText.FoucsChanged = (sender, e) =>
-            {
-                if (!pwdEditText.Foucs)
-                {
-                    // 6浣嶅瘑鐮侀獙璇�
-                    var tip_dialog = new Tip()
-                    {
-                        Text = Language.StringByID(StringId.Input6_DigitsTemporaryPassword),
-                        CloseTime = 2,
-                        Direction = AMPopTipDirection.None
-                    };
-                    tip_dialog.Show(MainPage.BaseView);
-                }
-            };
 
             //闅忔満瀵嗙爜Btn
             randomBtn = new Button()
@@ -204,11 +173,6 @@
             };
             pwdLayout.AddChidren(randomBtn);
             bodyScrolView.AddChidren(pwdLayout);
-            randomBtn.MouseUpEventHandler += (sender, e) =>
-            {
-                string tPwd = getRandomPwd();
-                pwdEditText.Text = tPwd;
-            };
 
             // 鍒嗗壊绾�
             bodyScrolView.AddChidren(new Button()
@@ -413,7 +377,6 @@
             };
             bodyScrolView.AddChidren(visitorVoucherBtn);
 
-            //
             Action voucher_action = () =>
             {
                 if (codeIV.ImageBytes == null)
@@ -516,12 +479,68 @@
                 {
                     msg = Language.StringByID(StringId.saveFail);
                 }
-                EmptyTipView tipView = new EmptyTipView(msg, 160);
-                tipView.Gravity = Gravity.CenterHorizontal;
-                bodyView.AddChidren(tipView);
+
+                var tip_dialog = new Tip()
+                {
+                    Text = msg,
+                    CloseTime = 2,
+                    Direction = AMPopTipDirection.None
+                };
+                tip_dialog.Show(MainPage.BaseView);
 #endif
             };
 
+            if (tempPassword != null && tempPassword.id != null && tempPassword.id != "")
+            {
+                pwdEditText.Text = tempPassword.tempPwd;
+                pwdEditText.Enable = false;
+                phoneNumberEditText.Enable = false;
+                randomBtn.Enable = false;
+                startTimeBtn.Enable = false;
+                endTimeBtn.Enable = false;
+            }
+            else
+            {
+                pwdEditText.FoucsChanged = (sender, e) =>
+                {
+                    if (!pwdEditText.Foucs)
+                    {
+                        // 6浣嶅瘑鐮侀獙璇�
+                        var tip_dialog = new Tip()
+                        {
+                            Text = Language.StringByID(StringId.Input6_DigitsTemporaryPassword),
+                            CloseTime = 2,
+                            Direction = AMPopTipDirection.None
+                        };
+                        tip_dialog.Show(MainPage.BaseView);
+                    }
+                };
+
+                randomBtn.MouseUpEventHandler += (sender, e) =>
+                {
+                    string tPwd = getRandomPwd();
+                    pwdEditText.Text = tPwd;
+                };
+
+                phoneNumberEditText.FoucsChanged = (sender, e) =>
+                {
+                    if (!phoneNumberEditText.Foucs)
+                    {
+                        //鎵嬫満鍙风爜閿欒鎻愮ず
+                        if (!Utlis.CheckPhoneNumber(phoneNumberEditText.Text.Trim(), "86"))
+                        {
+                            var tip_dialog = new Tip()
+                            {
+                                Text = Language.StringByID(StringId.PhoneNumberErrorTip),
+                                CloseTime = 2,
+                                Direction = AMPopTipDirection.None
+                            };
+                            tip_dialog.Show(MainPage.BaseView);
+                        }
+                    }
+                };
+            }
+
             RefreshVisitorVoucherBtn();
         }
 

--
Gitblit v1.8.0