WalletCashOutData.ts 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /**
  2. * @description 提现数据
  3. */
  4. import { Data } from "../../../mk/data/Data";
  5. import { DataEventId } from "../GameData";
  6. export class WalletCashOutData extends Data {
  7. public init_novice = false;
  8. public init_cashOut = false;
  9. public curID = 0;
  10. public async HttpCashOut(value: number) {
  11. // gData.cashPro.openCashPro(value);
  12. let data = {};
  13. let response = await mk.http.sendData('noviceWeFare/noviceWeFareCash', data);
  14. mk.console.logSingle('wallet1=>', response);
  15. if (response.errcode != 0) {
  16. // gData.cashPro.init_fail = true;
  17. return null;
  18. }
  19. this.init_novice = true;
  20. gData.gameData.playerProp.userNoviceWeFareInfo = response.data.userNoviceWeFareInfo;
  21. // gData.cashPro.init_success = true;
  22. gData.receiptNotice.receip_rmb = value;
  23. mk.ui.openPanel('module/newNotice/newNotice');
  24. }
  25. async addProgress() {
  26. let data = {};
  27. let response = await mk.http.sendData('noviceWeFare/updateNoviceWeFareInfo', data);
  28. if (response.errcode != 0) {
  29. return;
  30. }
  31. gData.gameData.playerProp.userNoviceWeFareInfo = response.data.userNoviceWeFareInfo;
  32. mk.tip.pop('现金进度已增加');
  33. this.init_novice = true;
  34. }
  35. async HttpCashOut2(id: number) {
  36. // gData.cashPro.openCashPro(0);
  37. this.curID = id;
  38. let data = { index: id };
  39. let response = await mk.http.sendData('redMoney/cashPay', data);
  40. mk.console.logSingle('wallet2=>', response);
  41. if (response.errcode != 0) {
  42. if (response.data.count > 0) {
  43. // gData.cashPro.init_fail = true;
  44. gData.lineUpUIData.personCount = response.data.count;
  45. gData.lineUpUIData.cashId = id;
  46. gData.lineUpUIData.refresh = true;
  47. mk.ui.openPanel("module/newNotice/lineUpUI");
  48. }
  49. return;
  50. }else{
  51. mk.ui.closePanel("lineUpUI");
  52. }
  53. gData.gameData.playerProp.redMoneyCashPayRecordList = response.data.redMoneyCashPayRecordList;
  54. this.init_cashOut = true;
  55. let cashData = gData.gameData.configs.CashCfg;
  56. if (cashData) {
  57. gData.gameData.playerProp.redMoney -= cashData[id - 1].redMoney;
  58. // gData.cashPro.cashPro_money = cashData[id - 1].money;
  59. // gData.cashPro.init_success = true;
  60. gData.receiptNotice.receip_rmb = cashData[id - 1].money;
  61. mk.ui.openPanel('module/newNotice/newNotice');
  62. }
  63. mk.data.sendDataEvent(DataEventId.Sundry, '红包币提现成功');
  64. }
  65. }