LimitTsGiftVo.cs 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using System;
  5. /// <summary>
  6. /// 限时礼包
  7. /// </summary>
  8. public class LimitTsGiftVo
  9. {
  10. public LimitTsGiftVo()
  11. {
  12. }
  13. private readonly Player p = UserProxy.Instance.player;
  14. /// <summary>
  15. /// 礼包id
  16. /// </summary>
  17. public int giftId
  18. {
  19. get
  20. {
  21. return GameConfigData.Ins.Getshop_limit_typeMo(Enum_Recharge.limitTsActiveGift.ToString())[0].typeId;
  22. }
  23. }
  24. public string name
  25. {
  26. get
  27. {
  28. return this.mo.name;
  29. }
  30. }
  31. public string icon
  32. {
  33. get
  34. {
  35. return this.mo.icon;
  36. }
  37. }
  38. //是否推送限时活动礼包信息
  39. public Enum_FirstRechargeState State
  40. {
  41. get
  42. {
  43. long starTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftStartTs.ToString());
  44. long endTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftEndTs.ToString());
  45. TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
  46. long curTs = Convert.ToInt64(ts.TotalSeconds);
  47. if (starTs <= curTs && curTs < endTs)
  48. {
  49. if (this.p.shopdata.limitTsRewardsList.Contains(this.giftId))
  50. {
  51. return Enum_FirstRechargeState.ReceivePrize;
  52. }
  53. else
  54. {
  55. return Enum_FirstRechargeState.ReceivePrize;
  56. }
  57. }
  58. return Enum_FirstRechargeState.NoFirstRecharge;//没有在推送限时活动礼包的时间里
  59. //if (this.p.payInfo.firstRechage == 0 && this.player.baseInfo.charge_amt <= 0)
  60. //{
  61. // return Enum_FirstRechargeState.NoFirstRecharge;
  62. //}
  63. //else if (this.player.payInfo.firstRechage == 0 && this.player.baseInfo.charge_amt > 0)
  64. //{
  65. // return Enum_FirstRechargeState.NoReceivePrize;
  66. //}
  67. //return Enum_FirstRechargeState.ReceivePrize;
  68. }
  69. }
  70. /// <summary>
  71. /// 当前时间
  72. /// </summary>
  73. public long curTs
  74. {
  75. get
  76. {
  77. TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
  78. long curTs = Convert.ToInt64(ts.TotalSeconds);
  79. return curTs;
  80. }
  81. }
  82. /// <summary>
  83. /// 活动礼包开始时间
  84. /// </summary>
  85. public long starTs
  86. {
  87. get
  88. {
  89. long starTs = long.Parse(GameConfigData.Ins.globalsettings.limitTsActiveGiftStartTs.ToString());
  90. return starTs;
  91. }
  92. }
  93. /// <summary>
  94. /// 礼包信息
  95. /// </summary>
  96. public List<ItemVo> reward
  97. {
  98. get
  99. {
  100. return ItemVo.ParsItemContentStr(this.mo.reward);
  101. }
  102. }
  103. public sm_shop_limit mo
  104. {
  105. get
  106. {
  107. return GameConfigData.Ins.Getshop_limitMo(this.giftId);
  108. }
  109. }
  110. }
  111. /// <summary>
  112. /// 限时随机礼包
  113. /// </summary>
  114. public class LimitTsRandGiftVo
  115. {
  116. public LimitTsRandGiftVo()
  117. {
  118. }
  119. private readonly Player p = UserProxy.Instance.player;
  120. public class RandGiftVo
  121. {
  122. public int giftId { get; set; }
  123. }
  124. /// <summary>
  125. ///
  126. /// </summary>
  127. public Enum_FirstRechargeState State
  128. {
  129. get
  130. {
  131. if (this.p.triggerLimitTsGift.Count == 0)
  132. {
  133. return Enum_FirstRechargeState.NoFirstRecharge;
  134. }
  135. TimeSpan ts = DateTime.Now - new DateTime(1970, 1, 1, 0, 0, 0, 0);
  136. long curTs = Convert.ToInt64(ts.TotalSeconds);
  137. List<Ins_Gift> list = this.p.triggerLimitTsGift;
  138. //foreach (Ins_Gift item in list)
  139. //{
  140. // item.startTs;
  141. //}
  142. return Enum_FirstRechargeState.NoFirstRecharge;
  143. }
  144. }
  145. }