GameModelComp.ts 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345
  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-16 10:58:34
  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. //2倍速时长
  111. _doubleSpeedTime: number = 0;
  112. /** 数据层组件移除时,重置所有数据为默认值 */
  113. reset() {
  114. this.id = -1;
  115. this.protocolType = 1;
  116. this.curLevelInfo = null!;
  117. this.curLevelConfig = null!;
  118. this.costInfo = null!;
  119. }
  120. get doubleSpeedTime() {
  121. return this._doubleSpeedTime;
  122. }
  123. set doubleSpeedTime(value: number) {
  124. this._doubleSpeedTime = value;
  125. }
  126. set wxCash(v: number) {
  127. this._wxCash = v;
  128. }
  129. get wxCash() {
  130. return this._wxCash;
  131. }
  132. set taskList(v: taskList_info) {
  133. this._taskList = v;
  134. }
  135. get taskList() {
  136. return this._taskList;
  137. }
  138. set wechat_tx_info(value: wechat_tx_info) {
  139. this._wechat_tx_info = value;
  140. }
  141. get wechat_tx_info() {
  142. return this._wechat_tx_info;
  143. }
  144. set eventType(v: string) {
  145. this._eventType = v;
  146. }
  147. get eventType() {
  148. return this._eventType;
  149. }
  150. set txType(v: number) {
  151. this._txType = v;
  152. }
  153. get txType() {
  154. return this._txType;
  155. }
  156. //提现成功的金额
  157. set txNum(v: number) {
  158. this._txNum;
  159. }
  160. get txNum() {
  161. return this._txNum;
  162. }
  163. /**改变的红包币*/
  164. set changeHbCoin(value: number) {
  165. this._changeHbCoin = value;
  166. }
  167. get changeHbCoin() {
  168. return this._changeHbCoin;
  169. }
  170. set changeWxCoin(v: number) {
  171. this._changeWxCoin = v;
  172. }
  173. get changeWxCoin() {
  174. return this._changeWxCoin;
  175. }
  176. set viewType(value: string) {
  177. this._viewType = value;
  178. }
  179. get viewType() {
  180. return this._viewType;
  181. }
  182. set price(value: number) {
  183. this._price = value;
  184. }
  185. get price() {
  186. return this._price;
  187. }
  188. set isDone(value: boolean) {
  189. this._isDone = value;
  190. }
  191. get isDone() {
  192. return this._isDone;
  193. }
  194. set sign(value: string) {
  195. this._sign = value;
  196. }
  197. get sign() {
  198. return this._sign;
  199. }
  200. get handlingCharge() {
  201. return this._handlingCharge;
  202. }
  203. set handlingCharge(value: number) {
  204. this._handlingCharge = value;
  205. }
  206. set curScore(value: number) {
  207. this._curScore = value;
  208. }
  209. get curScore() {
  210. return this._curScore;
  211. }
  212. get targetScore() {
  213. return this._targetScore;
  214. }
  215. set targetScore(value: number) {
  216. this._targetScore = value;
  217. }
  218. get protocolType() {
  219. return this._protocolType;
  220. }
  221. set protocolType(value: number) {
  222. this._protocolType = value;
  223. }
  224. get curLevelInfo() {
  225. return this._curLevelInfo;
  226. }
  227. set curLevelInfo(value: CurLevelInfo) {
  228. this._curLevelInfo = value;
  229. }
  230. get curLevelConfig() {
  231. return this._curLevelConfig;
  232. }
  233. set curLevelConfig(value: CurLevelConfig) {
  234. this._curLevelConfig = value;
  235. }
  236. get costInfo() {
  237. return this._costInfo;
  238. }
  239. set costInfo(value: CostInfo) {
  240. this._costInfo = value;
  241. }
  242. get recordList() {
  243. return this._recordList;
  244. }
  245. set recordList(value: RecordInfo[]) {
  246. this._recordList = value;
  247. }
  248. get isShowAd() {
  249. return this._isShowAd;
  250. }
  251. set isShowAd(value: boolean) {
  252. this._isShowAd = value
  253. }
  254. get passViewInfo() {
  255. return this._passViewInfo;
  256. }
  257. set passViewInfo(value: PassViewInfo) {
  258. this._passViewInfo = value;
  259. }
  260. set cashNum(value: number) {
  261. this._cashNum = value;
  262. }
  263. get cashNum() {
  264. return this._cashNum;
  265. }
  266. }