From 6ec12a036c96a200fc0a941967d6b4d07592f863 Mon Sep 17 00:00:00 2001 From: wxr <464027401@qq.com> Date: 星期四, 17 十二月 2020 14:31:17 +0800 Subject: [PATCH] Merge branch 'tzy' into NewFilePath --- HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs | 92 +++++++++++++++++++++++++++++++++++++++------- 1 files changed, 78 insertions(+), 14 deletions(-) diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs index 4ea4cbd..f830a1f 100644 --- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs +++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs @@ -4,7 +4,9 @@ using System.Collections.Generic; using System.Threading; using HDL_ON.DAL.Server; - +#if DEBUG +using Xamarin.Essentials; +#endif namespace HDL_ON.UI { /// <summary> @@ -43,6 +45,12 @@ List<PushMessageInfo> PushMessageInfoList = new List<PushMessageInfo>(); + public override void RemoveFromParent() + { + UnregisterGetPushMessageAction(); + base.RemoveFromParent(); + } + /// <summary> /// /// </summary> @@ -63,7 +71,7 @@ AddTopMenuView(); AddMessageView(); MenuButtonSelect(showMesType); - + RegisterGetPushMessageAction(); //娴嬭瘯浠g爜 //AddEmptyTipView(); //TestLoad(); @@ -99,9 +107,28 @@ MenuButtonSelect(0); }; allMenuButton.SelectAction = allAction; - #endregion + //娴嬭瘯鎻愬墠褰撳墠鎺ㄩ�両D + allMenuButton.ImageButton.MouseLongEventHandler = (sender, e) => + { +#if DEBUG - #region 鍒嗕韩涓庡姛鑳� + CopyToClipboard("鎺ㄩ�両D锛�" + OnAppConfig.Instance.PushId); +#else + //妫�娴嬫槸鍚﹁幏鍙栨帹閫両D鎴愬姛锛屾彁绀烘帹閫佹敞鍐屾槸鍚︽甯� + if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) + { + Utlis.ShowTip(Language.StringByID(StringId.PushException)); + } + else + { + Utlis.ShowTip(Language.StringByID(StringId.PushNormal)); + } +#endif + + }; +#endregion + +#region 鍒嗕韩涓庡姛鑳� shareMenuButton = new MenuButton() { X = allMenuButton.Right, @@ -116,9 +143,9 @@ MenuButtonSelect(1); }; shareMenuButton.SelectAction = shateAction; - #endregion +#endregion - #region 鎶ヨ绫� +#region 鎶ヨ绫� alarmMenuButton = new MenuButton() { X = shareMenuButton.Right, @@ -133,9 +160,9 @@ MenuButtonSelect(2); }; alarmMenuButton.SelectAction = alarmAction; - #endregion +#endregion - #region 绯荤粺淇℃伅 +#region 绯荤粺淇℃伅 systemMenuButton = new MenuButton() { X = alarmMenuButton.Right, @@ -150,7 +177,7 @@ MenuButtonSelect(3); }; systemMenuButton.SelectAction = systemAction; - #endregion +#endregion } @@ -323,7 +350,7 @@ { new Alert(pushMessageInfo.messageTitle, pushMessageInfo.messageContent, Language.StringByID(StringId.Close)).Show(); }; - + rowView.MouseUpEventHandler = eventHandler; btnTilte.MouseUpEventHandler = eventHandler; btnSubtitle.MouseUpEventHandler = eventHandler; } @@ -426,7 +453,8 @@ bodyScrolView.RemoveAll(); PushMessageInfoList.Clear(); YearMark = "";//鏍囪娓呯┖ - if (string.IsNullOrEmpty(UserInfo.Current.PushId)) { + if (string.IsNullOrEmpty(OnAppConfig.Instance.PushId)) + { AddEmptyTipView(); return; } @@ -510,7 +538,7 @@ } } - #region 娴嬭瘯 +#region 娴嬭瘯 #if DEBUG /// <summary> /// @@ -585,12 +613,13 @@ #endif - #endregion +#endregion /// <summary> /// 鏍囪鎵�鏈夋帹閫佹秷鎭凡璇� /// </summary> - void PushSerivceMarkAllMessageRead() { + void PushSerivceMarkAllMessageRead() + { new Thread(() => { var result = new HttpServerRequest().PushSerivceMarkAllMessageRead(); @@ -608,6 +637,41 @@ { IsBackground = true }.Start(); } + /// <summary> + /// 娉ㄥ唽鏀跺埌鎺ㄩ�佺洃鍚� + /// </summary> + void RegisterGetPushMessageAction() + { + //HDLCommon.GetPushMessageAction = () => + //{ + // if (bodyView != null) + // { + // Utlis.WriteLine("GetPushMessageAction M鏀跺埌鎺ㄩ��"); + // GetPushMessageList(showMesType); + // } + //}; + } + + /// <summary> + /// 鍙栨秷鏀跺埌鎺ㄩ�佺洃鍚� + /// </summary> + void UnregisterGetPushMessageAction() + { + //HDLCommon.GetPushMessageAction = null; + } + +#if DEBUG + + /// <summary> + /// 澶嶅埗鍒板壀鍒囨澘 + /// </summary> + /// <param name="text"></param> + void CopyToClipboard(string text) + { + Clipboard.SetTextAsync(text); + Utlis.ShowTip(text + "\n" + Language.StringByID(StringId.CopySuccess)); + } +#endif } -- Gitblit v1.8.0