gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswAddContactForm.cs
@@ -42,6 +42,21 @@
            btnIcon.InitControl();
            btnIcon.ButtonClickEvent += ((sender, e) =>
            {
                Contacts.ContactAction = (phoneName, phoneNum) =>
                {
                    if (string.IsNullOrEmpty(phoneName) == true)
                    {
                        return;
                    }
                    //手机号检测
                    if (this.CheckPhoneNumber("86", phoneNum, phoneName) == false)
                    {
                        return;
                    }
                    //保存联系人
                    this.SaveCoercePhoneNumber("86", phoneNum, phoneName);
                };
                Contacts.Open();
            });
            //初始化中部信息
@@ -101,6 +116,8 @@
            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);
@@ -153,13 +170,16 @@
        /// </summary>
        /// <param name="areaCode"></param>
        /// <param name="phoneNum"></param>
        /// <param name="strNote"></param>
        private async void SaveCoercePhoneNumber(string areaCode, string phoneNum, string strNote)
        {
            Dictionary<string, string> dicPhone = new Dictionary<string, string>();
            dicPhone[phoneNum] = areaCode;
            var listPhone = new List<string>();
            listPhone.Add(areaCode + "-" + phoneNum);
            var listNote = new List<string>();
            listNote.Add(strNote);
            //变更
            var result = await HdlSafeguardLogic.Current.SetCoercePhoneNumber(dicPhone);
            var result = await HdlSafeguardLogic.Current.SetCoercePhoneNumber(listPhone, listNote);
            if (result == false)
            {
                return;