From 49248e3bdff0458f8f6f4156d1425bd6f6074e32 Mon Sep 17 00:00:00 2001 From: lss <lsc@hdlchina.com.cn> Date: 星期二, 17 五月 2022 13:17:21 +0800 Subject: [PATCH] Merge branch 'dev' into lss --- HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockUnlockPage.cs | 193 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 193 insertions(+), 0 deletions(-) diff --git a/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockUnlockPage.cs b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockUnlockPage.cs new file mode 100644 index 0000000..357373a --- /dev/null +++ b/HDL_ON/UI/UI2/FuntionControlView/DoorLock/DoorLockUnlockPage.cs @@ -0,0 +1,193 @@ +锘縰sing System; +using HDL_ON.DriverLayer; +using HDL_ON.Entity; +using HDL_ON.Stan; +using HDL_ON.UI.CSS; +using Shared; +namespace HDL_ON.UI +{ + public class DoorLockUnlockPage : FrameLayout + { + /// <summary> + /// 褰撳墠鐣岄潰 + /// </summary> + FrameLayout bodyView; + + Function device; + + public DoorLockUnlockPage(Function function) + { + bodyView = this; + device = function; + } + + /// <summary> + /// 鍔犺浇瑙嗗浘 + /// </summary> + public void LoadView() + { + + new TopViewDiv(bodyView, Language.StringByID(StringId.PlsEntryPassword)).LoadTopView(); + bodyView.BackgroundColor = CSS_Color.MainBackgroundColor; + + + var btnMsg = new Button() + { + Gravity = Gravity.CenterHorizontal, + Y = Application.GetRealHeight(100), + Width = Application.GetRealWidth(300), + Height = Application.GetRealHeight(100), + TextAlignment = TextAlignment.TopCenter, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.TextFontSize, + TextID = StringId.DoorLockEntryPasswordTip, + IsMoreLines = true, + }; + bodyView.AddChidren(btnMsg); + + #region 瀵嗙爜濉啓 + var passwordView = new FrameLayout() + { + X = Application.GetRealWidth(28), + Y = Application.GetRealHeight(200), + Width = Application.GetRealWidth(319), + Height = Application.GetRealHeight(44), + }; + bodyView.AddChidren(passwordView); + + + var etPassword = new EditText() + { + TextColor = CSS_Color.FirstLevelTitleColor, + TextSize = CSS_FontSize.TextFontSize, + PlaceholderTextColor = CSS_Color.PromptingColor1, + PlaceholderText = Language.StringByID(StringId.PlsEntryPassword), + SecureTextEntry = true, + TextAlignment = TextAlignment.Center, + BackgroundColor = CSS_Color.BackgroundColor, + IsNumberKeyboardType = true + }; + passwordView.AddChidren(etPassword); + + //var btnVisiblePassword = new Button() + //{ + // X = Application.GetRealWidth(273), + // Gravity = Gravity.CenterVertical, + // Width = Application.GetMinRealAverage(20), + // Height = Application.GetMinRealAverage(20), + // UnSelectedImagePath = "LoginIcon/HidePasswordIcon.png", + // SelectedImagePath = "LoginIcon/ShowPasswordIcon.png", + //}; + //passwordView.AddChidren(btnVisiblePassword); + + #endregion + + + + var frameRow = new FrameLayout() + { + Height = Application.GetRealHeight(28), + Y = Application.GetRealHeight(258),//375 // 667 + }; + bodyView.AddChidren(frameRow); + + //鍚屾剰鎸夐挳鑳屾櫙 + var agreeView = new FrameLayout() + { + Height = Application.GetRealHeight(28), + Width = Application.GetRealWidth(28), + X = Application.GetRealWidth(22), + }; + frameRow.AddChidren(agreeView); + + //鍚屾剰鍥炬爣鎸夐挳 + var agreeBtn = new Button() + { + Width = Application.GetMinRealAverage(28), + Height = Application.GetMinRealAverage(28), + UnSelectedImagePath = "Public/ChooseIcon.png", + SelectedImagePath = "Public/ChooseOnIcon.png", + IsSelected = false, + Gravity = Gravity.Center, + }; + agreeView.AddChidren(agreeBtn); + + var agreeTextBtn = new TextButton() + { + X = agreeView.Right, + Width = Application.GetRealWidth(28), + Height = Application.GetRealHeight(28), + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.PromptFontSize_FirstLevel, + TextID = StringId.DoorLock5minTip + }; + frameRow.AddChidren(agreeTextBtn); + agreeTextBtn.Width = Utlis.GetRealWidthByTextButton(agreeTextBtn); + + EventHandler<MouseEventArgs> eventHandler = (sender, e) => + { + agreeBtn.IsSelected = !agreeBtn.IsSelected; + }; + + agreeBtn.MouseUpEventHandler = eventHandler; + agreeView.MouseUpEventHandler = eventHandler; + agreeTextBtn.MouseUpEventHandler = eventHandler; + + + Button btnLine = new Button() + { + Y = Application.GetRealHeight(607), + Height = Application.GetRealHeight(1), + BackgroundColor = CSS.CSS_Color.DividingLineColor, + }; + bodyView.AddChidren(btnLine); + + Button btnCancel = new Button() + { + Y = btnLine.Bottom, + Width = Application.GetRealWidth(374/2), + Height = Application.GetRealHeight(60), + TextAlignment = TextAlignment.Center, + TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextID = StringId.Cancel, + }; + bodyView.AddChidren(btnCancel); + btnCancel.MouseUpEventHandler = (sender, e) => { + this.RemoveFromParent(); + }; + + Button btnConfirm = new Button() + { + X = btnCancel.Right, + Y = btnLine.Y, + Width = Application.GetRealWidth(376 / 2), + Height = Application.GetRealHeight(60), + TextAlignment = TextAlignment.Center, + //TextColor = CSS_Color.TextualColor, + TextSize = CSS_FontSize.SubheadingFontSize, + TextColor = CSS_Color.MainBackgroundColor, + BackgroundColor = CSS_Color.MainColor, + TextID = StringId.Confirm, + }; + bodyView.AddChidren(btnConfirm); + btnConfirm.MouseUpEventHandler = (sender, e) => { + var password = etPassword.Text.Trim(); + if (password.Length == 0) + { + //璁惧涓嶅湪绾� + HdlMessageLogic.Current.ShowMassage(ShowMsgType.TipRemind, Language.StringByID(StringId.PlsEntryPassword), null, null, null, 2); + return; + } + if (agreeBtn.IsSelected) + { + UserInfo.Current.doorPasswordString = password; + } + Control.Ins.OneKeyUnlocking(this.device, etPassword.Text.Trim()); + this.RemoveFromParent(); + }; + + } + + } +} \ No newline at end of file -- Gitblit v1.8.0