RedBagCashData.ts 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. import { Data } from "../../../mk/data/Data";
  2. import { GameProp } from "../GameData";
  3. /**
  4. * 红包提现数据
  5. * - 跨Index不可提现,提示:请按顺序提现。
  6. * @author 薛鸿潇
  7. */
  8. export class RedBagCashData extends Data {
  9. /**
  10. * 数据初始化
  11. */
  12. public init() {
  13. // 签到配置表
  14. this.initCData();
  15. if (gData.gameData.configs.cashcfg) {
  16. gData.gameData.configs.cashcfg.forEach(item_data => {
  17. for (const key in item_data) {
  18. item_data[key] = parseInt(item_data[key])
  19. }
  20. });
  21. this.c_data = gData.gameData.configs.cashcfg;
  22. this.init_list = true;
  23. }
  24. this.cash_bar = gData.gameData.getProp(GameProp.redBag_cash_bar);
  25. }
  26. /** 标志位:初始化列表 */
  27. public init_list: boolean = false;
  28. /** 配置表数据 */
  29. public c_data: Array<CDataType> = [];
  30. /** 标志位:初始化指定列表 */
  31. /** 提现进度 */
  32. cash_bar: number = 0;
  33. /**
  34. * 提现操作
  35. */
  36. public cashOP() {
  37. this.cash_bar++;
  38. gData.gameData.setProp(GameProp.redBag_cash_bar, this.cash_bar);
  39. }
  40. /** 客户端造的假数据 */
  41. private initCData() {
  42. for (let i = 0; i < 20; i++) {
  43. const id = i + 1;
  44. let obj = {
  45. index: id,
  46. /** 毛币数量? */
  47. money: id,
  48. /** 红包数量 */
  49. type_value: id * 10000,
  50. time: id,
  51. directVideoTime: id,
  52. delayVideoTimes: id,
  53. money_type: id,
  54. num: id,
  55. moneyshow: id,
  56. summoney: id
  57. };
  58. this.c_data.push(obj)
  59. }
  60. this.init_list = true;
  61. }
  62. }
  63. /** 配置表数据内容 */
  64. export type CDataType = {
  65. /** id */
  66. index: number,
  67. /** 毛币数量,单位分 */
  68. money: number,
  69. /** 红包币数量 */
  70. type_value: number,
  71. time: number,
  72. directVideoTime: number,
  73. delayVideoTimes: number,
  74. money_type: number,
  75. num: number,
  76. moneyshow: number,
  77. summoney: number
  78. }