From 9d61367c1fd278f58f721d4c0e69999f89e4485d Mon Sep 17 00:00:00 2001
From: xm <1271024303@qq.com>
Date: 星期四, 12 十二月 2019 14:14:30 +0800
Subject: [PATCH] 添加最新绑定机制
---
ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs | 39 +++++++++++++++++++++++++++++++++++++--
1 files changed, 37 insertions(+), 2 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
old mode 100755
new mode 100644
index 8249786..4c293ab
--- a/ZigbeeApp/Shared/Phone/UserCenter/Safety/CoercePswEditorForm.cs
+++ b/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
@@ -150,7 +154,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 +197,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 +261,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);
+ }
+ }
}
}
--
Gitblit v1.8.0