Esempio n. 1
0
    /// <summary>
    /// 得到开始时间
    /// </summary>
    public string getStartTime()
    {
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            //activeTime.initTime (ServerTimeKit.getSecondTime ());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int startTime = activeTime.getStartTime();         //+ServerTimeKit.onlineTime;

        System.DateTime date = TimeKit.getDateTime(startTime);
        return(LanguageConfigManager.Instance.getLanguage("s0125", date.Month.ToString(), date.Day.ToString()));
    }
Esempio n. 2
0
 public ActiveTime getActiveTime()
 {
     if (activeTime == null)
     {
         activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);
     }
     else
     {
         activeTime.doRefresh();
     }
     return(activeTime);
 }
Esempio n. 3
0
 public ActiveTime getActiveTime()
 {
     if (activeTime == null)
     {
         initTime();
     }
     else
     {
         activeTime.doRefresh();
     }
     return(activeTime);
 }
Esempio n. 4
0
    /// <summary>
    /// 获得答题活动开放时间
    /// </summary>
    public string getOpenTimeDesc()
    {
        SidNoticeContent content = getSample().content as SidNoticeContent;
        TimeInfoSample   tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(getSample().timeID);

        if (activeTime == null)
        {
            activeTime = ActiveTime.getActiveTimeByType(tsample);
            activeTime.initTime(ServerTimeKit.getSecondTime());
        }
        else
        {
            activeTime.doRefresh();
        }
        //具体开始时间
        int startTime = activeTime.getStartTime();
        //具体结束时间
        int      endTime  = activeTime.getEndTime();
        DateTime dt       = TimeKit.getDateTime(endTime);
        int      currTime = dt.Hour * 3600 + dt.Minute * 60 + dt.Second;

        if (currTime == 0)
        {
            endTime -= 1;
        }

        if (DateKit.isInSameDay(startTime, endTime))
        {
            return(LanguageConfigManager.Instance.getLanguage("notice11", TimeKit.dateToFormat(startTime, LanguageConfigManager.Instance.getLanguage("notice04"))));
        }
        else
        {
            return(LanguageConfigManager.Instance.getLanguage("notice02", TimeKit.dateToFormat(startTime, LanguageConfigManager.Instance.getLanguage("notice04")),
                                                              TimeKit.dateToFormat(endTime, LanguageConfigManager.Instance.getLanguage("notice04"))));
        }
    }
Esempio n. 5
0
    private void updateTime()
    {
        activeTime = (notice as ConsumeRebateNotice).activeTime;
        activeTime.doRefresh();
        int now = ServerTimeKit.getSecondTime();

        if (activeTime.getEndTime() == 0)
        {
            timeLabel.text = Language("notice03");
        }
        else if (now < activeTime.getDetailStartTime())
        {
            //活动还未开启
            timeNoOpen.text = Language("ConsumeRebate_05", TimeKit.timeTransformDHMS(activeTime.getDetailStartTime() - now));
            timeLabel.gameObject.SetActive(false);
            offect.SetActive(false);
            noOpenObj.SetActive(true);
            //timeLabel.text = Language ("ConsumeRebate_05", TimeKit.timeTransformDHMS (activeTime.getDetailStartTime () - now));
        }
        else if (activeTime.getDetailStartTime() <= now && now < activeTime.getDetailEndTime())
        {
            timeLabel.gameObject.SetActive(true);
            offect.SetActive(true);
            offect.transform.localPosition = new Vector3(0f, 17f, 0f);
            noOpenObj.SetActive(false);
            timeLabel.text = Language("ConsumeRebate_06", TimeKit.timeTransformDHMS(activeTime.getDetailEndTime() - now));
        }
        else
        {
            timeLabel.text = Language("s0211");
            timeLabel.gameObject.SetActive(true);
            offect.SetActive(true);
            offect.transform.localPosition = new Vector3(0f, 17f, 0f);
            noOpenObj.SetActive(false);
            OnDisable();
        }
    }