From 5eeafe3af80bfd88306bd8ad9e76c8f4b51ca35f Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期四, 17 十二月 2020 14:16:20 +0800
Subject: [PATCH] 增加本地发送的重发机制

---
 HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs |  111 +++++++++++++++++++++++++++++++------------------------
 1 files changed, 63 insertions(+), 48 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
index 91a039c..99953e8 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/MemberManagement/MemberPermissionPage.cs
@@ -7,10 +7,14 @@
 
 namespace HDL_ON.UI
 {
+    /// <summary>
+    /// 浣跨敤鏉冮檺椤甸潰
+    /// </summary>
     public partial class MemberPermissionPage : FrameLayout
     {
         MemberPermissionPage bodyView;
         Button btnDelMember;
+        VerticalScrolViewLayout roomListView;
 
         ResidenceMemberInfo memberInfo;
 
@@ -59,20 +63,46 @@
             headPortraitView.AddChidren(btnMemberName);
 
             #region RoomList
-            FrameLayout contentView = new FrameLayout()
+            roomListView = new VerticalScrolViewLayout()
             {
                 Y = Application.GetRealHeight(138),
-                Height = Application.GetRealHeight(485),
+                Height = Application.GetRealHeight(471),
+                //BackgroundColor = CSS_Color.MainBackgroundColor,
+            };
+            bodyView.AddChidren(roomListView);
+            #endregion
+
+            btnDelMember = new Button()
+            {
+                Y = Application.GetRealHeight(617),
+                //Height = MainPage.Increase ? Application.GetRealHeight(70) : Application.GetRealHeight(50),
+                Height = Application.GetRealHeight(50),
+                TextAlignment = TextAlignment.Center,
+                TextSize = CSS_FontSize.SubheadingFontSize,
+                TextColor = CSS_Color.WarningColor,
+                TextID = StringId.RemoveTheMember,
                 BackgroundColor = CSS_Color.MainBackgroundColor,
             };
-            bodyView.AddChidren(contentView);
+            bodyView.AddChidren(btnDelMember);
+
+            LoadEventList();
+
+            GetShareDataByAccount();
+        }
+
+        /// <summary>
+        /// 鍔犺浇鎴块棿鍒楄〃,缁熻鍒嗕韩鐨勬暟鎹�
+        /// </summary>
+        void ShowRoomListView()
+        {
+            roomListView.RemoveAll();
 
             var titleView = new FrameLayout()
             {
                 BackgroundColor = CSS_Color.MainBackgroundColor,
                 Height = Application.GetRealWidth(44),
             };
-            contentView.AddChidren(titleView);
+            roomListView.AddChidren(titleView);
 
             var btnTitle = new Button()
             {
@@ -92,15 +122,15 @@
                 Height = Application.GetRealHeight(1),
                 BackgroundColor = CSS_Color.DividingLineColor,
             };
-            contentView.AddChidren(btnLine);
+            roomListView.AddChidren(btnLine);
 
             //---------------------------------------------
-            var roomListView = new VerticalScrolViewLayout()
-            {
-                Y = btnLine.Bottom,
-                Height = Application.GetRealHeight(440),
-            };
-            contentView.AddChidren(roomListView);
+            //var roomListView = new VerticalScrolViewLayout()
+            //{
+            //    Y = btnLine.Bottom,
+            //    Height = Application.GetRealHeight(440),
+            //};
+            //contentView.AddChidren(roomListView);
 
             //List<Function> funss = new List<Function>();
             //if (memberInfo.CurResidenceShareDate.Count > 0)
@@ -110,7 +140,7 @@
             //        funss.Add(Newtonsoft.Json.JsonConvert.DeserializeObject<ShareData>(System.Text.Encoding.UTF8.GetString(sd.ShareDataBytes)));
             //    }
             //}
-            foreach (var room in DB_ResidenceData.rooms)
+            foreach (var room in SpatialInfo.CurrentSpatial.RoomList)
             {
                 var roomView = new FrameLayout()
                 {
@@ -128,7 +158,7 @@
                     TextAlignment = TextAlignment.CenterLeft,
                     TextColor = CSS_Color.FirstLevelTitleColor,
                     TextSize = CSS_FontSize.TextFontSize,
-                    Text = room.name,
+                    Text = room.roomName,
                 };
                 roomView.AddChidren(btnRoomName);
 
@@ -136,18 +166,18 @@
                 int addCount = 0;
                 foreach (var sd in memberInfo.CurResidenceShareDate)
                 {
-                    if (room.GetRoomFunctions(false).Find((obj) => obj.sid == sd.fileName) != null)
+                    if (room.GetRoomFunctions(false).Find((obj) => obj.deviceId == sd.shareTypeId) != null)
                     {
                         addCount++;
                     }
                 }
                 //绉婚櫎褰撳墠浣忓畢宸茬粡涓嶅瓨鍦ㄧ殑鍔熻兘
-                for(int i= 0;i< memberInfo.CurResidenceShareDate.Count;)
+                for (int i = 0; i < memberInfo.CurResidenceShareDate.Count;)
                 {
                     var sd = memberInfo.CurResidenceShareDate[i];
-                    if (DB_ResidenceData.functionList.GetAllFunction().Find((obj) => obj.sid == sd.fileName) == null)
+                    if (FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.deviceId == sd.shareTypeId) == null)
                     {
-                        new DAL.Server.HttpServerRequest().DeleteShareData(sd);
+                        //new DAL.Server.HttpServerRequest().DeleteShareData(sd);
                         memberInfo.CurResidenceShareDate.Remove(sd);
                     }
                     else
@@ -184,7 +214,7 @@
                     Action<string> refreshFunctionCount = (newCount) => {
                         btnFunctionCount.Text = newCount + "/" + room.GetRoomFunctions(false).Count.ToString();
                     };
-                    var mmp = new MemberFunctionPermissionPage(memberInfo, room,refreshFunctionCount);
+                    var mmp = new MemberFunctionPermissionPage(memberInfo, room, refreshFunctionCount);
                     MainPage.BasePageView.AddChidren(mmp);
                     mmp.LoadPage(StringId.PermissionToUse);
                     MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
@@ -192,8 +222,9 @@
                 roomView.MouseUpEventHandler = eHandler;
                 btnRoomName.MouseUpEventHandler = eHandler;
                 btnRight.MouseUpEventHandler = eHandler;
+                btnFunctionCount.MouseUpEventHandler = eHandler;
 
-                if (DB_ResidenceData.rooms.IndexOf(room) < DB_ResidenceData.rooms.Count - 2)
+                if (SpatialInfo.CurrentSpatial.RoomList.IndexOf(room) < SpatialInfo.CurrentSpatial.RoomList.Count - 2)
                 {
                     var btnRoomLine = new Button()
                     {
@@ -207,36 +238,20 @@
                 }
             }
 
-            if (DB_ResidenceData.rooms.Count > 10)
-            {
-                roomListView.ScrollEnabled = true;
-            }
-            else
-            {
-                roomListView.ScrollEnabled = false;
+            //if (DB_ResidenceData.rooms.Count > 10)
+            //{
+            //    roomListView.ScrollEnabled = true;
+            //}
+            //else
+            //{
+            //    roomListView.ScrollEnabled = false;
 
-                roomListView.AddChidren(new Button()
-                {
-                    Height = Application.GetRealWidth(441),
-                    BackgroundColor = CSS_Color.BackgroundColor,
-                });
-            }
-            #endregion
-
-            btnDelMember = new Button()
-            {
-                Y = Application.GetRealHeight(617),
-                //Height = MainPage.Increase ? Application.GetRealHeight(70) : Application.GetRealHeight(50),
-                Height = Application.GetRealHeight(50),
-                TextAlignment = TextAlignment.Center,
-                TextSize = CSS_FontSize.SubheadingFontSize,
-                TextColor = CSS_Color.WarningColor,
-                TextID = StringId.RemoveTheMember,
-                BackgroundColor = CSS_Color.MainBackgroundColor,
-            };
-            bodyView.AddChidren(btnDelMember);
-
-            LoadEventList();
+            //    roomListView.AddChidren(new Button()
+            //    {
+            //        Height = Application.GetRealWidth(441),
+            //        BackgroundColor = CSS_Color.BackgroundColor,
+            //    });
+            //}
         }
     }
 }

--
Gitblit v1.8.0