From f982455916297ab07379d902a7f15b7a7a867c94 Mon Sep 17 00:00:00 2001
From: wei <kaede@kaededeMacBook-Air.local>
Date: 星期三, 20 十月 2021 09:19:20 +0800
Subject: [PATCH] 1
---
HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs | 231 +++++++++++++++++++++++++++++++++++++++++++++++++--------
1 files changed, 197 insertions(+), 34 deletions(-)
diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
index eb5f464..b2635af 100644
--- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
@@ -140,7 +140,7 @@
#endif
};
-#endregion
+ #endregion
#region 鍒嗕韩涓庡姛鑳�
shareMenuButton = new MenuButton()
@@ -160,7 +160,7 @@
shareMenuButton.SelectAction = shateAction;
#endregion
-#region 鎶ヨ绫�
+ #region 鎶ヨ绫�
alarmMenuButton = new MenuButton()
{
X = shareMenuButton.Right,
@@ -175,9 +175,9 @@
MenuButtonSelect(2);
};
alarmMenuButton.SelectAction = alarmAction;
-#endregion
+ #endregion
-#region 绯荤粺淇℃伅
+ #region 绯荤粺淇℃伅
systemMenuButton = new MenuButton()
{
X = alarmMenuButton.Right,
@@ -194,16 +194,17 @@
systemMenuButton.SelectAction = systemAction;
#endregion
- #region 鐗╀笟閫氱煡
+ #region 鐗╀笟閫氱煡 2021-09-15澧炲姞
propertyMenuButton = new MenuButton()
{
X = systemMenuButton.Right,
Y = Application.GetRealWidth(16),
};
- //menuView.AddChidren(propertyMenuButton); //鍏堝睆钄�
- propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/SystemOn.png";
- propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/System.png";
- propertyMenuButton.TextButton.TextID = StringId.SystemMessage;
+ menuView.AddChidren(propertyMenuButton);
+ propertyMenuButton.ImageButton.SelectedImagePath = "Collection/MesCenter/PropertyOn.png";
+ propertyMenuButton.ImageButton.UnSelectedImagePath = "Collection/MesCenter/Property.png";
+ propertyMenuButton.TextButton.TextID = StringId.Propertynotice;
+ propertyMenuButton.TextButton.IsMoreLines = true;
Action propertyAction = () =>
{
MenuButtonSelect(4);
@@ -211,12 +212,12 @@
propertyMenuButton.SelectAction = propertyAction;
#endregion
- //鍏堝睆钄�
- ////鍙硃addingView
- //menuView.AddChidren(new Button() {
- // Width = Application.GetRealWidth(15),
- // BackgroundColor = CSS_Color.viewTranslucence
- //});
+ //鍙硃addingView
+ menuView.AddChidren(new Button()
+ {
+ Width = Application.GetRealWidth(15),
+ BackgroundColor = CSS_Color.viewTranslucence
+ });
}
@@ -295,6 +296,8 @@
propertyMenuButton.IsSelected = true;
}
+
+ menuView.ScrollToX(selectId * Application.GetRealWidth(40));
GetPushMessageList(showMesType);
}
@@ -404,16 +407,17 @@
btnDatetime.Text = GetUnixToDateTime(pushMessageInfo.createTime);
- //2020-12-23 鍘绘帀鐐瑰嚮寮圭獥浜嬩欢
- //EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
- //{
- // new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show();
- //};
- //rowView.MouseUpEventHandler = eventHandler;
- //btnTilte.MouseUpEventHandler = eventHandler;
- //btnSubtitle.MouseUpEventHandler = eventHandler;
-
+ EventHandler<MouseEventArgs> eventHandler = (sender, e) =>
+ {
+ OnClickPushMessageInfo(pushMessageInfo);
+ //new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show();
+ };
+ rowView.MouseUpEventHandler = eventHandler;
+ btnTilte.MouseUpEventHandler = eventHandler;
+ btnSubtitle.MouseUpEventHandler = eventHandler;
+
+
}
/// <summary>
@@ -447,7 +451,13 @@
{
try
{
- var result = new HttpServerRequest().PushSerivceDeleteMessage(pushMessageInfo.id);
+ var delPush = new PushMsgIdObj()
+ {
+ msgId = pushMessageInfo.id,
+ pushType = pushMessageInfo.pushType
+ };
+
+ var result = new HttpServerRequest().PushSerivceDeleteMessage(delPush);
if (result)
{
PushMessageInfoList.Remove(pushMessageInfo);
@@ -512,7 +522,7 @@
void GetPushMessageList(int queryType = 0)
{
bodyScrolView.RemoveAll();
- if(PushMessageInfoList == null)
+ if (PushMessageInfoList == null)
{
PushMessageInfoList = new List<PushMessageInfo>();
}
@@ -520,7 +530,7 @@
{
PushMessageInfoList.Clear();
}
-
+
YearMark = "";//鏍囪娓呯┖
if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId))
{
@@ -542,7 +552,8 @@
//PushMessageInfoList = Newtonsoft.Json.JsonConvert.DeserializeObject<List<PushMessageInfo>>(result.Data.ToString());
//2021-08-28 鏀逛负鍒嗛〉鎺ュ彛
var mPushMesList = Newtonsoft.Json.JsonConvert.DeserializeObject<PushMessageInfoList>(result.Data.ToString());
- if(mPushMesList != null) {
+ if (mPushMesList != null)
+ {
PushMessageInfoList = mPushMesList.list;
}
@@ -613,7 +624,107 @@
}
}
-#region 娴嬭瘯
+ /// <summary>
+ /// 鑾峰彇鐗╀笟閫氱煡璇︽儏
+ /// </summary>
+ /// <param name="noticeId"></param>
+ void GetPropertyNoticeDetails(string noticeId)
+ {
+ var waitPage = new Loading();
+ bodyView.AddChidren(waitPage);
+ waitPage.Start(Language.StringByID(StringId.PleaseWait));
+
+ new Thread(() =>
+ {
+ try
+ {
+ var result = new HttpServerRequest().GetPropertyNoticeDetails(noticeId);
+ if (result.Code == StateCode.SUCCESS)
+ {
+ var mPushNoticeInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<PushNoticeInfo>(result.Data.ToString());
+ if (mPushNoticeInfo != null)
+ {
+ Application.RunOnMainThread(() =>
+ {
+ new WebViewDialog().LoadPageWithHtmlStr(mPushNoticeInfo.title, mPushNoticeInfo.content);
+ });
+ }
+ }
+ }
+ catch (Exception ex)
+ {
+ }
+ finally
+ {
+ Application.RunOnMainThread(() =>
+ {
+ if (waitPage != null)
+ {
+ waitPage.RemoveFromParent();
+ waitPage = null;
+ }
+ });
+ }
+ })
+ { IsBackground = true }.Start();
+ }
+
+ /// <summary>
+ /// 閫氱煡淇℃伅鐐瑰嚮浜嬩欢
+ /// </summary>
+ /// <param name="pushMessageInfo"></param>
+ void OnClickPushMessageInfo(PushMessageInfo pushMessageInfo)
+ {
+
+ if (pushMessageInfo.pushType == PushType.Notice.ToString())
+ {
+ //Utlis.WriteLine("鐗╀笟閫氱煡");
+ string noticeId = GetNoticeId(pushMessageInfo.messageExpand);
+ if (!string.IsNullOrEmpty(noticeId))
+ {
+ GetPropertyNoticeDetails(noticeId);
+ }
+ else
+ {
+ Utlis.WriteLine("noticeId null");
+ }
+ }
+ else
+ {
+ Utlis.WriteLine("鍏跺畠閫氱煡绫诲瀷");
+ }
+ }
+
+ /// <summary>
+ /// 瑙f瀽messageExpand 鎻愬彇targetId
+ /// </summary>
+ /// <param name="messageExpand"></param>
+ /// <returns></returns>
+ string GetNoticeId(string messageExpand)
+ {
+ try
+ {
+ if (!string.IsNullOrEmpty(messageExpand))
+ {
+ var mMessageExpandInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<MessageExpandInfo>(messageExpand);
+ if (mMessageExpandInfo != null)
+ {
+ var mExpantContentInfo = Newtonsoft.Json.JsonConvert.DeserializeObject<ExpantContentInfo>(mMessageExpandInfo.expantContent);
+ if(mExpantContentInfo != null)
+ {
+ return mExpantContentInfo.targetId;
+ }
+ }
+ }
+ return null;
+ }
+ catch
+ {
+ return null;
+ }
+ }
+
+ #region 娴嬭瘯
#if DEBUG
/// <summary>
///
@@ -688,7 +799,7 @@
#endif
-#endregion
+ #endregion
/// <summary>
/// 鏍囪鎵�鏈夋帹閫佹秷鎭凡璇�
@@ -778,10 +889,10 @@
/// 娑堟伅鍐呭
/// </summary>
public string messageContent;
- ///// <summary>
- ///// 鎵╁睍鏁版嵁
- ///// </summary>
- //public string messageExpand;
+ /// <summary>
+ /// 鎵╁睍鏁版嵁
+ /// </summary>
+ public string messageExpand;
///// <summary>
///// 娑堟伅绫诲瀷锛�0锛氭彁绀猴紱1锛氭姤璀︼紱2锛氫赴鏋楀彲鏄璁插懠鍙紱3锛氬己鍒朵笅绾挎帹閫�
///// </summary>
@@ -806,4 +917,56 @@
}
+
+ /// <summary>
+ /// 鐗╀笟鍏憡璇︽儏
+ /// </summary>
+ [System.Serializable]
+ public class PushNoticeInfo
+ {
+ /// <summary>
+ /// 娑堟伅ID
+ /// </summary>
+ public string noticeId;
+ /// <summary>
+ /// 娑堟伅鏍囬
+ /// </summary>
+ public string title;
+ /// <summary>
+ /// 瀵屾枃鏈唴瀹�
+ /// </summary>
+ public string content;
+ }
+
+ /// <summary>
+ /// 鎺ㄩ�佹墿灞曚俊鎭�
+ /// </summary>
+ [System.Serializable]
+ public class MessageExpandInfo
+ {
+ /// <summary>
+ /// expantContent
+ /// </summary>
+ public string expantContent;
+
+ }
+
+ /// <summary>
+ /// 鎺ㄩ�佹墿灞曚俊鎭�
+ /// </summary>
+ [System.Serializable]
+ public class ExpantContentInfo
+ {
+ /// <summary>
+ /// targetId
+ /// </summary>
+ public string targetId;
+ /// <summary>
+ /// messageType
+ /// </summary>
+ public string messageType;
+
+ }
+
+
}
--
Gitblit v1.8.0