Exemplo n.º 1
0
    private void clickBuyButton(GameObject obj)
    {
        ActiveTime activeTime = (fatherContent.notice as ConsumeRebateNotice).activeTime;
        int        now        = ServerTimeKit.getSecondTime();

        if (now < activeTime.getDetailStartTime())
        {
            UiManager.Instance.createMessageLintWindow(Language("s0171"));
        }
        else if (now > activeTime.getDetailEndTime())
        {
            UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_07"));
        }
        else if (activeGoods.getRoleCountCanBuy() < 1)
        {
            UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_08"));
        }
        else if (activeGoods.getServerCountCanBuy() < 1)
        {
            UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_09"));
        }
        else if (activeGoods.getSample().rmbCondition > fatherContent.serverInfo.consumeValue)
        {
            UiManager.Instance.createMessageLintWindow(Language("ConsumeRebate_10"));
        }
        else
        {
            UiManager.Instance.openDialogWindow <BuyWindow> ((win) => {
                win.init(activeGoods, Mathf.Min(activeGoods.getServerCountCanBuy(), activeGoods.getRoleCountCanBuy(), UserManager.Instance.self.getRMB() / activeGoods.getCostPrice()),
                         1, activeGoods.getCostType(), buy);
            });
        }
    }
Exemplo n.º 2
0
    /// <summary>
    /// 获得时间描述
    /// </summary>
    public string getTimeDesc()
    {
        int        nowTime    = ServerTimeKit.getSecondTime();
        ExamSample examSample = QuizManagerment.Instance.getExamSampleBySid(this);

        if (examSample == null)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        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 detailStartTime = activeTime.getDetailStartTime();
        //具体结束时间
        int detailEndTime = activeTime.getDetailEndTime();

        if (detailStartTime < nowTime && detailEndTime > nowTime && examSample.getAwardType == 1)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice09"));            //可以答题
        }
        else if (DateKit.isInSameDay(detailStartTime, nowTime) && detailStartTime > nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice08", TimeKit.dateToFormat(detailStartTime, LanguageConfigManager.Instance.getLanguage("notice05"))));              //尚未开启
        }
        else if (activeTime.getIsFinish())
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else if (detailEndTime < nowTime)
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
        else
        {
            return(LanguageConfigManager.Instance.getLanguage("notice_quiz01"));            //活动已经结束
        }
    }
 /// <summary>
 /// 设置活动开启时间
 /// </summary>
 public void setNoticeOpenTime()
 {
     this.openTimeNoticeText  = LanguageConfigManager.Instance.getLanguage("LuckyCardContent_timeOpen");
     this.closeTimeNoticeText = LanguageConfigManager.Instance.getLanguage("superDraw_14");
     activeTime      = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
     noticeOpenTime  = activeTime.getDetailStartTime();
     noticeCloseTime = activeTime.getDetailEndTime();
 }
Exemplo n.º 4
0
 public long[] getStarMultipleTimes()
 {
     if (starTime == null)
     {
         return(null);
     }
     return(new long[] {
         starTime.getDetailStartTime(),
         starTime.getDetailEndTime()
     });
 }
Exemplo n.º 5
0
    public override bool isInTimeLimit()
    {
        activeTime = getActiveTime();
        if (activeTime.getIsFinish())
        {
            return(false);
        }
        int now = ServerTimeKit.getSecondTime();

        return(activeTime.getDetailStartTime() < now && now < activeTime.getDetailEndTime());
    }
Exemplo n.º 6
0
 public override int[] getTimeLimit()
 {
     activeTime = getActiveTime();
     if (activeTime.getIsFinish())
     {
         return(null);
     }
     return(new int[] {
         activeTime.getDetailStartTime(),
         activeTime.getDetailEndTime()
     });
 }
Exemplo n.º 7
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();
        }
    }
Exemplo n.º 8
0
    public void initTime(int _timeId)
    {
        timeId    = _timeId;
        timeLimit = new TimeLimit(null);
        TimeInfoSample tsample = TimeConfigManager.Instance.getTimeInfoSampleBySid(timeId);

        days       = tsample.mainTimeInfoo;
        activeTime = ActiveTime.getActiveTimeByType(tsample);
        activeTime.initTime(ServerTimeKit.getSecondTime());
        times = new long[] {
            activeTime.getDetailStartTime(),
                activeTime.getDetailEndTime()
        };
        updateTime();
    }
Exemplo n.º 9
0
    public override string ToString()
    {
        string     timeInfo   = "";
        ActiveTime activeTime = ActiveTime.getActiveTimeByID(getSample().timeID);

        if (activeTime != null)
        {
            timeInfo = activeTime.ToString();
            Log.info("下次开始" + TimeKit.getDateTime(activeTime.getDetailStartTime()).ToString("yyyy-MM-dd HH:mm:ss"));
        }
        else
        {
            timeInfo = "永久";
        }
        return(base.ToString() + "\t" + getSample().sid + "\t" + getSample().name + "\t" + getSample().activiteDesc + "\t" + timeInfo + "\t" + getSample().content);
    }
Exemplo n.º 10
0
    private void showTime()
    {
        int now   = ServerTimeKit.getSecondTime();
        int start = activeTime.getDetailStartTime();
        int end   = activeTime.getDetailEndTime();

        noOpenTip.SetActive(false);
        if (now < start)
        {
            mTipsStr = "";
            //mTipsStr = Language ("doubleRMB_02") + TimeKit.timeTransformDHMS (start - now);
            noOpenTip.SetActive(true);
            time.text = Language("doubleRMB_02") + "\n" + TimeKit.timeTransformDHMS(start - now);
            desc.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_06");
            UI_BtnSure.disableButton(true);
            UI_BtnSure.gameObject.SetActive(false);
        }
        else if (start <= now && now <= end)
        {
            UI_BtnSure.gameObject.SetActive(true);
            mTipsStr  = Language("doubleRMB_03") + TimeKit.timeTransformDHMS(end - now);
            desc.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_07");
            UI_BtnSure.disableButton(false);
        }
        else
        {
            UI_BtnSure.gameObject.SetActive(true);
            mTipsStr         = Language("doubleRMB_04");
            btnSureName.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_08");
            UI_BtnSure.disableButton(true);
            timer.stop();
            timer = null;
        }
        if (DoubleRMBManagement.Instance.isEnd)
        {
            mTipsStr         = Language("doubleRMB_04");
            desc.text        = LanguageConfigManager.Instance.getLanguage("doubleRMB_08");
            btnSureName.text = LanguageConfigManager.Instance.getLanguage("doubleRMB_09");
            UI_BtnSure.disableButton(true);
        }
        else
        {
            btnSureName.text = LanguageConfigManager.Instance.getLanguage("s0324");
        }
        UI_Time.text = mTipsStr;
    }
Exemplo n.º 11
0
 /** 设置活动开启时间 */
 public void setNoticeOpenTime()
 {
     noticeOpenTime  = activeTime.getDetailStartTime();
     noticeCloseTime = activeTime.getDetailEndTime();
 }
Exemplo n.º 12
0
 /// <summary>
 /// 设置活动开启时间
 /// </summary>
 public void setNoticeOpenTime()
 {
     activeTime      = ActiveTime.getActiveTimeByID(this.notice.getSample().timeID);
     noticeOpenTime  = activeTime.getDetailStartTime();
     noticeCloseTime = activeTime.getDetailEndTime();
 }