From e2c5b5e4f7144ef6b81465ed19047a5f3a06758f Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期五, 17 八月 2018 15:01:45 +0800
Subject: [PATCH] 2576【前端】限时特惠时间颜色

---
 System/OpenServerActivity/FlashSaleCoolDown.cs |   13 +++++++++++++
 1 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/System/OpenServerActivity/FlashSaleCoolDown.cs b/System/OpenServerActivity/FlashSaleCoolDown.cs
index 14b095f..d726c93 100644
--- a/System/OpenServerActivity/FlashSaleCoolDown.cs
+++ b/System/OpenServerActivity/FlashSaleCoolDown.cs
@@ -13,6 +13,19 @@
         private void OnEnable()
         {
             DisplayTime();
+            GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
+            GlobalTimeEvent.Instance.secondEvent += SecondEvent;
+        }
+
+        private void SecondEvent()
+        {
+            var seconds = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.FlashSale);
+            m_Time.timeShow.color = seconds > 3600 ? UIHelper.GetUIColor(TextColType.Green) : UIHelper.GetUIColor(TextColType.Red);
+        }
+
+        private void OnDisable()
+        {
+            GlobalTimeEvent.Instance.secondEvent -= SecondEvent;
         }
 
         void DisplayTime()

--
Gitblit v1.8.0