From 78bfe524ea4776c47f6314e56e97f39970b00fce Mon Sep 17 00:00:00 2001
From: client_linchunjie <461730578@qq.com>
Date: 星期二, 25 九月 2018 15:07:07 +0800
Subject: [PATCH] Merge branch 'master' into 1871天赋功能

---
 System/SystemSetting/ActivityPushCell.cs |   21 ++++++++-------------
 1 files changed, 8 insertions(+), 13 deletions(-)

diff --git a/System/SystemSetting/ActivityPushCell.cs b/System/SystemSetting/ActivityPushCell.cs
index a725677..3481223 100644
--- a/System/SystemSetting/ActivityPushCell.cs
+++ b/System/SystemSetting/ActivityPushCell.cs
@@ -12,20 +12,22 @@
         [SerializeField] GameObject bgObj;
 
         SetPrivateModel privateModel { get { return ModelCenter.Instance.GetModel<SetPrivateModel>(); } }
+        DailyQuestModel dailyQuestModel { get { return ModelCenter.Instance.GetModel<DailyQuestModel>(); } }
 
         public void SetModel(int dailyId)
         {
             string title = "";
             string weekDay = "";
             string openTime = "";
-            privateModel.GetDailyInfoById(dailyId,out title,out weekDay,out openTime);
+            privateModel.GetDailyInfoById(dailyId, out title, out weekDay, out openTime);
             nameText.text = title;
             weekDayText.text = weekDay;
             timeText.text = openTime;
-            int index = privateModel.GetSwitchIndexById(dailyId);
-            pushBtn.SetInit(index,privateModel.GetSwitchStateByIndex(index));
-            pushBtn.switchBtn.RemoveAllListeners();
-            pushBtn.switchBtn.AddListener(() =>
+
+            var quests = dailyQuestModel.GetDailyQuests(DailyQuestModel.DailyQuestCategory.TimeLimit);
+            int index = privateModel.GetSwitchIndexById(dailyId, quests);
+            pushBtn.SetInit(index, privateModel.GetSwitchStateByIndex(index));
+            pushBtn.switchBtn.SetListener(() =>
             {
                 if (pushBtn.onObj.activeInHierarchy)
                 {
@@ -41,14 +43,7 @@
                 }
             });
 
-            if(this.index % 2 == 0)
-            {
-                bgObj.SetActive(true);
-            }
-            else
-            {
-                bgObj.SetActive(false);
-            }
+            bgObj.SetActive(this.index % 2 == 0);
         }
     }
 }

--
Gitblit v1.8.0