GameModelComp.ts 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405
  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-19 16:36:21
  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: number[]; //消除配置 用于展示惊喜翻倍弹窗
  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. interface doubleRewardInfo {
  64. showReward: goodsList[],
  65. handingChargeProgress: cost_info,
  66. levelProgress: levelProgress
  67. }
  68. //翻倍奖励进度信息
  69. interface levelProgress {
  70. nextProgress: number, //下一关提现点距离
  71. levelInfoList: levelInfo[]
  72. }
  73. interface levelInfo {
  74. level: number,
  75. eventType: string,
  76. withdraw: boolean,
  77. }
  78. interface loadBarInfo {
  79. levelProgress: levelProgress,
  80. wealCount: number //福利次数
  81. }
  82. /** 数据层对象 */
  83. @ecs.register('GameModel')
  84. export class GameModelComp extends ecs.Comp {
  85. id: number = -1;
  86. // /**手续费*/
  87. _handlingCharge: number = 0;
  88. /**当前分数*/
  89. _curScore: number = 0;
  90. /**目标分数*/
  91. _targetScore: number = 0;
  92. /**协议类型 1隐私 2用户*/
  93. _protocolType: number = 1;
  94. //当前关卡信息
  95. _curLevelInfo: CurLevelInfo = null!;
  96. /**当前关卡配置*/
  97. _curLevelConfig: CurLevelConfig = null!;
  98. /**游戏费用配置*/
  99. _costInfo: CostInfo = null!;
  100. //提现记录
  101. _recordList: RecordInfo[] = [];
  102. //是否是广告时间
  103. _isShowAd: boolean = false;
  104. /**激励广告价值*/
  105. _price: number = 0;
  106. /**看完广告是否发奖励*/
  107. _isDone: boolean = false;
  108. /**通关奖励*/
  109. _passViewInfo: PassViewInfo = null!;
  110. /**视频签名*/
  111. _sign: string = "";
  112. //改变的红包币数
  113. _changeHbCoin: number = 0;
  114. //微信币数
  115. _changeWxCoin: number = 0;
  116. /**页面类型*/
  117. _viewType: string = ""; //1翻倍 2通关 3加速 4复活
  118. /**提现必反*/
  119. _cashNum: number = 0;
  120. //微信提现页金钱
  121. _txNum: number = 0;
  122. //事件类型 WITHDRAW_POINT-提现点 SIGN_POINT--预约登记 --PROCEDURE_POINT手续费
  123. _eventType: string = "";
  124. /**提现方式 1正常提现 2红包币提现,不要打开提现返利*/
  125. _txType: number = 1;
  126. //微信提现页信息
  127. _wechat_tx_info: wechat_tx_info = null!;
  128. //红包提现页信息
  129. _wxCash: number = 0;
  130. _taskList: taskList_info = null!;
  131. //2倍速时长
  132. _doubleSpeedTime: number = 0;
  133. _doubleRewardInfo: doubleRewardInfo = null!;
  134. _loadBarInfo: loadBarInfo = null!;
  135. _popupType: string = "";
  136. /** 数据层组件移除时,重置所有数据为默认值 */
  137. reset() {
  138. this.id = -1;
  139. this.protocolType = 1;
  140. this.curLevelInfo = null!;
  141. this.curLevelConfig = null!;
  142. this.costInfo = null!;
  143. }
  144. set popupType(v: string) {
  145. this._popupType = v;
  146. }
  147. get popupType() {
  148. return this._popupType;
  149. }
  150. get doubleSpeedTime() {
  151. return this._doubleSpeedTime;
  152. }
  153. set doubleSpeedTime(value: number) {
  154. this._doubleSpeedTime = value;
  155. }
  156. set wxCash(v: number) {
  157. this._wxCash = v;
  158. }
  159. get wxCash() {
  160. return this._wxCash;
  161. }
  162. set taskList(v: taskList_info) {
  163. this._taskList = v;
  164. }
  165. get taskList() {
  166. return this._taskList;
  167. }
  168. set wechat_tx_info(value: wechat_tx_info) {
  169. this._wechat_tx_info = value;
  170. }
  171. get wechat_tx_info() {
  172. return this._wechat_tx_info;
  173. }
  174. set eventType(v: string) {
  175. this._eventType = v;
  176. }
  177. get eventType() {
  178. return this._eventType;
  179. }
  180. set txType(v: number) {
  181. this._txType = v;
  182. }
  183. get txType() {
  184. return this._txType;
  185. }
  186. //提现成功的金额
  187. set txNum(v: number) {
  188. this._txNum = v;
  189. }
  190. get txNum() {
  191. return this._txNum;
  192. }
  193. /**改变的红包币*/
  194. set changeHbCoin(value: number) {
  195. this._changeHbCoin = value;
  196. }
  197. get changeHbCoin() {
  198. return this._changeHbCoin;
  199. }
  200. set changeWxCoin(v: number) {
  201. this._changeWxCoin = v;
  202. }
  203. get changeWxCoin() {
  204. return this._changeWxCoin;
  205. }
  206. set viewType(value: string) {
  207. this._viewType = value;
  208. }
  209. get viewType() {
  210. return this._viewType;
  211. }
  212. set price(value: number) {
  213. this._price = value;
  214. }
  215. get price() {
  216. return this._price;
  217. }
  218. set isDone(value: boolean) {
  219. this._isDone = value;
  220. }
  221. get isDone() {
  222. return this._isDone;
  223. }
  224. set sign(value: string) {
  225. this._sign = value;
  226. }
  227. get sign() {
  228. return this._sign;
  229. }
  230. get handlingCharge() {
  231. return this._handlingCharge;
  232. }
  233. set handlingCharge(value: number) {
  234. this._handlingCharge = value;
  235. }
  236. set curScore(value: number) {
  237. this._curScore = value;
  238. }
  239. get curScore() {
  240. return this._curScore;
  241. }
  242. get targetScore() {
  243. return this._targetScore;
  244. }
  245. set targetScore(value: number) {
  246. this._targetScore = value;
  247. }
  248. get protocolType() {
  249. return this._protocolType;
  250. }
  251. set protocolType(value: number) {
  252. this._protocolType = value;
  253. }
  254. get curLevelInfo() {
  255. return this._curLevelInfo;
  256. }
  257. set curLevelInfo(value: CurLevelInfo) {
  258. this._curLevelInfo = value;
  259. }
  260. get curLevelConfig() {
  261. return this._curLevelConfig;
  262. }
  263. set curLevelConfig(value: CurLevelConfig) {
  264. this._curLevelConfig = value;
  265. }
  266. get costInfo() {
  267. return this._costInfo;
  268. }
  269. set costInfo(value: CostInfo) {
  270. this._costInfo = value;
  271. }
  272. get recordList() {
  273. return this._recordList;
  274. }
  275. set recordList(value: RecordInfo[]) {
  276. this._recordList = value;
  277. }
  278. get isShowAd() {
  279. return this._isShowAd;
  280. }
  281. set isShowAd(value: boolean) {
  282. this._isShowAd = value
  283. }
  284. get passViewInfo() {
  285. return this._passViewInfo;
  286. }
  287. set passViewInfo(value: PassViewInfo) {
  288. this._passViewInfo = value;
  289. }
  290. set cashNum(value: number) {
  291. this._cashNum = value;
  292. }
  293. get cashNum() {
  294. return this._cashNum;
  295. }
  296. //翻倍
  297. set doubleRewardInfo(value: doubleRewardInfo) {
  298. this._doubleRewardInfo = value;
  299. }
  300. get doubleRewardInfo() {
  301. return this._doubleRewardInfo;
  302. }
  303. //进度条奖励
  304. set loadbarInfo(v: loadBarInfo) {
  305. this._loadBarInfo = v;
  306. }
  307. get loadbarInfo() {
  308. return this._loadBarInfo;
  309. }
  310. }