AuctionItemModel.cs 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Newtonsoft.Json.Linq;
  5. using System;
  6. public class AuctionItemModel
  7. {
  8. /// <summary>
  9. /// 拍品uid,这是 uid
  10. /// </summary>
  11. public int itemid { get; set; }
  12. /**
  13. * 分区id
  14. * @var type
  15. */
  16. public int zoneid { get; set; }
  17. /**
  18. * 物品内容
  19. * @var string "itemid,num;itemid,num;..."
  20. */
  21. public string contents { get; set; } /// 物品内容
  22. /**
  23. * 消耗类型----废弃
  24. * @var type
  25. */
  26. public int costType{ get; set; }/// 消耗类型
  27. /**
  28. * 起拍价
  29. * @var int
  30. */
  31. public int startprice{ get; set; }
  32. /// <summary>
  33. /// 一口价
  34. /// </summary>
  35. public int buyoutPrice { get; set; }
  36. /**
  37. * 加价幅度(每次加价不得低于加价幅度,高于加价幅度可以自由出价)
  38. * @var int
  39. */
  40. public int addstep { get; set; }
  41. /**
  42. * 标签1
  43. * @var type
  44. */
  45. public string tag1 { get; set; } //标签1
  46. /**
  47. * 标签2
  48. * @var type
  49. */
  50. public string tag2 { get; set; } //标签2
  51. // ---- 运行时字段 -----
  52. /**
  53. * 开始时间
  54. * @var int
  55. */
  56. public int startts { get; set; }
  57. /**
  58. * 结束时间
  59. * @var int
  60. */
  61. public int endts { get; set; }
  62. public string sellerid { get; set; } /// 卖家ID
  63. public string sellername { get; set; } /// 卖家昵称
  64. /**
  65. *
  66. * 竞价历史
  67. * @var object:{ts:{oid:"",name:"",price:""},ts2:{...}}
  68. */
  69. public string auchistory { get; set; }
  70. /**
  71. * 当前最高出价
  72. * @var int
  73. */
  74. public int currprice { get; set; }
  75. public string currpeopleid { get; set; } /// 当前最高价者ID
  76. public string currpeoplename { get; set; } /// 当前最高价者昵称
  77. public string result { get; set; } ///拍卖结果, 结算以后会有:成交,流拍
  78. /// <summary>
  79. /// 拍品id
  80. /// </summary>
  81. public int id
  82. {
  83. get
  84. {
  85. if (this.contents != string.Empty)
  86. {
  87. string[] sList = this.contents.Split(',');
  88. return int.Parse(sList[0]);
  89. }
  90. return 0;
  91. }
  92. }
  93. /// <summary>
  94. /// 拍品id--num
  95. /// </summary>
  96. public int num
  97. {
  98. get
  99. {
  100. if (this.contents != string.Empty)
  101. {
  102. string[] sList = this.contents.Split(',');
  103. return int.Parse(sList[1]);
  104. }
  105. return 0;
  106. }
  107. }
  108. /// <summary>
  109. /// 拍品mo
  110. /// </summary>
  111. public sm_item_base itemMo
  112. {
  113. get
  114. {
  115. return sm_item_base.GetMoById(this.id);
  116. }
  117. }
  118. /// <summary>
  119. /// 竞拍中的标志 true:有该标志
  120. /// </summary>
  121. public bool isAuctionIng
  122. {
  123. get
  124. {
  125. if (this.currpeopleid != string.Empty)
  126. {
  127. return true;
  128. }
  129. return false;
  130. }
  131. }
  132. /// <summary>
  133. /// 最新出价是否是自己;true:是自己,false:不是自己是别人
  134. /// </summary>
  135. public bool isfirst
  136. {
  137. get
  138. {
  139. if (this.currpeopleid == UserProxy.Instance.player.uid)
  140. {
  141. return true;
  142. }
  143. return false;
  144. }
  145. }
  146. public void Initlize(JToken data)
  147. {
  148. Utils.LoadObject(data, this);
  149. }
  150. }