| | |
| | | /// <summary>
|
| | | /// 添加胁迫联系人
|
| | | /// </summary>
|
| | | public class AddCoerceContactForm : UserCenterCommonForm
|
| | | public class AddCoerceContactForm : EditorCommonForm
|
| | | {
|
| | | /// <summary>
|
| | | /// 信息提示控件
|
| | | /// </summary>
|
| | | private ViewNormalControl txtMsg = null; |
| | | private NormalViewControl txtMsg = null;
|
| | | /// <summary>
|
| | | /// 电话列表
|
| | | /// </summary> |
| | | private List<Safeguard.PushTargetInfo> listPhoneData = null; |
| | | |
| | | /// </summary>
|
| | | private List<Safeguard.PushTargetInfo> listPhoneData = null;
|
| | |
|
| | | /// <summary>
|
| | | /// 画面显示(底层会固定调用此方法,借以完成画面创建)
|
| | | /// </summary>
|
| | | /// <param name="listData"></param> |
| | | public void ShowForm(List<Safeguard.PushTargetInfo> listData) |
| | | { |
| | | this.listPhoneData = listData; |
| | | |
| | | //设置头部信息 |
| | | /// <param name="listData"></param>
|
| | | public void ShowForm(List<Safeguard.PushTargetInfo> listData)
|
| | | {
|
| | | this.listPhoneData = listData;
|
| | |
|
| | | //设置头部信息
|
| | | base.SetTitleText(Language.StringByID(R.MyInternationalizationString.uAddContactPersion));
|
| | |
|
| | | //初始化中部信息
|
| | | this.InitMiddleFrame(); |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 初始化中部信息 |
| | | /// </summary> |
| | | private void InitMiddleFrame() |
| | | this.InitMiddleFrame();
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 初始化中部信息
|
| | | /// </summary>
|
| | | private void InitMiddleFrame()
|
| | | {
|
| | | //清空bodyFrame
|
| | | this.ClearBodyFrame();
|
| | |
|
| | | var row = new RowLayout();
|
| | | row.Height = ControlCommonResourse.ListViewRowHeight;
|
| | | bodyFrameLayout.AddChidren(row);
|
| | |
|
| | | //联系电话
|
| | | var txtPhone = new PhoneAreaControl();
|
| | | txtPhone.Gravity = Gravity.CenterVertical;
|
| | | row.AddChidren(txtPhone);
|
| | | txtPhone.InitControl(this);
|
| | | txtPhone.txtPhone.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputContactWay);
|
| | | //var txtPhone = new PhoneAreaControl();
|
| | | //txtPhone.Gravity = Gravity.CenterVertical;
|
| | | //row.AddChidren(txtPhone);
|
| | | //txtPhone.InitControl(this);
|
| | | //txtPhone.txtPhone.PlaceholderText = Language.StringByID(R.MyInternationalizationString.uPleaseInputContactWay);
|
| | |
|
| | | //提示信息
|
| | | this.txtMsg = new ViewNormalControl(800, true);
|
| | | this.txtMsg = new NormalViewControl(800, true);
|
| | | txtMsg.X = ControlCommonResourse.XXLeft;
|
| | | txtMsg.Y = row.Bottom + Application.GetRealHeight(5);
|
| | | txtMsg.TextColor = UserCenterColor.Current.Red;
|
| | | bodyFrameLayout.AddChidren(txtMsg);
|
| | |
|
| | | //完成
|
| | | var btnfinish = new TopLayoutFinshView();
|
| | | topFrameLayout.AddChidren(btnfinish); |
| | | btnfinish.MouseUpEventHandler += (sender, e) => |
| | | {
|
| | | //执行保存手机操作
|
| | | this.SavePhoneNumber(txtPhone.AreaCode, txtPhone.PhoneNumber);
|
| | | };
|
| | | } |
| | | |
| | | //var btnfinish = new TopLayoutFinshView();
|
| | | //topFrameLayout.AddChidren(btnfinish);
|
| | | //btnfinish.MouseUpEventHandler += (sender, e) =>
|
| | | //{
|
| | | // //执行保存手机操作
|
| | | // this.SavePhoneNumber(txtPhone.AreaCode, txtPhone.PhoneNumber);
|
| | | //};
|
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 执行保存手机操作
|
| | | /// </summary> |
| | | /// </summary>
|
| | | private void SavePhoneNumber(string areaCode, string phoneNum)
|
| | | {
|
| | | //手机号检测
|
| | |
| | |
|
| | | //变更联系人方式
|
| | | this.ChangedCoercePhoneNumber(areaCode, phoneNum);
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 变更联系人方式
|
| | | /// </summary>
|
| | | /// <param name="areaCode"></param> |
| | | /// <param name="phoneNum"></param> |
| | | /// <param name="areaCode"></param>
|
| | | /// <param name="phoneNum"></param>
|
| | | private async void ChangedCoercePhoneNumber(string areaCode, string phoneNum)
|
| | | {
|
| | | Dictionary<string, string> dicPhone = new Dictionary<string, string>();
|
| | | dicPhone[phoneNum] = areaCode;
|
| | |
|
| | | //变更
|
| | | var result = await Common.LocalSafeguard.Current.SetCoercePhoneNumber(dicPhone);
|
| | | var result = await HdlSafeguardLogic.Current.SetCoercePhoneNumber(dicPhone);
|
| | | if (result == false)
|
| | | {
|
| | | return;
|
| | |
| | |
|
| | | this.CloseForm();
|
| | | });
|
| | | } |
| | | |
| | | }
|
| | |
|
| | | /// <summary>
|
| | | /// 检测手机号
|
| | | /// </summary>
|
| | | /// <param name="areaCode"></param>
|
| | | /// <param name="phone"></param> |
| | | /// <param name="phone"></param>
|
| | | private bool CheckPhoneNumber(string areaCode, string phone)
|
| | | {
|
| | | //输入为空
|
| | |
| | | }
|
| | |
|
| | | //检测手机号格式
|
| | | if (UserCenterLogic.CheckPhoneNumber(phone, areaCode) == false)
|
| | | if (HdlCheckLogic.Current.CheckPhoneNumber(phone, areaCode) == false)
|
| | | {
|
| | | //这不是一个有效的手机号
|
| | | txtMsg.Text = Language.StringByID(R.MyInternationalizationString.uThisIsNotPhoneNumberType);
|