From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001 From: hxb <hxb@hdlchina.com.cn> Date: 星期二, 30 八月 2022 09:37:38 +0800 Subject: [PATCH] 合并了IOS的代码 --- ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs | 107 ++++++++++++++++++++++++++--------------------------- 1 files changed, 53 insertions(+), 54 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs index b48a58d..b261f23 100755 --- a/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/DoorLock/TemporaryPassword.cs @@ -95,11 +95,11 @@ }; btnDelFrameLayout.MouseDownEventHandler += eHandler; btnDelIcon.MouseDownEventHandler += eHandler; - #endregion + #endregion MidTopFrameLayout = new FrameLayout() { - X = Application.GetRealWidth(181), - Y = Application.GetRealHeight(92), + X = Application.GetMinRealAverage(181), + Y = Application.GetMinRealAverage(92), Width = Application.GetRealWidth(717), Height = Application.GetRealHeight(570), BackgroundImagePath = "DoorLock/TempPasswordBackground.png", @@ -118,7 +118,7 @@ { Height = Application.GetRealHeight(43), Width = Application.GetRealWidth(259), - X = Application.GetRealWidth(230), + X = Application.GetRealWidth(227), Y = Application.GetRealHeight(418), UnSelectedImagePath = "DoorLock/TempPasswordBackground1.png", }; @@ -168,23 +168,23 @@ var validTime = new Button() { Height = Application.GetRealHeight(55), - Width = Application.GetRealWidth(92 + 115), + Width = Application.GetRealWidth(207), Y = Application.GetRealHeight(386), TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, TextAlignment = TextAlignment.CenterRight, TextSize = 16, - Text = "--:--", + Text = "--:--", }; MidTopFrameLayout.AddChidren(validTime); var validTimeDate = new Button() { Height = Application.GetRealHeight(49), - Width = Application.GetRealWidth(84 + 135), + Width = Application.GetRealWidth(208), Y = Application.GetRealHeight(441), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextSize = 12, - TextAlignment = TextAlignment.CenterRight, + TextAlignment = TextAlignment.CenterRight, }; MidTopFrameLayout.AddChidren(validTimeDate); @@ -193,11 +193,11 @@ Height = Application.GetRealHeight(55), Width = Application.GetRealWidth(717 - 507), X = Application.GetRealWidth(507), - Y = Application.GetRealHeight(389), + Y = Application.GetRealHeight(386), TextColor = Shared.Common.ZigbeeColor.Current.XMGray2, TextAlignment = TextAlignment.CenterLeft, TextSize = 16, - Text = "--:--", + Text = "--:--", }; MidTopFrameLayout.AddChidren(inValidTime); @@ -206,10 +206,10 @@ Height = Application.GetRealHeight(49), Width = Application.GetRealWidth(717 - 508), X = Application.GetRealWidth(508), - Y = Application.GetRealHeight(444), + Y = Application.GetRealHeight(441), TextColor = Shared.Common.ZigbeeColor.Current.XMGray3, TextAlignment = TextAlignment.CenterLeft, - TextSize = 12, + TextSize = 12, }; MidTopFrameLayout.AddChidren(inValidTimeDate); @@ -217,20 +217,7 @@ #region 鏁版嵁澶勭悊 TimeDisplay(validTime, validTimeDate, inValidTime, inValidTimeDate, false); - if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify) - { - btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; - btnFinifh.Enable = true; - topPic.Visible = true; - topPic.Enable = true; - } - else - { - btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; - btnFinifh.Enable = false; - topPic.Visible = false; - topPic.Enable = false; - } + if (string.IsNullOrEmpty(doorLock.LocalTempPassword)) { randomPassword.Text = "- - - - - -"; @@ -258,21 +245,36 @@ } } - temPasswordVisiable.MouseUpEventHandler += (sender, e) => + if (Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.IsModify) { - temPasswordVisiable.IsSelected = !temPasswordVisiable.IsSelected; - if (!temPasswordVisiable.IsSelected) - { - randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMGray4; - randomPassword.SecureTextEntry = true; - } - else - { - randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMOrange; - randomPassword.SecureTextEntry = false; - } - Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable = !randomPassword.SecureTextEntry; - }; + btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMBlack; + btnFinifh.Enable = true; + topPic.Visible = true; + topPic.Enable = true; + } + else + { + btnFinifh.BackgroundColor = Shared.Common.ZigbeeColor.Current.XMUnSelect; + btnFinifh.Enable = false; + topPic.Visible = false; + topPic.Enable = false; + } + + temPasswordVisiable.MouseUpEventHandler += (sender, e) => + { + temPasswordVisiable.IsSelected = !temPasswordVisiable.IsSelected; + if (!temPasswordVisiable.IsSelected) + { + randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMGray4; + randomPassword.SecureTextEntry = true; + } + else + { + randomPassword.TextColor = Shared.Common.ZigbeeColor.Current.XMOrange; + randomPassword.SecureTextEntry = false; + } + Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.InTempPasswordVisiable = !randomPassword.SecureTextEntry; + }; topPic.MouseUpEventHandler += (sender, e) => { randomPassword.Text = Shared.Phone.UserCenter.DoorLock.DoorLockCommonInfo.GetTempPassword(); @@ -570,15 +572,14 @@ if (doorLock.tempPasswordObject != null) { var addDoorLockTempPasswordData = new ZigBee.Device.DoorLock.AddDoorLockTempPasswordData(); - if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1) + if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //鈽嗐優銉笺偗鈽� - //addDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + addDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); addDoorLockTempPasswordData.IsOtherAccountCtrl = true; } //瀵瑰瘑鐮佽繘琛屽姞瀵嗗鐞� string hdlKey = "hD1(La3o"; - var enPsw = HdlCommonLogic.Current.EncryptPassword(hdlKey, doorLock.tempPasswordObject.TempPassword); + var enPsw = UserCenterLogic.EncryptPassword(hdlKey, doorLock.tempPasswordObject.TempPassword); addDoorLockTempPasswordData.TempPwd = enPsw; if (doorLock.DeviceAddr != null) { @@ -598,7 +599,7 @@ }); return; } - if (result1.Code != HttpMessageEnum.A鎴愬姛) + if (result1.StateCode != "Success") { Application.RunOnMainThread(() => { @@ -709,7 +710,7 @@ { dialog.Close(); string msg = Language.StringByID(R.MyInternationalizationString.SureToDeleteTempPassword); - var alert = new ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); + var alert = new Shared.Phone.UserCenter.ShowMsgControl(ShowMsgType.Confirm, msg, Language.StringByID(R.MyInternationalizationString.DoorlockConfirm)); alert.Show(); //浣跨敤纭鍨嬪脊妗嗘椂,鐨勫洖璋冨嚱鏁� alert.ConfirmClickEvent += () => @@ -744,10 +745,9 @@ if (resultData.defaultControlResponseData.status == 0 || resultData.defaultControlResponseData.status == 2) { var delDoorLockTempPasswordData = new ZigBee.Device.DoorLock.DelDoorLockTempPasswordData(); - if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1) + if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //鈽嗐優銉笺偗鈽� - //delDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + delDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); delDoorLockTempPasswordData.IsOtherAccountCtrl = true; } if (doorLock.DeviceAddr != null) @@ -757,7 +757,7 @@ var result1 = await ZigBee.Device.DoorLock.SendDoorLockToServer("DoorLock/DelDoorLockPwd", delDoorLockTempPasswordData); if (result1 != null) { - if (result1.Code == HttpMessageEnum.A鎴愬姛) + if (result1.StateCode == "Success") { doorLock.tempPasswordObject = null; doorLock.LocalTempPassword = ""; @@ -822,10 +822,9 @@ try { var getDoorLockTempPasswordData = new ZigBee.Device.DoorLock.GetDoorLockTempPasswordData(); - if (HdlUserCenterResourse.ResidenceOption.AuthorityNo != 1) + if (UserCenterResourse.UserInfo.AuthorityNo != 1) { - //鈽嗐優銉笺偗鈽� - //getDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); + getDoorLockTempPasswordData.LoginAccessToken = UserCenterLogic.GetConnectMainToken(); getDoorLockTempPasswordData.IsOtherAccountCtrl = true; } if (doorLock.DeviceAddr != null) @@ -845,7 +844,7 @@ tpObj.InValidTime = curDoorLockTempPaw.ValidEndTime; //瑙e瘑瀵嗙爜 string hdlKey = "hD1(La3o"; - var desPsw = HdlCommonLogic.Current.DecryptPassword(hdlKey, curDoorLockTempPaw.TempPwd); + var desPsw = UserCenterLogic.DecryptPassword(hdlKey, curDoorLockTempPaw.TempPwd); doorLock.LocalTempPassword = tpObj.TempPassword = desPsw; doorLock.tempPasswordObject = tpObj; TimeDateData(doorLock.tempPasswordObject.ValidTime, doorLock.tempPasswordObject.InValidTime); -- Gitblit v1.8.0