From 7c2541f609e8235c4c33b4fb2ee27125f73f8ee6 Mon Sep 17 00:00:00 2001
From: lss <lsc@hdlchina.com.cn>
Date: 星期五, 24 六月 2022 13:28:36 +0800
Subject: [PATCH] 2022-06-24

---
 HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs |  105 +++++++++-------------------------------------------
 1 files changed, 18 insertions(+), 87 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
index 1f36b2b..8fe3476 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/Visitor/VisitorHistoryPage.cs
@@ -11,26 +11,33 @@
         private VerticalScrolViewLayout bodyScrolView;
         private List<VisitorTempPassword> pwdList;
 
-        public VisitorHistoryPage()
+        Action backAction;// 鍚庨��鎸夐敭锛屽埛鏂癠I
+        Action action;
+
+        public override void RemoveFromParent()
         {
+            backAction?.Invoke();
+            base.RemoveFromParent();
+        }
+
+        public VisitorHistoryPage(Action action)
+        {
+            backAction = action;
             bodyView = this;
         }
 
         public void LoadPage()
         {
+            action = () =>
+            {
+                LoadPage();
+            };
+
             pwdList = getVisitorPasswordData();
 
             #region 璁垮璁板綍鎸夐挳
-            Action click = () =>
-            {
-                VisitorHistoryPage page = new VisitorHistoryPage();
-                MainPage.BasePageView.AddChidren(page);
-                page.LoadPage();
-                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
-            };
             bodyView.BackgroundColor = CSS_Color.BackgroundColor;
-            new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorInvitation))
-                   .LoadTopView_SettingText(click, "");
+            new TopViewDiv(bodyView, Language.StringByID(StringId.VisitorInvitation)).LoadTopView();
             #endregion
 
             bodyScrolView = new VerticalScrolViewLayout()
@@ -94,7 +101,7 @@
                 itemLayout.AddChidren(btn);//+= (sender, e)
                 btn.MouseUpEventHandler += (sender, e) =>
                 {
-                    VisitorQRCodePage page = new VisitorQRCodePage(temPwd);
+                    VisitorQRCodePage page = new VisitorQRCodePage(action, temPwd);
                     MainPage.BasePageView.AddChidren(page);
                     page.LoadPage();
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -128,82 +135,6 @@
                 }
             }
             return dataList;
-        }
-
-        private List<TempPasswordInfo> infoList;
-        private void getTestData()
-        {
-            infoList = new List<TempPasswordInfo>();
-            TempPasswordInfo info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
-            info = new TempPasswordInfo();
-            info.homeId = 11111;
-            info.deviceId = 11111;
-            info.phone = "1234567890";
-            info.tempPwd = "134234";
-            info.useCount = 10;
-            info.validBeginTime = "2022/5/10 14:21:00";
-            info.validEndTime = "2022/5/12 14:21:00";
-            infoList.Add(info);
-
         }
     }
 }
\ No newline at end of file

--
Gitblit v1.8.0