CashProData.ts 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. /**
  2. * @description 提现数据类
  3. * @author kaka
  4. */
  5. import { Data } from "../../../mk/data/Data";
  6. import { DataEventId } from "../GameData";
  7. export default class CashProData extends Data {
  8. init_data = false;
  9. cashPro_type: cashProType;
  10. cashPro_money = 0;
  11. init_success = false;
  12. init_fail = false;
  13. openCashPro(type: cashProType, money) {
  14. this.cashPro_type = type;
  15. this.cashPro_money = money;
  16. this.init_data = true;
  17. mk.ui.openPanel('module/cashPro/cashPro');
  18. }
  19. async onCash() {
  20. let response = null;
  21. switch (this.cashPro_type) {
  22. case cashProType.blessing_bigCash:
  23. response = await gData.blessingBag.HttpCashBig();
  24. if (response && response.data.code == 1) {
  25. gData.cashPro.init_success = true;
  26. mk.data.sendDataEvent(DataEventId.fudaiFunction, `视频红包大额提现第${gData.blessingBag.taskRbId}档领取成功`)
  27. }
  28. break;
  29. case cashProType.blessing_taskCash:
  30. response = await gData.blessingBag.HttpCashTask();
  31. if (response && response.data.code == 1) {
  32. gData.cashPro.init_success = true;
  33. mk.data.sendDataEvent(DataEventId.fudaiFunction, `视频红包第${gData.blessingBag.taskRbId}档领取成功`)
  34. }
  35. break;
  36. }
  37. gData.cashNormal.getRecord();// 请求新的提现记录
  38. }
  39. }
  40. /** 提现类型枚举 */
  41. export enum cashProType {
  42. blessing_bigCash, //福袋大额红包提现
  43. blessing_taskCash, //福袋任务提现
  44. }