WalletCashOutData.ts 2.0 KB

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