GameModelComp.ts 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337
  1. /*
  2. * @Author: mojunshou 1637302775@qq.com
  3. * @Date: 2025-04-10 14:49:42
  4. * @LastEditors: mojunshou 1637302775@qq.com
  5. * @LastEditTime: 2025-04-15 17:01:42
  6. * @Description:
  7. */
  8. import { ecs } from "db://oops-framework/libs/ecs/ECS";
  9. interface CurLevelInfo {
  10. level: number;
  11. score: number;
  12. }
  13. interface CurLevelConfig {
  14. level: number; //当前关卡
  15. score: number; //当前关卡目标分数
  16. skipCount: number; //当前关卡跳过次数
  17. eliminateScope: []; //消除配置 用于展示惊喜翻倍弹窗
  18. eventType: string //消除配置
  19. }
  20. //费用配置
  21. interface CostInfo {
  22. handlingCharge: number; //处理费
  23. giftNum: number; //赠送金
  24. }
  25. //提现记录
  26. interface RecordInfo {
  27. title: string,
  28. amount: number,
  29. payMethod: number,
  30. createTime: number,
  31. successTime: number,
  32. status: number
  33. }
  34. interface goodsList {
  35. propId: string,
  36. propNum: number
  37. }
  38. interface PassViewInfo {
  39. showReward: goodsList[]
  40. doubleReward: boolean
  41. }
  42. //微信提现页信息
  43. interface wechat_tx_info {
  44. money: number, //已有金额
  45. gapGoldNum: number, //差多少金砖
  46. handingChargeProgress: cost_info
  47. }
  48. //手续费信息
  49. interface cost_info {
  50. totalMoney: number, //已有金额
  51. handingCharge: number, //设置的手续费
  52. hasNum: number, //已经有
  53. gapNum: number, //还差
  54. }
  55. //红包币提现页信息
  56. interface taskList_info {
  57. level: number,
  58. target: number,
  59. reward: goodsList[],
  60. status: number
  61. }
  62. /** 数据层对象 */
  63. @ecs.register('GameModel')
  64. export class GameModelComp extends ecs.Comp {
  65. id: number = -1;
  66. // /**手续费*/
  67. _handlingCharge: number = 0;
  68. /**当前分数*/
  69. _curScore: number = 0;
  70. /**目标分数*/
  71. _targetScore: number = 0;
  72. /**协议类型 1隐私 2用户*/
  73. _protocolType: number = 1;
  74. //当前关卡信息
  75. _curLevelInfo: CurLevelInfo = null!;
  76. /**当前关卡配置*/
  77. _curLevelConfig: CurLevelConfig = null!;
  78. /**游戏费用配置*/
  79. _costInfo: CostInfo = null!;
  80. //提现记录
  81. _recordList: RecordInfo[] = [];
  82. //是否是广告时间
  83. _isShowAd: boolean = false;
  84. /**激励广告价值*/
  85. _price: number = 0;
  86. /**看完广告是否发奖励*/
  87. _isDone: boolean = false;
  88. /**通关奖励*/
  89. _passViewInfo: PassViewInfo = null!;
  90. /**视频签名*/
  91. _sign: string = "";
  92. //改变的红包币数
  93. _changeHbCoin: number = 0;
  94. //微信币数
  95. _changeWxCoin: number = 0;
  96. /**页面类型*/
  97. _viewType: string = ""; //1翻倍 2通关 3加速 4复活
  98. /**提现必反*/
  99. _cashNum: number = 0;
  100. _txNum: number = 0;
  101. //事件类型 WITHDRAW_POINT-提现点 SIGN_POINT--预约登记 --PROCEDURE_POINT手续费
  102. _eventType: string = "";
  103. /**提现方式 1正常提现 2红包币提现,不要打开提现返利*/
  104. _txType: number = 1;
  105. //微信提现页信息
  106. _wechat_tx_info: wechat_tx_info = null!;
  107. //红包提现页信息
  108. _wxCash: number = 0;
  109. _taskList: taskList_info = null!;
  110. /** 数据层组件移除时,重置所有数据为默认值 */
  111. reset() {
  112. this.id = -1;
  113. this.protocolType = 1;
  114. this.curLevelInfo = null!;
  115. this.curLevelConfig = null!;
  116. this.costInfo = null!;
  117. }
  118. set wxCash(v: number) {
  119. this._wxCash = v;
  120. }
  121. get wxCash() {
  122. return this._wxCash;
  123. }
  124. set taskList(v: taskList_info) {
  125. this._taskList = v;
  126. }
  127. get taskList() {
  128. return this._taskList;
  129. }
  130. set wechat_tx_info(value: wechat_tx_info) {
  131. this._wechat_tx_info = value;
  132. }
  133. get wechat_tx_info() {
  134. return this._wechat_tx_info;
  135. }
  136. set eventType(v: string) {
  137. this._eventType = v;
  138. }
  139. get eventType() {
  140. return this._eventType;
  141. }
  142. set txType(v: number) {
  143. this._txType = v;
  144. }
  145. get txType() {
  146. return this._txType;
  147. }
  148. //提现成功的金额
  149. set txNum(v: number) {
  150. this._txNum;
  151. }
  152. get txNum() {
  153. return this._txNum;
  154. }
  155. /**改变的红包币*/
  156. set changeHbCoin(value: number) {
  157. this._changeHbCoin = value;
  158. }
  159. get changeHbCoin() {
  160. return this._changeHbCoin;
  161. }
  162. set changeWxCoin(v: number) {
  163. this._changeWxCoin = v;
  164. }
  165. get changeWxCoin() {
  166. return this._changeWxCoin;
  167. }
  168. set viewType(value: string) {
  169. this._viewType = value;
  170. }
  171. get viewType() {
  172. return this._viewType;
  173. }
  174. set price(value: number) {
  175. this._price = value;
  176. }
  177. get price() {
  178. return this._price;
  179. }
  180. set isDone(value: boolean) {
  181. this._isDone = value;
  182. }
  183. get isDone() {
  184. return this._isDone;
  185. }
  186. set sign(value: string) {
  187. this._sign = value;
  188. }
  189. get sign() {
  190. return this._sign;
  191. }
  192. get handlingCharge() {
  193. return this._handlingCharge;
  194. }
  195. set handlingCharge(value: number) {
  196. this._handlingCharge = value;
  197. }
  198. set curScore(value: number) {
  199. this._curScore = value;
  200. }
  201. get curScore() {
  202. return this._curScore;
  203. }
  204. get targetScore() {
  205. return this._targetScore;
  206. }
  207. set targetScore(value: number) {
  208. this._targetScore = value;
  209. }
  210. get protocolType() {
  211. return this._protocolType;
  212. }
  213. set protocolType(value: number) {
  214. this._protocolType = value;
  215. }
  216. get curLevelInfo() {
  217. return this._curLevelInfo;
  218. }
  219. set curLevelInfo(value: CurLevelInfo) {
  220. this._curLevelInfo = value;
  221. }
  222. get curLevelConfig() {
  223. return this._curLevelConfig;
  224. }
  225. set curLevelConfig(value: CurLevelConfig) {
  226. this._curLevelConfig = value;
  227. }
  228. get costInfo() {
  229. return this._costInfo;
  230. }
  231. set costInfo(value: CostInfo) {
  232. this._costInfo = value;
  233. }
  234. get recordList() {
  235. return this._recordList;
  236. }
  237. set recordList(value: RecordInfo[]) {
  238. this._recordList = value;
  239. }
  240. get isShowAd() {
  241. return this._isShowAd;
  242. }
  243. set isShowAd(value: boolean) {
  244. this._isShowAd = value
  245. }
  246. get passViewInfo() {
  247. return this._passViewInfo;
  248. }
  249. set passViewInfo(value: PassViewInfo) {
  250. this._passViewInfo = value;
  251. }
  252. set cashNum(value: number) {
  253. this._cashNum = value;
  254. }
  255. get cashNum() {
  256. return this._cashNum;
  257. }
  258. }