gxc
2020-02-28 66a9965c44ecc32a6696abca876ab9d1cd091584
ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
@@ -27,6 +27,10 @@
        /// 列表的桌布控件
        /// </summary>
        private FrameLayout frameTable = null;
        /// <summary>
        /// 当前的联系人列表
        /// </summary>
        private List<ZigBee.Device.Safeguard.PushTargetInfo> listPhoneData = null;
        #endregion
@@ -82,6 +86,7 @@
            btnPassword.TextSize = 24;
            btnPassword.TextColor = 0xfffc744b;
            btnPassword.Text = i_password;
            btnPassword.IsBold = true;
            frameback.AddChidren(btnPassword);
            //初始化列表控件
@@ -150,7 +155,7 @@
                HdlThreadLogic.Current.RunMain(() =>
                {
                    var listPhoneData = new List<ZigBee.Device.Safeguard.PushTargetInfo>();
                    this.listPhoneData = new List<ZigBee.Device.Safeguard.PushTargetInfo>();
                    //联系人
                    var rowContact = new FrameRowControl(listview.rowSpace / 2);
                    rowContact.UseClickStatu = false;
@@ -193,11 +198,32 @@
        /// <param name="data"></param>
        private void AddPhoneNumRowLayout(VerticalListControl listview, ZigBee.Device.Safeguard.PushTargetInfo data)
        {
            var strArry = data.PushNumber.Split(new string[] { "-" }, StringSplitOptions.RemoveEmptyEntries);
            if (strArry.Length != 2)
            {
                return;
            }
            string areaCode2 = strArry[0];
            string phoneNum = strArry[1];
            string strPhone = "+" + areaCode2 + " " + phoneNum;
            if (phoneNum.Length >= 11)
            {
                phoneNum = phoneNum.Substring(0, 3) + "".PadLeft(phoneNum.Length - 7, '*') + phoneNum.Substring(phoneNum.Length - 4, 4);
                strPhone = "+" + areaCode2 + " " + phoneNum;
            }
            else if (phoneNum.Length >= 5)
            {
                //或许这是国外的手机吧
                phoneNum = phoneNum.Substring(0, 3) + "".PadLeft(phoneNum.Length - 5, '*') + phoneNum.Substring(phoneNum.Length - 2, 2);
                strPhone = "+" + areaCode2 + " " + phoneNum;
            }
            var rowContact = new RowLayoutControl();
            rowContact.frameTable.UseClickStatu = false;
            listview.AddChidren(rowContact);
            //联系方式
            rowContact.frameTable.AddLeftCaption("+" + data.PushNumber.Replace("-", " "), 800);
            rowContact.frameTable.AddLeftCaption(strPhone + " (" + data.PushNumberNote + ")", 800);
            rowContact.frameTable.AddBottomLine();
            //删除
            var btnDetete = rowContact.AddDeleteControl();
@@ -236,6 +262,16 @@
            if (result == true)
            {
                rowContact.RemoveFromParent();
                //移除缓存
                string checkKeys = areaCode + "-" + phone;
                for (int i = 0; i < this.listPhoneData.Count; i++)
                {
                    if (listPhoneData[i].PushNumber == checkKeys)
                    {
                        listPhoneData.RemoveAt(i);
                    }
                }
            }
        }