From dc0309e64f02227d8e1468b7326c07955f804612 Mon Sep 17 00:00:00 2001
From: chenqiyang <1406175257@qq.com>
Date: 星期三, 22 六月 2022 11:22:18 +0800
Subject: [PATCH] 修改引用路径
---
ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs | 126 ++++++++++++++++++++++++-----------------
1 files changed, 73 insertions(+), 53 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
index 9dfbc4a..b071030 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/UserMain/MessageManagementForm.cs
@@ -19,7 +19,7 @@
/// </summary>
private VerticalFrameRefreshControl listView = null;
/// <summary>
- /// 鍏ㄩ儴鐨勮
+ /// 鍏ㄩ儴鐨勮,涓婚敭鏄嚜鍔ㄩ�掑鐨勪笢瑗�
/// </summary>
private Dictionary<string, RowLayoutControl> dicAllRow = null;
@@ -68,10 +68,10 @@
/// <summary>
/// 鍒濆鍖栦腑閮ㄤ俊鎭�
/// </summary>
- private async void InitMiddleData(bool showReload)
+ private void InitMiddleData(bool showReload)
{
//鑾峰彇鏁版嵁
- var dicData = await this.GetMessageData();
+ var dicData = this.GetMessageData();
if (dicData == null)
{
if (showReload == true)
@@ -157,7 +157,7 @@
framBack.Name = dateIndex.ToString();
framBack.Height = Application.GetRealHeight(100);
framBack.BackgroundColor = UserCenterColor.Current.White;
- listView.AddChidrenFrame(framBack);
+ listView.AddChidren(framBack);
//鏃ユ湡
string strMonth = Language.StringByID(R.MyInternationalizationString.Month);
@@ -175,8 +175,15 @@
for (int i = 0; i < listData.Count; i++)
{
- //娣诲姞淇℃伅琛�
- this.AddMsgRowControl(framBack, listData[i], i != listData.Count - 1);
+ //涓�鏉′俊鎭噷闈紝瀹冨彲鑳藉寘鍚涓姤璀�
+ for (int j = 0; j < listData[i].listMsg.Count; j++)
+ {
+ //璁剧疆宸茶鐨勫垵濮嬪��
+ listData[i].ListReading.Add(listData[i].IsReading);
+ //娣诲姞淇℃伅琛�
+ bool addLine = i != listData.Count - 1 || j != listData[i].listMsg.Count - 1;
+ this.AddMsgRowControl(framBack, listData[i], j, addLine);
+ }
}
//璋冩暣楂樺害
listView.AdjustChidrenFrameHeight(framBack, Application.GetRealHeight(23));
@@ -252,8 +259,9 @@
/// </summary>
/// <param name="frameList"></param>
/// <param name="recordInfo"></param>
+ /// <param name="msgIndex">鎶ヨ娑堟伅鐨勪笅鏍�</param>
/// <param name="addLine"></param>
- private void AddMsgRowControl(FrameListControl frameList, MessageRecordInfo recordInfo, bool addLine)
+ private void AddMsgRowControl(FrameListControl frameList, MessageRecordInfo recordInfo, int msgIndex, bool addLine)
{
var rowControl = new RowLayoutControl(frameList.rowSpace / 2);
frameList.AddChidren(rowControl);
@@ -268,24 +276,24 @@
var btnMsgObject = rowControl.frameTable.AddLeftCaption(recordInfo.MsgObjectText, 600);
//娑堟伅
- var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.MsgText, 600, 60);
+ var btnMsg = rowControl.frameTable.AddMostRightView(recordInfo.listMsg[msgIndex], 600, 60);
btnMsg.TextColor = UserCenterColor.Current.TextGrayColor3;
btnMsg.Y = Application.GetRealHeight(5) + rowControl.frameTable.chidrenYaxis;
- rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnMsg, ChidrenBindMode.BindEvent);
//鏃堕棿
var btnTime = rowControl.frameTable.AddMostRightView("", 200, 50);
btnTime.TextColor = UserCenterColor.Current.TextGrayColor1;
btnTime.Y = btnMsg.Bottom + Application.GetRealHeight(12);
var convertTime = UserCenterLogic.ConvertUtcTimeToLocalTime(recordInfo.CreatedOnUtc);
btnTime.Text = convertTime.ToString("HH锛歮m");
- rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnTime, ChidrenBindMode.BindEvent);
//搴曠嚎
if (addLine == true)
{
- rowControl.frameTable.AddBottomLine();
+ rowControl.frameTable.AddBottomLine();
}
//宸茶
- if (recordInfo.IsReading == true)
+ if (recordInfo.ListReading[msgIndex] == true)
{
rowControl.frameTable.UseClickStatu = false;
//娑堟伅绫诲瀷
@@ -298,13 +306,13 @@
//鏂版秷鎭�
PicViewControl btnNewTip = null;
- if (recordInfo.IsReading == false)
+ if (recordInfo.ListReading[msgIndex] == false)
{
btnNewTip = new PicViewControl(78, 55);
btnNewTip.UnSelectedImagePath = "Item/NewVersion.png";
btnNewTip.Y = Application.GetRealHeight(9) + rowControl.frameTable.chidrenYaxis;
btnNewTip.X = btnMsgObject.Right + Application.GetRealWidth(10);
- rowControl.frameTable.AddChidren(btnNewTip, ChidrenBindMode.BindEventOnly);
+ rowControl.frameTable.AddChidren(btnNewTip, ChidrenBindMode.BindEvent);
}
//涓昏涓讳汉鍜岀鐞嗗憳鑳藉鍒犻櫎
@@ -316,9 +324,9 @@
{
//纭鍒犻櫎娑堟伅?
string msg = Language.StringByID(R.MyInternationalizationString.uDeleteMessageMsg);
- this.ShowMassage(ShowMsgType.Confirm, msg, async () =>
+ this.ShowMassage(ShowMsgType.Confirm, msg, () =>
{
- await this.DeleteMsg(recordInfo.Id, frameList, rowControl);
+ this.DeleteMsg(recordInfo.Id, frameList, rowControl);
});
};
}
@@ -326,11 +334,11 @@
//鐐瑰嚮
rowControl.frameTable.ButtonClickEvent += async (sender, e) =>
{
- if (recordInfo.IsReading == true)
+ if (recordInfo.ListReading[msgIndex] == true)
{
return;
}
- recordInfo.IsReading = true;
+ recordInfo.ListReading[msgIndex] = true;
rowControl.frameTable.UseClickStatu = false;
//娑堟伅绫诲瀷
btnMsgObject.TextColor = UserCenterColor.Current.TextGrayColor1;
@@ -340,7 +348,7 @@
if (sender != null)
{
//鏍囪宸茶(涓嶇瀹冩垚鍔熶笉鎴愬姛)
- await this.SetTickIsRead(recordInfo.Id);
+ this.SetTickIsRead(recordInfo.Id);
}
};
}
@@ -353,12 +361,12 @@
/// 鏍囪宸茶
/// </summary>
/// <param name="strId"></param>
- private async Task<bool> SetTickIsRead(string strId)
+ private bool SetTickIsRead(string strId)
{
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.Id = strId;
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagMessageMessageCenterItem", true, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagMessageMessageCenterItem", true, pra);
return result;
}
@@ -374,7 +382,7 @@
//纭鏍囪鍏ㄩ儴娑堟伅涓哄凡璇�?
this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uUnTipAllMessageMsg), () =>
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
@@ -382,7 +390,7 @@
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.TagAllOrClearType = 0;
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
//鍏抽棴杩涘害鏉�
this.CloseProgressBar();
if (result == false)
@@ -412,12 +420,12 @@
/// <param name="strId"></param>
/// <param name="frameList"></param>
/// <param name="rowContr"></param>
- private async Task<bool> DeleteMsg(string strId, FrameListControl frameList, RowLayoutControl rowContr)
+ private bool DeleteMsg(string strId, FrameListControl frameList, RowLayoutControl rowContr)
{
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.Id = strId;
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/DelMessageCenterItem", true, pra);
if (result == false)
{
return false;
@@ -449,7 +457,7 @@
//纭鍒犻櫎鍏ㄩ儴娑堟伅?
this.ShowMassage(ShowMsgType.Confirm, Language.StringByID(R.MyInternationalizationString.uDeleteAllMessageMsg), () =>
{
- HdlThreadLogic.Current.RunThread(async () =>
+ HdlThreadLogic.Current.RunThread(() =>
{
//鎵撳紑杩涘害鏉�
this.ShowProgressBar();
@@ -457,7 +465,7 @@
var pra = new MessageReadStatuPra();
pra.LoginAccessToken = UserCenterLogic.GetConnectMainToken();
pra.TagAllOrClearType = 1;
- var result = await UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
+ var result = UserCenterLogic.GetResultStatuByRequestHttps("MessageCenter/TagAllOrClearMessageCenter", true, pra);
if (result == false)
{
//鍏抽棴杩涘害鏉�
@@ -544,7 +552,7 @@
/// 鑾峰彇娑堟伅璁板綍
/// </summary>
/// <returns></returns>
- private async Task<Dictionary<string, List<List<MessageRecordInfo>>>> GetMessageData()
+ private Dictionary<string, List<List<MessageRecordInfo>>> GetMessageData()
{
this.dicAllRow = new Dictionary<string, RowLayoutControl>();
var allListData = new List<MessageRecordInfo>();
@@ -554,7 +562,7 @@
//浼犳劅鍣ㄤ笂鎶�
pra.Topic = "/IASInfoReport";
- var dataInfo = await this.GetMessageDataFromDb(pra);
+ var dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -563,7 +571,7 @@
//闂ㄩ攣涓婃姤
pra.Topic = "/Alarms/SendAlarmInform";
- dataInfo = await this.GetMessageDataFromDb(pra);
+ dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -572,7 +580,7 @@
//鎾ら槻
pra.Topic = "/Security/WithdrawMode_Respon";
- dataInfo = await this.GetMessageDataFromDb(pra);
+ dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -581,7 +589,7 @@
//甯冮槻
pra.Topic = "/Security/EnableMode_Respon";
- dataInfo = await this.GetMessageDataFromDb(pra);
+ dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -590,7 +598,7 @@
//閫昏緫瑙﹀彂涓婃姤
pra.Topic = "/Logic/Execute_Respon";
- dataInfo = await this.GetMessageDataFromDb(pra);
+ dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -599,7 +607,7 @@
//鍦烘櫙瑙﹀彂涓婃姤
pra.Topic = "/Scene/Exec_Respon";
- dataInfo = await this.GetMessageDataFromDb(pra);
+ dataInfo = this.GetMessageDataFromDb(pra);
if (dataInfo == null)
{
return null;
@@ -615,10 +623,10 @@
/// </summary>
/// <param name="pra"></param>
/// <returns></returns>
- private async Task<List<MessageRecordInfo>> GetMessageDataFromDb(MessageInfoPra pra)
+ private List<MessageRecordInfo> GetMessageDataFromDb(MessageInfoPra pra)
{
- var result = await UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra);
- if (result == null)
+ var result = UserCenterLogic.GetResponseDataByRequestHttps("MessageCenter/GetMessageCenterPagger", true, pra);
+ if (string.IsNullOrEmpty(result) == true)
{
return null;
}
@@ -760,7 +768,8 @@
{
recordInfo.IconPath = "Device/Sensor.png";
//娑堟伅绫诲瀷:浼犳劅鍣�
- recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId1200);
+ var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("A402");
+ recordInfo.MsgObjectText = infoContent != null ? infoContent.A瀹樻柟鍚嶅瓧 : string.Empty;
}
else
{
@@ -777,19 +786,27 @@
if (info == null)
{
//闈炲湪鍐岀殑娑堟伅璁板綍
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
+ return true;
}
- else if (info.BatteryMsg != null)
+
+ if (string.IsNullOrEmpty(info.AlarmMsg) == false)
{
- recordInfo.MsgText = info.BatteryMsg;
+ recordInfo.listMsg.Add(info.AlarmMsg);
}
- else if (info.DemolishmenMsg != null)
+ if (info.BatteryMsg != null)
{
- recordInfo.MsgText = info.DemolishmenMsg;
+ recordInfo.listMsg.Add(info.BatteryMsg);
}
- else
+ if (info.DemolishmenMsg != null)
{
- recordInfo.MsgText = string.IsNullOrEmpty(info.AlarmMsg) == false ? info.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered);
+ recordInfo.listMsg.Add(info.DemolishmenMsg);
+ }
+
+ //瑙﹀彂浼犳劅鍣ㄦ姤璀�
+ if (recordInfo.listMsg.Count == 0)
+ {
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uSensorAlarmHadTriggered));
}
return true;
}
@@ -810,7 +827,8 @@
{
recordInfo.IconPath = "Device/IntelligentLocks.png";
//娑堟伅绫诲瀷:鏅鸿兘闂ㄩ攣
- recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uDeviceBelongId2800);
+ var infoContent = Common.LocalDevice.Current.GetDeviceModelIdNameInfo("A405");
+ recordInfo.MsgObjectText = infoContent != null ? infoContent.A瀹樻柟鍚嶅瓧 : string.Empty;
}
else
{
@@ -823,7 +841,8 @@
}
//娑堟伅
var msgInfo = HdlAlarmsLogic.Current.GetDoorLockAlarmInfo(receiveData);
- recordInfo.MsgText = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
+ string MsgText = msgInfo != null ? msgInfo.AlarmMsg : Language.StringByID(R.MyInternationalizationString.uDoorLocksAlarmHadTriggered);
+ recordInfo.listMsg.Add(MsgText);
}
#endregion
@@ -848,12 +867,12 @@
//绂诲甯冮槻
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uRemoveHomeGarrison);
//宸叉墽琛�
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
else
{
//宸叉墽琛�
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
//娌℃湁鍐呴儴闃插尯
if (HdlSafeguardLogic.Current.IsHadInternalDefenseArea() == false)
{
@@ -891,7 +910,7 @@
if (data.Result == 0)
{
//宸叉墽琛�
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
//鎾ら槻
recordInfo.MsgObjectText = Language.StringByID(R.MyInternationalizationString.uWithdrawGarrison);
}
@@ -917,7 +936,7 @@
//绫诲瀷:閫昏緫鍚嶅瓧
recordInfo.MsgObjectText = receiveData["Data"]["LogicName"].ToString();
//宸叉墽琛�
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
#endregion
@@ -935,7 +954,7 @@
//绫诲瀷:鍦烘櫙鍚嶅瓧
recordInfo.MsgObjectText = receiveData["Data"]["ScenesName"].ToString();
//宸叉墽琛�
- recordInfo.MsgText = Language.StringByID(R.MyInternationalizationString.uExecuted);
+ recordInfo.listMsg.Add(Language.StringByID(R.MyInternationalizationString.uExecuted));
}
#endregion
@@ -947,7 +966,8 @@
/// </summary>
public override void CloseFormBefore()
{
- if (UserCenterResourse.DicActionForm.ContainsKey("UserMainForm") == false)
+ var userPageForm = UserView.UserPage.Instance.GetNowActionForm();
+ if (userPageForm != null && userPageForm.FormID == "UserMainForm")
{
Common.CommonPage.Instance.IsDrawerLockMode = false;
}
--
Gitblit v1.8.0