From 351bdda734832d821a9764b0cde8be5d83c4ec50 Mon Sep 17 00:00:00 2001 From: wjc <1243177876@qq.com> Date: 星期四, 01 十二月 2022 09:56:25 +0800 Subject: [PATCH] 2022年12月01日09:56:23 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/NumberPswInputDialogForm.cs | 105 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 105 insertions(+), 0 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/NumberPswInputDialogForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/NumberPswInputDialogForm.cs new file mode 100644 index 0000000..f561f58 --- /dev/null +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/NumberPswInputDialogForm.cs @@ -0,0 +1,105 @@ +锘縰sing System; +using System.Collections.Generic; +using System.Text; + +namespace Shared.Phone.UserCenter +{ + /// <summary> + /// 鏁板瓧琛ㄧ洏瀵嗙爜杈撳叆鐨勫脊绐楃晫闈� + /// </summary> + public class NumberPswInputDialogForm : DialogCommonForm + { + #region 鈻� 鍙橀噺澹版槑___________________________ + + /// <summary> + /// 杈撳叆缁撴潫浜嬩欢 + /// </summary> + public Action<string> FinishInputEvent = null; + /// <summary> + /// 瀵嗙爜杈撳叆鎺т欢 + /// </summary> + private PswNumberInputControl pswControl = null; + + #endregion + + #region 鈻� 鍒濆鍖朹____________________________ + + /// <summary> + /// 鐢婚潰鏄剧ず(搴曞眰浼氬浐瀹氳皟鐢ㄦ鏂规硶锛屽�熶互瀹屾垚鐢婚潰鍒涘缓) + /// </summary> + /// <param name="i_PasswordText">鏍囬鎻愮ず</param> + /// <param name="i_pswLenth">瀵嗙爜闀垮害</param> + public void ShowForm(string i_PasswordText, int i_pswLenth) + { + //鍒濆鍖栦腑閮ㄤ俊鎭� + this.InitMiddleFrame(i_PasswordText, i_pswLenth); + } + + /// <summary> + /// 鍒濆鍖栦腑閮ㄤ俊鎭� + /// </summary> + /// <param name="i_PasswordText">鏍囬鎻愮ず</param> + /// <param name="i_pswLenth">瀵嗙爜闀垮害</param> + private void InitMiddleFrame(string i_PasswordText, int i_pswLenth) + { + var frameBack = new FrameLayout(); + frameBack.Y = Application.GetRealHeight(160); + frameBack.Gravity = Gravity.CenterHorizontal; + frameBack.Width = Application.GetRealWidth(965); + frameBack.Height = Application.GetRealHeight(1584); + frameBack.BackgroundColor = UserCenterColor.Current.White; + frameBack.Radius = (uint)Application.GetRealHeight(17); + bodyFrameLayout.AddChidren(frameBack); + + //瀵嗙爜杈撳叆鎺т欢 + this.pswControl = new PswNumberInputControl(i_PasswordText, i_pswLenth); + pswControl.Gravity = Gravity.CenterHorizontal; + pswControl.Y = Application.GetRealHeight(81); + frameBack.AddChidren(pswControl); + pswControl.InitControl(); + //鏀瑰彉鍒犻櫎鎸夐挳鐨勫潗鏍� + pswControl.ChangedDeleteButtonPoint(-1, pswControl.Height, false); + //娣诲姞鍏抽棴鎸夐挳 + var btnClose = pswControl.AddCloseButton(); + btnClose.ButtonClickEvent += (sender, e) => + { + this.CloseForm(); + }; + pswControl.FinishInputEvent += (strPsw) => + { + this.FinishInputEvent?.Invoke(strPsw); + }; + } + + #endregion + + #region 鈻� 涓�鑸柟娉昣__________________________ + + /// <summary> + /// 璁剧疆閿欒淇℃伅 + /// </summary> + /// <param name="i_Msg"></param> + public void SetErrorMsg(string i_Msg) + { + this.pswControl?.SetErrorMsg(i_Msg); + } + + #endregion + + #region 鈻� 鐣岄潰鍏抽棴___________________________ + + /// <summary> + /// 鐣岄潰鍏抽棴 + /// </summary> + public override void CloseFormBefore() + { + //鍙栨秷浜嬩欢 + this.FinishInputEvent = null; + this.pswControl = null; + + base.CloseFormBefore(); + } + + #endregion + } +} -- Gitblit v1.8.0