From 2a8a69d99f382bb3f87f8f5c1f6f964bc4f26a2b Mon Sep 17 00:00:00 2001
From: JLChen <551775569@qq.com>
Date: 星期四, 17 十二月 2020 16:18:07 +0800
Subject: [PATCH] 2020-12-17 1.增加错误码

---
 HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs |   79 ++++++++++++++++++++++++---------------
 1 files changed, 48 insertions(+), 31 deletions(-)

diff --git a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
index 4f8def7..a04024e 100644
--- a/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
+++ b/HDL_ON/UI/UI2/1-HomePage/MessageCenterPage.cs
@@ -44,11 +44,16 @@
         /// </summary>
         List<PushMessageInfo> PushMessageInfoList = new List<PushMessageInfo>();
 
+        /// <summary>
+        /// 椤甸潰鍏抽棴鏃堕棿
+        /// </summary>
+        Action backAction;
 
         public override void RemoveFromParent()
         {
             UnregisterGetPushMessageAction();
             base.RemoveFromParent();
+            backAction?.Invoke();
         }
 
         /// <summary>
@@ -66,7 +71,8 @@
         /// <param name="backAction"></param>
         public void LoadPage(Action backAction)
         {
-            new TopViewDiv(bodyView, Language.StringByID(StringId.MessageCenter)).LoadTopView(backAction);
+            this.backAction = backAction;
+            new TopViewDiv(bodyView, Language.StringByID(StringId.MessageCenter)).LoadTopView();
 
             AddTopMenuView();
             AddMessageView();
@@ -107,17 +113,28 @@
                 MenuButtonSelect(0);
             };
             allMenuButton.SelectAction = allAction;
-
-#if DEBUG
             //娴嬭瘯鎻愬墠褰撳墠鎺ㄩ�両D
             allMenuButton.ImageButton.MouseLongEventHandler = (sender, e) =>
             {
-                CopyToClipboard("鎺ㄩ�両D锛�" + OnAppConfig.Instance.PushId);
-            };
-#endif
-            #endregion
+#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,
@@ -132,9 +149,9 @@
                 MenuButtonSelect(1);
             };
             shareMenuButton.SelectAction = shateAction;
-            #endregion
+#endregion
 
-            #region 鎶ヨ绫�
+#region 鎶ヨ绫�
             alarmMenuButton = new MenuButton()
             {
                 X = shareMenuButton.Right,
@@ -149,9 +166,9 @@
                 MenuButtonSelect(2);
             };
             alarmMenuButton.SelectAction = alarmAction;
-            #endregion
+#endregion
 
-            #region 绯荤粺淇℃伅
+#region 绯荤粺淇℃伅
             systemMenuButton = new MenuButton()
             {
                 X = alarmMenuButton.Right,
@@ -166,7 +183,7 @@
                 MenuButtonSelect(3);
             };
             systemMenuButton.SelectAction = systemAction;
-            #endregion
+#endregion
 
         }
 
@@ -204,9 +221,9 @@
             if (selectId == 0)
             {
                 allMenuButton.IsSelected = true;
-                shareMenuButton.IsSelected = false;
-                alarmMenuButton.IsSelected = false;
-                systemMenuButton.IsSelected = false;
+                shareMenuButton.IsSelected = true;
+                alarmMenuButton.IsSelected = true;
+                systemMenuButton.IsSelected = true;
 
             }
             else if (selectId == 1)
@@ -280,12 +297,12 @@
             {
                 X = Application.GetRealWidth(16),
                 Y = Application.GetRealHeight(12),
-                Width = Application.GetRealWidth(320),
+                Width = Application.GetRealWidth(343),
                 Height = Application.GetRealHeight(20),
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.TextFontSize,
-                Text = pushMessageInfo.messageTitle
+                Text = pushMessageInfo.messageContent
             };
             rowView.AddChidren(btnTilte);
 
@@ -299,7 +316,7 @@
                 TextAlignment = TextAlignment.CenterLeft,
                 TextColor = CSS_Color.PromptingColor1,
                 TextSize = CSS_FontSize.PromptFontSize_FirstLevel,
-                Text = pushMessageInfo.messageContent
+                Text = pushMessageInfo.messageTitle
             };
             rowView.AddChidren(btnSubtitle);
 
@@ -428,9 +445,9 @@
                 TextColor = CSS_Color.FirstLevelTitleColor,
                 TextSize = CSS_FontSize.EmphasisFontSize_FirstLevel,
                 IsBold = true,
-                Text = yearStr
             };
             bgView.AddChidren(yearBtn);
+            yearBtn.Text = yearStr + Language.StringByID(StringId.Years);
         }
 
         /// <summary>
@@ -527,7 +544,7 @@
             }
         }
 
-        #region 娴嬭瘯
+#region 娴嬭瘯
 #if DEBUG
         /// <summary>
         /// 
@@ -602,7 +619,7 @@
 
 #endif
 
-        #endregion
+#endregion
 
         /// <summary>
         /// 鏍囪鎵�鏈夋帹閫佹秷鎭凡璇�
@@ -631,14 +648,14 @@
         /// </summary>
         void RegisterGetPushMessageAction()
         {
-            //HDLCommon.GetPushMessageAction = () =>
-            //{
-            //    if (bodyView != null)
-            //    {
-            //        Utlis.WriteLine("GetPushMessageAction M鏀跺埌鎺ㄩ��");
-            //        GetPushMessageList(showMesType);
-            //    }
-            //};
+            HDLCommon.GetPushMessageAction = () =>
+            {
+                if (bodyView != null)
+                {
+                    //Utlis.WriteLine("GetPushMessageAction M鏀跺埌鎺ㄩ��");
+                    GetPushMessageList(showMesType);
+                }
+            };
         }
 
         /// <summary>
@@ -646,7 +663,7 @@
         /// </summary>
         void UnregisterGetPushMessageAction()
         {
-            //HDLCommon.GetPushMessageAction = null;
+            HDLCommon.GetPushMessageAction = null;
         }
 
 #if DEBUG

--
Gitblit v1.8.0