From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 十一月 2019 15:36:28 +0800
Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了

---
 ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs |   53 +++++++++++++++++++++++++++++++++++++++++++----------
 1 files changed, 43 insertions(+), 10 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
index b964c76..4044118 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/UserDoorLockPage.cs
@@ -9,6 +9,7 @@
         public UserDoorLockPage(ZigBee.Device.DoorLock doorLock, Shared.Phone.UserCenter.MemberInfoRes accountObj)
         {
             this.doorLock = doorLock;
+            //currentRoom = room;Shared.Common.Room room, 
             BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCTopViewBackgroundColor;
             ZigBee.Device.ZbGateway.StatusList.Add(this);
         }
@@ -16,6 +17,7 @@
         #region 鈼� 鍙橀噺鐢虫槑__________________________
         ZigBee.Device.DoorLock doorLock;
         FrameLayout bottomFrameLayout;
+        Shared.Common.Room currentRoom;
         Action action;
         #endregion
 
@@ -36,16 +38,15 @@
 
             var btnShare = new Button
             {
-                X = Application.GetRealWidth(850),
+                X = Application.GetRealWidth(850 - 116),
                 Height = Application.GetRealHeight(69),
                 Width = Application.GetRealWidth(69),
-                UnSelectedImagePath = "DoorLock/ShareIcon.png",
             };
             this.titleFrameLayout.AddChidren(btnShare);
 
             var btnFuncSet = new Button
             {
-                X = Application.GetRealWidth(953),
+                X = Application.GetRealWidth(953 - 116),
                 Height = Application.GetRealHeight(69),
                 Width = Application.GetRealWidth(69),
                 UnSelectedImagePath = "DoorLock/SettingIcon.png",
@@ -53,16 +54,16 @@
             this.titleFrameLayout.AddChidren(btnFuncSet);
             btnFuncSet.MouseDownEventHandler += (sender, e) =>
             {
-                if (UserCenterResourse.UserInfo.AuthorityNo == 3)
+                if (UserCenterResourse.UserInfo.AuthorityNo == 1)
                 {
-                    var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
+                    var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
                     Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
                     Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                     userDoorLockPage.Show();
                 }
                 else
                 {
-                    var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSetting(doorLock);
+                    var userDoorLockPage = new Shared.Phone.UserCenter.DoorLock.FunctionSettingSub(doorLock);
                     Shared.Phone.UserView.HomePage.Instance.AddChidren(userDoorLockPage);
                     Shared.Phone.UserView.HomePage.Instance.PageIndex += 1;
                     userDoorLockPage.Show();
@@ -131,11 +132,21 @@
                 Height = Application.GetRealHeight(69),
                 X = Application.GetRealWidth(850),
                 Y = Application.GetRealHeight(46),
-                UnSelectedImagePath = "DoorLock/FavoriteIcon.png",
+                UnSelectedImagePath = "Item/Collection.png",
+                SelectedImagePath = "Item/CollectionSelected.png"
             };
             midTopFrameLayout.AddChidren(btnCollect);
             btnCollect.MouseDownEventHandler += (sender, e) =>
             {
+                btnCollect.IsSelected = !btnCollect.IsSelected;
+                if (btnCollect.IsSelected)
+                {
+                    // Shared.Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(doorLock.FileName); //鍙栨秷鏀惰棌
+                }
+                else
+                {
+                    //Shared.Common.Room.CurrentRoom.GetLoveRoom().AddDevice(doorLock.FileName);//鏀惰棌
+                }
             };
 
             var btnCurrentText = new Button()
@@ -268,7 +279,7 @@
                 Height = Application.GetRealHeight(49),
                 X = Application.GetRealWidth(150),
                 Y = Application.GetRealHeight(46),
-                Text = "瀹㈠巺",
+                // Text = currentRoom.Name,
                 TextColor = Shared.Common.ZigbeeColor.Current.XMWhite,
                 TextSize = 12,
                 TextAlignment = TextAlignment.CenterLeft,
@@ -278,13 +289,35 @@
 
             EventHandler<MouseEventArgs> hander1 = async (sender, e) =>
              {
-                 RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus);
+                 if (UserCenterResourse.UserInfo.AuthorityNo != 1)
+                 {
+                     var result = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockOperateAccess(doorLock, Shared.Common.Config.Instance.Guid);
+                     if (result == false)
+                     {
+                         var result1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetDoorLockUnlockAccess(doorLock, Shared.Common.Config.Instance.Guid);
+                         if (result1 == true)
+                         {
+                             RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus);
+                         }
+                         else
+                         {
+                             new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.NoAccess), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                         }
+                     }
+                     else
+                     {
+                         new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AccountIsFreezed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(this.btnTip);
+                     }
+                 }
+                 else
+                 {
+                     RemoteUnlockRequest(doorLock, action, progressButton, btnDoorLockPic, btnStatus);
+                 }
              };
             openFrameLayout.MouseUpEventHandler += hander1;
             btnDoorOpenPic.MouseUpEventHandler += hander1;
             EventHandler<MouseEventArgs> hander2 = (sender, e) =>
             {
-                //new Tip() { MaxWidth = 150, Text = "涓嶆敮鎸佽繙绋嬪叧閿�", Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(openFrameLayout);
                 btnDoorLockPic.IsSelected = false;
                 progressButton.Y = Application.GetRealHeight(347);
             };

--
Gitblit v1.8.0