WalletCashOutData.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  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. gData.lineUpUIData.cashId = id;
  40. gData.lineUpUIData.refresh = true;
  41. mk.ui.openPanel("module/newNotice/lineUpUI");
  42. }
  43. return;
  44. }
  45. gData.gameData.gameData.redMoneyCashPayRecordList = response.data.redMoneyCashPayRecordList;
  46. this.init_cashOut = true;
  47. let cashData = gData.gameData.configs.CashCfg;
  48. if(cashData)
  49. {
  50. gData.gameData.gameData.redMoney -= cashData[id-1].redMoney;
  51. gData.receiptNotice.receip_rmb = cashData[id-1].money;
  52. mk.ui.openPanel('module/newNotice/newNotice');
  53. }
  54. }
  55. }