黄学彪
2020-12-17 9f326f4000847e6167d8166fa2f6a66f53cb3734
ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
@@ -13,6 +13,10 @@
        #region ■ 变量声明___________________________
        /// <summary>
        /// 添加联系方式的事件
        /// </summary>
        public Action AddPhoneEvent = null;
        /// <summary>
        /// 信息提示控件
        /// </summary>
        private NormalViewControl btnErrorMsg = null;
@@ -44,6 +48,10 @@
            {
                Contacts.ContactAction = (phoneName, phoneNum) =>
                {
                    if (string.IsNullOrEmpty(phoneName) == true)
                    {
                        return;
                    }
                    //手机号检测
                    if (this.CheckPhoneNumber("86", phoneNum, phoneName) == false)
                    {
@@ -57,6 +65,13 @@
            //初始化中部信息
            this.InitMiddleFrame();
            //重写底层返回按键事件
            this.BackButtonClickEvent = (sender) =>
            {
                this.AddPhoneEvent = null;
                this.CloseForm();
            };
        }
        /// <summary>
@@ -74,21 +89,22 @@
            //地区码
            var btnArea = new NormalViewControl(127, 60, true);
            btnArea.X = ControlCommonResourse.XXLeft;
            btnArea.X = HdlControlResourse.XXLeft;
            btnArea.Y = Application.GetRealHeight(57);
            btnArea.Text = "+86";
            btnArea.TextAlignment = TextAlignment.Center;
            btnArea.TextColor = UserCenterColor.Current.TextGrayColor1;
            frameBack.AddChidren(btnArea);
            btnArea.ButtonClickEvent += (sender, e) =>
            {
                var form = new AreaCodeSelectForm();
                form.AddForm();
                form.FinishSelectEvent += (code) =>
                {
                    btnArea.Text = "+" + code;
                };
            };
            //目前只针对+86
            //btnArea.ButtonClickEvent += (sender, e) =>
            //{
            //    var form = new AreaCodeSelectForm();
            //    form.AddForm();
            //    form.FinishSelectEvent += (code) =>
            //    {
            //        btnArea.Text = "+" + code;
            //    };
            //};
            //电话输入框
            var txtPhone = new TextInputControl(Application.GetRealWidth(634), btnArea.Height, false);
            txtPhone.X = btnArea.Right + Application.GetRealWidth(35);
@@ -107,17 +123,19 @@
                txtPhone.Text = string.Empty;
            };
            //线
            var btnLine = new NormalViewControl(Application.GetRealWidth(965), ControlCommonResourse.BottomLineHeight, false);
            var btnLine = new NormalViewControl(Application.GetRealWidth(965), HdlControlResourse.BottomLineHeight, false);
            btnLine.BackgroundColor = UserCenterColor.Current.ButtomLine;
            btnLine.Y = Application.GetRealHeight(150);
            btnLine.Gravity = Gravity.CenterHorizontal;
            frameBack.AddChidren(btnLine);
            //联动线的状态
            txtPhone.btnLine = btnLine;
            //备注
            var txtNote = new TextInputControl(Application.GetRealWidth(740), txtPhone.Height, false);
            txtNote.X = ControlCommonResourse.XXLeft;
            txtNote.X = HdlControlResourse.XXLeft;
            txtNote.Y = btnLine.Bottom + Application.GetRealHeight(60);
            txtNote.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackup);
            txtNote.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
            frameBack.AddChidren(txtNote);
            //取消图标
            var btnCancel2 = new MostRightIconControl(69, 69);
@@ -133,7 +151,7 @@
            //信息提示
            this.btnErrorMsg = new NormalViewControl(bodyFrameLayout.Width, Application.GetRealHeight(60), false);
            btnErrorMsg.X = ControlCommonResourse.XXLeft;
            btnErrorMsg.X = HdlControlResourse.XXLeft;
            btnErrorMsg.Y = frameBack.Bottom + Application.GetRealHeight(29);
            btnErrorMsg.TextColor = 0xfff75858;
            btnErrorMsg.TextSize = 12;
@@ -179,6 +197,10 @@
                return;
            }
            this.CloseForm();
            //调用回调函数
            this.AddPhoneEvent?.Invoke();
            this.AddPhoneEvent = null;
        }
        #endregion
@@ -202,8 +224,8 @@
            }
            if (strNote == string.Empty)
            {
                //请输入备注名称
                btnErrorMsg.Text = Language.StringByID(R.MyInternationalizationString.uPleaseInpuBackup);
                //请输入备注内容
                btnErrorMsg.Text = Language.StringByID(R.MyInternationalizationString.uPlesaeInputNoteInformation);
                return false;
            }
@@ -230,13 +252,5 @@
        }
        #endregion
    }
}