少年修仙传客户端代码仓库
client_linchunjie
2018-09-25 78bfe524ea4776c47f6314e56e97f39970b00fce
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);
        }
    }
}