GameModelComp.ts 6.7 KB

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