From fa6bcb2e9907772480f99205f36ec2a1ce735a22 Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期四, 09 一月 2020 14:11:07 +0800 Subject: [PATCH] 合并代码 --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs | 81 ++++++++++++++++++++++++++-------------- 1 files changed, 53 insertions(+), 28 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs index 54e6830..e70341a 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/EntryStatusPage.cs @@ -66,6 +66,7 @@ TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, Gravity = Gravity.CenterHorizontal, TextSize = 20, + IsBold = true, }; this.midFrameLayout.AddChidren(btnPicTip); @@ -131,7 +132,7 @@ var btnLine = new FrameLayout() { Width = Application.GetRealWidth(965), - Height = Application.GetRealHeight(5), + Height = 1, X = Application.GetRealWidth(58), Y = Application.GetRealHeight(81 + 127), BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, @@ -152,7 +153,7 @@ Width = Application.GetRealWidth(222), Height = Application.GetRealHeight(58), Y = Application.GetRealHeight(35), - Text = Language.StringByID(R.MyInternationalizationString.MatchPerson), + Text = Language.StringByID(R.MyInternationalizationString.MatchPerson) + ":", TextColor = Shared.Common.ZigbeeColor.Current.XMBlack, TextAlignment = TextAlignment.CenterLeft, TextSize = 14, @@ -171,6 +172,16 @@ }; personRemarkRemarkFrameLayout.AddChidren(btnMatchPersonContent); + var btnLine1 = new FrameLayout() + { + Width = Application.GetRealWidth(965), + Height = 1, + X = Application.GetRealWidth(58), + Y = Application.GetRealHeight(81 + 127 + 12 + 127), + BackgroundColor = Shared.Common.ZigbeeColor.Current.XMRowLine, + }; + bottomFrameLayout.AddChidren(btnLine1); + var completeBtn = new Button { X = Application.GetRealWidth(86), @@ -181,8 +192,9 @@ TextColor = Shared.Common.ZigbeeColor.Current.XMWhite, Gravity = Gravity.CenterHorizontal, BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack, - Radius = 10, + Radius = (uint)Application.GetRealHeight(127 / 2), TextSize = 16, + IsBold = true, }; bottomFrameLayout.AddChidren(completeBtn); @@ -201,7 +213,8 @@ btnPasswordRemark.Text = Language.StringByID(R.MyInternationalizationString.ProximityRemark); btnPasswordRemarkContent.PlaceholderText = Language.StringByID(R.MyInternationalizationString.ProximityCard) + "-" + doorLock.doorLockProgrammingEventNotificationCommand.UserID; } - if (curAccountObj.UserName != "" && curAccountObj.UserName != null) + + if (!string.IsNullOrEmpty(curAccountObj.UserName)) { btnMatchPersonContent.Text = curAccountObj.UserName; } @@ -213,6 +226,10 @@ completeBtn.MouseDownEventHandler += async (sender, e) => { completeBtn.Enable = false; + if (doorLock.doorLockProgrammingEventNotificationCommand == null) + { + return; + } var addLockInfo = new ZigBee.Device.DoorLock.AddDoorLockData(); if (UserCenterResourse.UserInfo.AuthorityNo != 1) { @@ -228,7 +245,7 @@ addLockInfo.OpenLockMode = doorLock.doorLockProgrammingEventNotificationCommand.ProgramEventSoure; addLockInfo.DoorLockLocalUserId = doorLock.doorLockProgrammingEventNotificationCommand.UserID.ToString(); addLockInfo.EntryTime = System.DateTime.Now; - if (btnPasswordRemarkContent.Text != "") + if (!string.IsNullOrEmpty(btnPasswordRemarkContent.Text)) { addLockInfo.UserIdRemarks = btnPasswordRemarkContent.Text; } @@ -246,44 +263,52 @@ { if (doorLock.localDoorLockUserList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID)) { - //瀛樿处鎴蜂俊鎭� - // var resultList1 = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalAccountlist(doorLock, curAccountObj.SubAccountDistributedMark); //瀛橀棬閿佷俊鎭� var resultList = await Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetCloudLocalDoorLocklist(doorLock, curAccountObj.SubAccountDistributedMark); - if (resultList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID) == true) + if (resultList != null) { - var a = resultList[doorLock.doorLockProgrammingEventNotificationCommand.UserID]; - if (a?.ConnectedAccount == curAccountObj.SubAccountDistributedMark) + if (resultList.ContainsKey(doorLock.doorLockProgrammingEventNotificationCommand.UserID) == true) { - completeBtn.Enable = true; - this.RemoveFromParent(); - for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--) + var a = resultList[doorLock.doorLockProgrammingEventNotificationCommand.UserID]; + if (a?.ConnectedAccount == curAccountObj.SubAccountDistributedMark) { - var form = UserView.HomePage.Instance.GetChildren(i); + completeBtn.Enable = true; + this.RemoveFromParent(); + for (int i = UserView.HomePage.Instance.ChildrenCount - 1; i >= 0; i--) + { + var form = UserView.HomePage.Instance.GetChildren(i); - if (form is UnLockMethod) - { - ((UnLockMethod)form).RefreshList(); - break; - } - else - { - form.RemoveFromParent(); + if (form is UnLockMethod) + { + doorLock.currentUserDisplayMethod = ""; + ((UnLockMethod)form).RefreshList(); + break; + } + else + { + form.RemoveFromParent(); + } } } - } - else - { - completeBtn.Enable = true; - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); + else + { + completeBtn.Enable = true; + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); + } } } + else + { + completeBtn.Enable = true; + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.CloudServerResponseOvertime), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); + } + } } else { completeBtn.Enable = true; - new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.ModigfyFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); + new Tip() { MaxWidth = 150, Text = Language.StringByID(R.MyInternationalizationString.AddFailed), Direction = AMPopTipDirection.Up, CloseTime = 1 }.Show(btnPasswordRemarkContent); } } else -- Gitblit v1.8.0