WalletCashOutData.ts 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. /**
  2. * @description 提现数据
  3. */
  4. import { Data } from "../../../mk/data/Data";
  5. import { AdFun } from "../AdData";
  6. import { DataEventId } from "../GameData";
  7. export class WalletCashOutData extends Data {
  8. public init_novice = false;
  9. public init_cashOut = false;
  10. public curID = 0;
  11. public async HttpCashOut(value: number) {
  12. // gData.cashPro.openCashPro(value);
  13. let data = {};
  14. let response = await mk.http.sendData('noviceWeFare/noviceWeFareCash', data);
  15. mk.console.logSingle('wallet1=>', response);
  16. if (response.errcode != 0) {
  17. // gData.cashPro.init_fail = true;
  18. if(response.errcode == 405)
  19. {
  20. mk.tip.pop("今日提现额度已到上限,请明天再提现");
  21. mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
  22. }
  23. return null;
  24. }
  25. this.init_novice = true;
  26. gData.gameData.playerProp.userNoviceWeFareInfo = response.data.userNoviceWeFareInfo;
  27. // gData.cashPro.init_success = true;
  28. gData.receiptNotice.receip_rmb = value;
  29. mk.ui.openPanel('module/newNotice/newNotice');
  30. gData.safeDepositBoxData.updateQipao();
  31. gData.gameData.doPointToXYLogic();
  32. //gData.gameData.addCashOutTimes();
  33. }
  34. async addProgress() {
  35. let data = {};
  36. let response = await mk.http.sendData('noviceWeFare/updateNoviceWeFareInfo', data);
  37. if (response.errcode != 0) {
  38. return;
  39. }
  40. gData.gameData.playerProp.userNoviceWeFareInfo = response.data.userNoviceWeFareInfo;
  41. mk.tip.pop('现金进度已增加');
  42. this.init_novice = true;
  43. }
  44. async HttpCashOut2(id: number) {
  45. // gData.cashPro.openCashPro(0);
  46. this.curID = id;
  47. let data = { index: id };
  48. let response = await mk.http.sendData('redMoney/cashPay', data);
  49. mk.console.logSingle('wallet2=>', response);
  50. if (response.errcode != 0) {
  51. if(response.errcode == 405)
  52. {
  53. mk.tip.pop("今日提现额度已到上限,请明天再提现");
  54. mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
  55. return;
  56. }
  57. if (response.data.count > 0) {
  58. // gData.cashPro.init_fail = true;
  59. gData.lineUpUIData.personCount = response.data.count;
  60. gData.lineUpUIData.cashId = id;
  61. gData.lineUpUIData.refresh = true;
  62. gData.lineUpUIData.popType = 0;
  63. mk.ui.openPanel("module/newNotice/lineUpUI");
  64. mk.data.sendDataEvent(DataEventId.queue, '触发插队人数');
  65. }
  66. return;
  67. }else{
  68. mk.ui.closePanel("lineUpUI");
  69. }
  70. gData.gameData.playerProp.redMoneyCashPayRecordList = response.data.redMoneyCashPayRecordList;
  71. this.init_cashOut = true;
  72. let cashData = gData.gameData.configs.CashCfg;
  73. if (cashData) {
  74. gData.gameData.playerProp.redMoney -= cashData[id - 1].redMoney;
  75. // gData.cashPro.cashPro_money = cashData[id - 1].money;
  76. // gData.cashPro.init_success = true;
  77. gData.receiptNotice.receip_rmb = cashData[id - 1].money;
  78. mk.ui.openPanel('module/newNotice/newNotice');
  79. }
  80. gData.safeDepositBoxData.updateQipao();
  81. mk.data.sendDataEvent(DataEventId.Sundry, '红包币提现成功');
  82. gData.gameData.doPointToXYLogic();
  83. //gData.gameData.addCashOutTimes();
  84. }
  85. }