123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- using System;
- /// <summary>
- /// 限时礼包
- /// </summary>
- public class LimitTsGiftVo
- {
- public LimitTsGiftVo()
- {
- }
- private readonly Player p = UserProxy.Instance.player;
- /// <summary>
- /// 礼包id
- /// </summary>
- public int giftId
- {
- get
- {
- return GameConfigData.Ins.Getshop_limit_typeMo(Enum_Recharge.limitTsActiveGift.ToString())[0].typeId;
- }
- }
- public string name
- {
- get
- {
- return this.mo.name;
- }
- }
- public string icon
- {
- get
- {
- return this.mo.icon;
- }
- }
- //是否推送限时活动礼包信息
- public Enum_FirstRechargeState State
- {
- get
- {
- long starTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftStartTs.ToString());
- long endTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftEndTs.ToString());
- TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
- long curTs = Convert.ToInt64(ts.TotalSeconds);
- if (starTs <= curTs && curTs < endTs)
- {
- if (this.p.shopdata.limitTsRewardsList.Contains(this.giftId))
- {
- return Enum_FirstRechargeState.ReceivePrize;
- }
- else
- {
- return Enum_FirstRechargeState.ReceivePrize;
- }
- }
- return Enum_FirstRechargeState.NoFirstRecharge;//没有在推送限时活动礼包的时间里
- //if (this.p.payInfo.firstRechage == 0 && this.player.baseInfo.charge_amt <= 0)
- //{
- // return Enum_FirstRechargeState.NoFirstRecharge;
- //}
- //else if (this.player.payInfo.firstRechage == 0 && this.player.baseInfo.charge_amt > 0)
- //{
- // return Enum_FirstRechargeState.NoReceivePrize;
- //}
- //return Enum_FirstRechargeState.ReceivePrize;
- }
- }
- /// <summary>
- /// 当前时间
- /// </summary>
- public long curTs
- {
- get
- {
- TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
- long curTs = Convert.ToInt64(ts.TotalSeconds);
- return curTs;
- }
- }
- /// <summary>
- /// 活动礼包开始时间
- /// </summary>
- public long starTs
- {
- get
- {
- long starTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftStartTs.ToString());
- return starTs;
- }
- }
- /// <summary>
- /// 礼包信息
- /// </summary>
- public List<ItemVo> reward
- {
- get
- {
- return ItemVo.ParsItemContentStr(this.mo.reward);
- }
- }
- public sm_shop_limit mo
- {
- get
- {
- return GameConfigData.Ins.Getshop_limitMo(this.giftId);
- }
- }
- }
- /// <summary>
- /// 限时随机礼包
- /// </summary>
- public class LimitTsRandGiftVo
- {
- public LimitTsRandGiftVo()
- {
- }
- private readonly Player p = UserProxy.Instance.player;
- public class RandGiftVo
- {
- public int giftId { get; set; }
- }
-
- /// <summary>
- ///
- /// </summary>
- public Enum_FirstRechargeState State
- {
- get
- {
- if (this.p.triggerLimitTsGift.Count == 0)
- {
- return Enum_FirstRechargeState.NoFirstRecharge;
- }
- TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
- long curTs = Convert.ToInt64(ts.TotalSeconds);
- List<Ins_Gift> list = this.p.triggerLimitTsGift;
- //foreach (Ins_Gift item in list)
- //{
- // item.startTs;
- //}
- return Enum_FirstRechargeState.NoFirstRecharge;
- }
- }
-
- }
|