From 5986f63b75bd81c6cef262c670e9251c038cbf5d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期二, 17 十二月 2019 17:21:07 +0800
Subject: [PATCH] 合并一个版本

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs |  141 ++++++++++++++++++++++++++---------------------
 1 files changed, 78 insertions(+), 63 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
index 29ec891..2a71d4b 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/MemberFrozenPage.cs
@@ -21,8 +21,29 @@
         #region 鈼� 鍙橀噺鐢虫槑__________________________
         ZigBee.Device.DoorLock doorLock;
         Shared.Phone.UserCenter.MemberInfoRes curAccountObj;
-        VerticalScrolViewLayout bodyView;
+        VerticalRefreshLayout bodyView;
         #endregion
+
+        void ReadDoorLockUserInfo()
+        {
+            System.Threading.Tasks.Task.Run(async () =>
+            {
+                try
+                {
+                    var list = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockAllAcountUserlist(doorLock);
+                    var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, curAccountObj.SubAccountDistributedMark);
+                    var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, curAccountObj.SubAccountDistributedMark);
+                }
+                catch { }
+                finally
+                {
+                    Application.RunOnMainThread(() =>
+                    {
+                        MidRefresh();
+                    });
+                }
+            });
+        }
 
         /// <summary>
         /// UI鏄剧ず 
@@ -47,22 +68,22 @@
             this.btnBack.MouseUpEventHandler += eHandlerBack;
             this.btnBackFrameLayout.MouseUpEventHandler += eHandlerBack;
             this.MidFrameLayout(this);
-            this.titleFrameLayout.MouseUpEventHandler += (sender, e) =>
-            {
-                var userDoorLockPage = new UserDoorLockPage(doorLock, curAccountObj);
-                Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
-                Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
-                userDoorLockPage.Show();
-            };
-            bodyView = new VerticalScrolViewLayout()
+
+            bodyView = new VerticalRefreshLayout()
             {
             };
             this.midFrameLayout.AddChidren(bodyView);
+            MidRefresh();
 
-            ReadDoorLockUserInfo();
+            bodyView.BeginHeaderRefreshingAction += () =>
+            {
+                bodyView.BeginHeaderRefreshing();
+                ReadDoorLockUserInfo();
+                bodyView.EndHeaderRefreshing();
+            };
         }
 
-        public void MidRefresh()
+        public async void MidRefresh()
         {
             bodyView.RemoveAll();
 
@@ -70,8 +91,8 @@
             {
                 var RowView = new FrameLayout()
                 {
-                    Height = Application.GetRealHeight(127 + 20),
-                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMTopFrameLayout,
+                    Height = Application.GetRealHeight(127 + 23),
+                    BackgroundColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 };
                 bodyView.AddChidren(RowView);
 
@@ -128,7 +149,8 @@
                     btnRight.UnSelectedImagePath = "DoorLock/Switch.png";
                     btnRight.SelectedImagePath = "DoorLock/SwitchOn.png";
 
-                    if (doorLock.IsFreezeAccount[curAccountObj.SubAccountDistributedMark] == true)
+                    var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, curAccountObj.SubAccountDistributedMark);
+                    if (result == true)
                     {
                         btnRight.IsSelected = true;
                     }
@@ -150,7 +172,8 @@
                         btnRight.SelectedImagePath = "DoorLock/SwitchOn.png";
                         line2.Visible = false;
 
-                        if (doorLock.HasRemoteUnlockAccess[curAccountObj.SubAccountDistributedMark] == true)
+                        var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, curAccountObj.SubAccountDistributedMark);
+                        if (result1 == true)
                         {
                             btnRight.IsSelected = true;
                         }
@@ -204,10 +227,23 @@
                         }
                     }
                 };
-                btnRightFrameLayout.MouseUpEventHandler += eHandler;
-                btnRight.MouseUpEventHandler += eHandler;
-                RowView.MouseUpEventHandler += eHandler;
-                btnText.MouseUpEventHandler += eHandler;
+                if (i == 0)
+                {
+                    btnRightFrameLayout.MouseUpEventHandler += eHandler;
+                    btnRight.MouseUpEventHandler += eHandler;
+                    RowView.MouseUpEventHandler += eHandler;
+                    btnText.MouseUpEventHandler += eHandler;
+                }
+                else if (i == 1)
+                {
+                    btnRightFrameLayout.MouseUpEventHandler += eHandler;
+                    btnRight.MouseUpEventHandler += eHandler;
+                }
+                else if (i == 2)
+                {
+                    btnRightFrameLayout.MouseUpEventHandler += eHandler;
+                    btnRight.MouseUpEventHandler += eHandler;
+                }
             }
         }
 
@@ -270,11 +306,11 @@
                                                      {
                                                          if (isFreeze)
                                                          {
-                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                          }
                                                          else
                                                          {
-                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                          }
                                                          return;
                                                      });
@@ -284,7 +320,7 @@
                                              {
                                                  Application.RunOnMainThread(() =>
                                                  {
-                                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                  });
                                              }
                                          }
@@ -315,7 +351,7 @@
                                                  {
                                                      Application.RunOnMainThread(() =>
                                                      {
-                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                      });
                                                  }
                                              }
@@ -323,7 +359,7 @@
                                              {
                                                  Application.RunOnMainThread(() =>
                                                  {
-                                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                     new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                  });
                                              }
                                          }
@@ -376,11 +412,11 @@
                                                          {
                                                              if (isFreeze)
                                                              {
-                                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                              }
                                                              else
                                                              {
-                                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                              }
                                                              return;
                                                          });
@@ -390,7 +426,7 @@
                                                  {
                                                      Application.RunOnMainThread(() =>
                                                      {
-                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(this.btnTip);
+                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(Common.CommonPage.Instance);
                                                      });
                                                  }
                                              }
@@ -424,7 +460,7 @@
                                                      {
                                                          Application.RunOnMainThread(() =>
                                                          {
-                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                          });
                                                      }
                                                  }
@@ -432,7 +468,7 @@
                                                  {
                                                      Application.RunOnMainThread(() =>
                                                      {
-                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(this.btnTip);
+                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(Common.CommonPage.Instance);
                                                      });
                                                  }
                                              }
@@ -442,11 +478,11 @@
                                                  {
                                                      if (isFreeze)
                                                      {
-                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed) + ".", Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(this.btnTip);
+                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed) + ".", Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(Common.CommonPage.Instance);
                                                      }
                                                      else
                                                      {
-                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed) + ".", Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(this.btnTip);
+                                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed) + ".", Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(Common.CommonPage.Instance);
                                                      }
                                                      return;
                                                  });
@@ -456,7 +492,7 @@
                                          {
                                              Application.RunOnMainThread(() =>
                                              {
-                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 2 }.Show(this.btnTip);
+                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GwResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 2 }.Show(Common.CommonPage.Instance);
                                              });
                                          }
                                      }
@@ -500,11 +536,11 @@
                                          {
                                              if (isFreeze)
                                              {
-                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.FreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                              }
                                              else
                                              {
-                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                 new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.UnFreezeFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                              }
                                              return;
                                          });
@@ -514,7 +550,7 @@
                                  {
                                      Application.RunOnMainThread(() =>
                                      {
-                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
 
                                      });
                                  }
@@ -612,7 +648,7 @@
                                             {
                                                 Application.RunOnMainThread(() =>
                                                 {
-                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GiveAccessToSubaccountFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GiveAccessToSubaccountFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                 });
                                             }
                                         }
@@ -620,7 +656,7 @@
                                         {
                                             Application.RunOnMainThread(() =>
                                             {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                             });
                                         }
                                     }
@@ -651,7 +687,7 @@
                                             {
                                                 Application.RunOnMainThread(() =>
                                                 {
-                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CancelAccessToSubaccountFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                    new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CancelAccessToSubaccountFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                                 });
                                             }
                                         }
@@ -659,7 +695,7 @@
                                         {
                                             Application.RunOnMainThread(() =>
                                             {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                             });
                                         }
                                     }
@@ -702,11 +738,11 @@
                                         {
                                             if (hasAccess)
                                             {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GiveAccessToSubaccountFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.GiveAccessToSubaccountFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                             }
                                             else
                                             {
-                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CancelAccessToSubaccountFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                                new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CancelAccessToSubaccountFailed), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                             }
                                             return;
                                         });
@@ -716,7 +752,7 @@
                                 {
                                     Application.RunOnMainThread(() =>
                                     {
-                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                                        new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.None, CloseTime = 1 }.Show(Common.CommonPage.Instance);
                                     });
                                 }
                             }
@@ -750,27 +786,6 @@
                     MidRefresh();
                 }
             };
-        }
-
-        void ReadDoorLockUserInfo()
-        {
-            System.Threading.Tasks.Task.Run(async () =>
-            {
-                Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); });
-                try
-                {
-                    await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetLocaDoorLocklist(doorLock, curAccountObj);
-                }
-                catch { }
-                finally
-                {
-                    Application.RunOnMainThread(() =>
-                    {
-                        MidRefresh();
-                        CommonPage.Loading.Hide();
-                    });
-                }
-            });
         }
 
         #region 鈼� 鎺ュ彛瀹炵幇__________________________

--
Gitblit v1.8.0