From a4924de3136289d10cabbf2f61a228387d44ded7 Mon Sep 17 00:00:00 2001 From: gxc <guoxuecheng@guoxuechengdeMacBook-Pro.local> Date: 星期四, 07 十一月 2019 13:48:36 +0800 Subject: [PATCH] Merge branch 'dev-tzy' into DEV_GXC --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs | 173 +++++++++++++++++---------------------------------------- 1 files changed, 51 insertions(+), 122 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs index 6812b14..e19af85 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/DoorLockCommonLayout.cs @@ -13,62 +13,13 @@ #region 鈼� 鍙橀噺鐢虫槑__________________________ public FrameLayout topFrameLayout = new FrameLayout { Height = Application.GetRealHeight(184), BackgroundColor = ZigbeeColor.Current.XMTopFrameLayout }; public FrameLayout midFrameLayout = new FrameLayout { Height = Application.GetRealHeight(1921 - 184), BackgroundColor = ZigbeeColor.Current.XMMidFrameLayout }; - - #region 鈼� 搴曢儴鏈夊渾瑙掑竷灞�__________________________ - public FrameLayout shadowRadiusFrameLayout = new FrameLayout { BackgroundColor = 0x0f000000 }; - public FrameLayout bottomRadiusFrameLayout1 = new FrameLayout() + public FrameLayout bottomRadiusFrameLayout = new FrameLayout() { Height = Application.GetRealHeight(100), Y = Application.GetRealHeight(930), Radius = 17, BackgroundColor = ZigbeeColor.Current.XMWhite, }; - public FrameLayout bottomRadiusFrameLayout2 = new FrameLayout() - { - Height = Application.GetRealHeight(806 - 50), - Y = Application.GetRealHeight(930 + 48), - BackgroundColor = ZigbeeColor.Current.XMWhite, - }; - public FrameLayout bottomRadiusFrameLayout = new FrameLayout() - { - Height = Application.GetRealHeight(806), - Y = Application.GetRealHeight(930), - }; - - public Button btnCancel = new Button - { - X = Application.GetRealWidth(81), - Y = Application.GetRealHeight(40), - Height = Application.GetRealHeight(58), - Width = Application.GetRealWidth(101), - Text = Language.StringByID(R.MyInternationalizationString.Cancel), - TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, - TextSize = 14, - }; - - public Button btnBottomTitle = new Button - { - X = Application.GetRealWidth(446 - 50), - Y = Application.GetRealHeight(35), - Height = Application.GetRealHeight(63), - Width = Application.GetRealWidth(284), - Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), - TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, - TextSize = 16, - }; - - public Button btnFinish = new Button - { - X = Application.GetRealWidth(919), - Y = Application.GetRealHeight(40), - Height = Application.GetRealHeight(58), - Width = Application.GetRealWidth(101), - Text = Language.StringByID(R.MyInternationalizationString.Complete), - TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, - TextSize = 14, - }; - #endregion - public FrameLayout titleFrameLayout = new FrameLayout { Y = Application.GetRealHeight(92), @@ -93,6 +44,14 @@ Height = Application.GetRealHeight(51), Width = Application.GetRealWidth(30), UnSelectedImagePath = "DoorLock/Left.png", + }; + + /// <summary> + /// 鏍囬杩斿洖鎸夐敭 + /// </summary> + public Button btnTip = new Button + { + Gravity = Gravity.Center, }; /// <summary> @@ -143,6 +102,7 @@ titleFrameLayout.AddChidren(title); titleFrameLayout.AddChidren(btnBackFrameLayout); btnBackFrameLayout.AddChidren(btnBack); + this.midFrameLayout.AddChidren(this.btnTip); } /// <summary> /// 闂ㄩ攣涓儴甯冨眬 @@ -150,6 +110,7 @@ /// <param name="frameLayout"></param> public void MidFrameLayout(FrameLayout frameLayout) { + //midFrameLayout.BackgroundColor = Shared.Common.ZigbeeColor.Current.GXCBackgroundColor; midFrameLayout.Y = topFrameLayout.Bottom; this.AddChidren(midFrameLayout); } @@ -170,24 +131,10 @@ } /// <summary> - /// 闂ㄩ攣搴曢儴甯﹀渾瑙掑竷灞� - /// </summary> - /// <param name="frameLayout"></param> - public void BottomRadiusFrameLayout(FrameLayout frameLayout) - { - this.shadowRadiusFrameLayout.AddChidren(this.bottomRadiusFrameLayout1); - this.shadowRadiusFrameLayout.AddChidren(this.bottomRadiusFrameLayout2); - this.shadowRadiusFrameLayout.AddChidren(this.bottomRadiusFrameLayout); - this.bottomRadiusFrameLayout.AddChidren(btnCancel); - this.bottomRadiusFrameLayout.AddChidren(btnBottomTitle); - this.bottomRadiusFrameLayout.AddChidren(btnFinish); - } - - /// <summary> /// 杩滅▼鎺у埗鏉冮檺澶勭悊 /// </summary> /// <param name="btnNext"></param> - public void RemotePasswordDialog(ZigBee.Device.DoorLock doorLock, Button btnNext = null) + public void RemotePasswordDialog(ZigBee.Device.DoorLock doorLock, Button btnNext) { var dialog = new Dialog { }; var doorDialog = new Shared.Phone.UserCenter.DoorLock.DoorlockDialog(dialog, Language.StringByID(R.MyInternationalizationString.BindDoorLock)); @@ -215,10 +162,7 @@ doorDialog.dialogBtnCancel.MouseUpEventHandler += (sender1, e1) => { - if (btnNext != null) - { - btnNext.IsSelected = false; - } + btnNext.IsSelected = false; dialog.Close(); }; DateTime oldTime = DateTime.MaxValue; @@ -228,22 +172,22 @@ if (DateTime.Now < ZigBee.Device.DoorLock.minValue) { CommonPage.Loading.Hide(); - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterThirtySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterFiftySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); return; } if (DateTime.Now >= oldTime && ZigBee.Device.DoorLock.RemoteUnlockCount == 0) { - ZigBee.Device.DoorLock.RemoteUnlockCount = 3; + ZigBee.Device.DoorLock.RemoteUnlockCount = 5; oldTime = DateTime.MaxValue; } if (ZigBee.Device.DoorLock.RemoteUnlockCount <= 0) { - ZigBee.Device.DoorLock.minValue = DateTime.Now.AddSeconds(+20); + ZigBee.Device.DoorLock.minValue = DateTime.Now.AddSeconds(+15); oldTime = ZigBee.Device.DoorLock.minValue; CommonPage.Loading.Hide(); - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterThirtySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AfterFiftySeconds), Direction = AMPopTipDirection.Down, CloseTime = 2 }.Show(editInputPassword); return; } @@ -262,14 +206,12 @@ System.Threading.Thread.Sleep(500); ZigBee.Device.DoorLock.RemoteUnlockPassword = editInputPassword.Text; ZigBee.Device.DoorLock.minValue = DateTime.MinValue; - ZigBee.Device.DoorLock.RemoteUnlockCount = 3; + ZigBee.Device.DoorLock.RemoteUnlockCount = 5; oldTime = DateTime.MaxValue; CommonPage.Loading.Hide(); dialog.Close(); - if (btnNext != null) - { - btnNext.IsSelected = true; - } + btnNext.IsSelected = true; + if (!UserCenterResourse.Option.DoorUnLockByRemote) { var dialog2 = new Dialog { }; @@ -326,13 +268,13 @@ } /// <summary> - /// 杩滅▼寮�閿佽姹� + /// /// </summary> /// <param name="doorLock">闂ㄩ攣璁惧</param> /// <param name="action">浜屾楠岃瘉鐨勭粨鏋滄垚鍔熷悗鐨勯�氱煡</param> /// <param name="progressButton">闂ㄩ攣寮�鎴栧叧鏃惰繘搴︽樉绀�</param> /// <param name="btnDoorLockPic">闂ㄩ攣鍥剧墖寮�/鍏虫樉绀�</param> - public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton = null, Button btnDoorLockPic = null, Button btnStatus = null) + public void RemoteUnlockRequest(ZigBee.Device.DoorLock doorLock, Action action, Button progressButton, Button btnDoorLockPic, Button btnStatus) { if (ZigBee.Device.DoorLock.RemoteUnlockPassword == "") { @@ -353,11 +295,23 @@ }; doorDialog.dialogBtnConfirm.MouseUpEventHandler += (sender1, e1) => { - 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(); - dialog.Close(); + if (UserCenterResourse.UserInfo.AuthorityNo == 3) + { + 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(); + dialog.Close(); + } + else + { + 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(); + dialog.Close(); + } + }; return; } @@ -427,52 +381,27 @@ action = async () => { //杩滅▼寮�閿� - if (progressButton != null) - { - progressButton.Y = Application.GetRealHeight(10); - } - if (btnDoorLockPic != null) - { - btnDoorLockPic.IsSelected = true; - } - if (btnStatus != null) - { - btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Opening); - } + progressButton.Y = Application.GetRealHeight(10); + btnDoorLockPic.IsSelected = true; + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Opening); Application.RunOnMainThread(() => { CommonPage.Loading.Start("Loading..."); }); var remoteControlResult = await doorLock.RemoteControlAsync(ZigBee.Device.DoorLock.RemoteUnlockPassword); if (remoteControlResult != null && remoteControlResult.responseData != null && remoteControlResult.responseData.status == 0) { - - if (progressButton != null) - { - progressButton.Y = Application.GetRealHeight(347); - } - if (btnDoorLockPic != null) - { - btnDoorLockPic.IsSelected = false; - } - if (btnStatus != null) - { - System.Threading.Thread.Sleep(2000); - //btnStatus.Text = Language.StringByID(R.MyInternationalizationString.DoorLockOpen); - System.Threading.Thread.Sleep(3000); - btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose); - } + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.Opening); + System.Threading.Thread.Sleep(2000); + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.DoorLockOpen); + System.Threading.Thread.Sleep(3000); + progressButton.Y = Application.GetRealHeight(347); + btnDoorLockPic.IsSelected = false; + btnStatus.Text = Language.StringByID(R.MyInternationalizationString.CLose); CommonPage.Loading.Hide(); } else { - if (progressButton != null) - { - progressButton.Y = Application.GetRealHeight(347); - } - if (btnDoorLockPic != null) - { - btnDoorLockPic.IsSelected = false; - } - + progressButton.Y = Application.GetRealHeight(347); + btnDoorLockPic.IsSelected = false; CommonPage.Loading.Hide(); } }; -- Gitblit v1.8.0