WalletCashOutData.ts 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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.cashNormal.getRecord();
  32. gData.gameData.doPointToXYLogic();
  33. //gData.gameData.addCashOutTimes();
  34. }
  35. async addProgress() {
  36. let data = {};
  37. let response = await mk.http.sendData('noviceWeFare/updateNoviceWeFareInfo', data);
  38. if (response.errcode != 0) {
  39. return;
  40. }
  41. gData.gameData.playerProp.userNoviceWeFareInfo = response.data.userNoviceWeFareInfo;
  42. mk.tip.pop('现金进度已增加');
  43. this.init_novice = true;
  44. }
  45. async HttpCashOut2(id: number) {
  46. // gData.cashPro.openCashPro(0);
  47. this.curID = id;
  48. let data = { index: id };
  49. let response = await mk.http.sendData('redMoney/cashPay', data);
  50. mk.console.logSingle('wallet2=>', response);
  51. if (response.errcode != 0) {
  52. if(response.errcode == 405)
  53. {
  54. mk.tip.pop("今日提现额度已到上限,请明天再提现");
  55. mk.data.sendDataEvent(DataEventId.cashLimit, "提现触发上限");
  56. return;
  57. }
  58. if (response.data.count > 0) {
  59. // gData.cashPro.init_fail = true;
  60. gData.lineUpUIData.personCount = response.data.count;
  61. gData.lineUpUIData.cashId = id;
  62. gData.lineUpUIData.refresh = true;
  63. gData.lineUpUIData.popType = 0;
  64. mk.ui.openPanel("module/newNotice/lineUpUI");
  65. mk.data.sendDataEvent(DataEventId.queue, '触发插队人数');
  66. }
  67. return;
  68. }else{
  69. mk.ui.closePanel("lineUpUI");
  70. }
  71. gData.gameData.playerProp.redMoneyCashPayRecordList = response.data.redMoneyCashPayRecordList;
  72. this.init_cashOut = true;
  73. let cashData = gData.gameData.configs.CashCfg;
  74. if (cashData) {
  75. gData.gameData.playerProp.redMoney -= cashData[id - 1].redMoney;
  76. // gData.cashPro.cashPro_money = cashData[id - 1].money;
  77. // gData.cashPro.init_success = true;
  78. gData.receiptNotice.receip_rmb = cashData[id - 1].money;
  79. mk.ui.openPanel('module/newNotice/newNotice');
  80. }
  81. //gData.safeDepositBoxData.updateQipao();
  82. gData.cashNormal.getRecord();
  83. mk.data.sendDataEvent(DataEventId.Sundry, '红包币提现成功');
  84. gData.gameData.doPointToXYLogic();
  85. //gData.gameData.addCashOutTimes();
  86. }
  87. }