| | |
| | |
|
| | | if (limitedTimePackageItemModel.IsExpired())
|
| | | {
|
| | | m_Buy_Btn.interactable = false;
|
| | | time = 0;
|
| | | limitedTimePackageItemModel.OpenFreePlat(str, gift.gifts[0].rmb, gift.gifts[0].OrderInfo);
|
| | | if (OperationTimeHepler.Instance.SatisfyAdvanceCondition(Operation.GiftPackage))
|
| | | {
|
| | | SysNotifyMgr.Instance.ShowTip("LimitGilt1");
|
| | | return;
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Buy_Btn.interactable = false;
|
| | | time = 0;
|
| | | limitedTimePackageItemModel.OpenFreePlat(str, gift.gifts[0].rmb, gift.gifts[0].OrderInfo);
|
| | | return;
|
| | | }
|
| | | |
| | | }
|
| | | else
|
| | | {
|
| | |
| | | }
|
| | | }
|
| | | }
|
| | | // m_Text_ActivityTimeTo.text = StringUtility.Contact(Language.Get("ExpActivity_Text1"), operation.ToDisplayTime());
|
| | | }
|
| | | DisplaySurplusTime();
|
| | | }
|
| | |
|
| | |
|
| | |
| | | }
|
| | | private void secondEvent()
|
| | | {
|
| | | int time = OperationTimeHepler.Instance.GetOperationSurplusTime(Operation.GiftPackage);
|
| | | if (time <= 0)
|
| | | DisplaySurplusTime();
|
| | | }
|
| | | private void DisplaySurplusTime()
|
| | | {
|
| | | OperationBase operationBase;
|
| | | OperationTimeHepler.Instance.TryGetOperationTime(Operation.GiftPackage, out operationBase);
|
| | | var seconds = 0;
|
| | | var inAdvance = false;
|
| | | if (operationBase != null)
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("LimitGift2");
|
| | | if (operationBase.InAdvanceTime(TimeUtility.ServerNow))
|
| | | {
|
| | | inAdvance = true;
|
| | | seconds = operationBase.GetSecondsBeforeStart(TimeUtility.ServerNow);
|
| | | }
|
| | | else
|
| | | {
|
| | | GiftPackageClass operation = operationBase as GiftPackageClass;
|
| | | seconds = operation.GetResetSurplusTime();
|
| | | }
|
| | | }
|
| | | if (time > 0)
|
| | | if (seconds > 0)
|
| | | {
|
| | | string str = String.Format(Language.Get("LimitGift1"), TimeUtility.SecondsToDHMSCHS(time));
|
| | | m_Text_ActivityTimeTo.text = str;
|
| | | // m_Text_ActivityTimeTo.color = UIHelper.GetUIColor(TextColType.Green);
|
| | | if (inAdvance)
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("OperationAdvanceOpen", TimeUtility.SecondsToDHMSCHS(seconds));
|
| | | }
|
| | | else
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("LimitGift1", TimeUtility.SecondsToDHMSCHS(seconds));
|
| | | }
|
| | | }
|
| | | |
| | | else
|
| | | {
|
| | | m_Text_ActivityTimeTo.text = Language.Get("ActivityEnd");
|
| | | }
|
| | | }
|
| | |
|
| | | #endregion
|