CashNormalData.ts 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107
  1. import { Data } from "../../../mk/data/Data";
  2. /**
  3. * 红包提现数据
  4. * @author 薛鸿潇
  5. */
  6. export class CashNormalData extends Data {
  7. public init() {
  8. // this.initTestData();// 假数据
  9. // 提现记录数据
  10. this.getRecord()
  11. }
  12. public async getRecord() {
  13. let response = await mk.http.sendData('getCashRecord', {});
  14. if (response.errcode != 0) {
  15. return;
  16. }
  17. console.log(response.data);
  18. if (response.data.CashStatusList) {
  19. response.data.CashStatusList.forEach(item_data => {
  20. for (const key in item_data) {
  21. item_data[key] = parseInt(item_data[key])
  22. }
  23. });
  24. this.list_data = response.data.CashStatusList;
  25. }
  26. }
  27. /** 数据列表 */
  28. public list_data: Array<TCashList> = [];
  29. /**
  30. * 标志位 - 是否刷新样式
  31. */
  32. public init_rmb_style = true;
  33. private _receip_total_rmb: number = 0;
  34. /**
  35. * 到账毛币总数
  36. * - 单位 分
  37. */
  38. set receip_total_rmb(value: number) {
  39. this._receip_total_rmb = value;
  40. this.init_rmb_style = true;
  41. }
  42. get receip_total_rmb() {
  43. return this._receip_total_rmb;
  44. }
  45. /** 提现类型 */
  46. public cash_type = ['', 'BOSS提现', '每日提现', '夺宝提现', '钱庄提现', '招募任务提现', '每日招募提现', '累计招募提现', '', '彩蛋提现', '福袋提现', '福袋提现'];
  47. /** 客户端造 假数据 */
  48. private initTestData() {
  49. for (let i = 0; i < 30; i++) {
  50. const id = i + 1;
  51. let obj = {
  52. /** 档位 */
  53. cashType: mk.math.random(1, 10),
  54. applyTime: 1623399160,
  55. amount: i * 10,
  56. remain: i * 1000,
  57. CashMode: i % 2,
  58. /** 红包码 */
  59. withdrawalCode: 'AABBC' + i,
  60. }
  61. this.list_data.push(obj);
  62. }
  63. }
  64. /**
  65. * 获取存在红包码的 数据列表
  66. */
  67. public getListDataHavCode() {
  68. let new_list_data = [];
  69. const l_count = this.list_data.length;
  70. for (let i = 0; i < l_count; i++) {
  71. if (this.list_data[i].withdrawalCode) {
  72. new_list_data.push(this.list_data[i]);
  73. }
  74. }
  75. return new_list_data;
  76. }
  77. }
  78. /**
  79. * 提现记录类型
  80. */
  81. export type TCashList = {
  82. /**
  83. * 提现类型
  84. */
  85. cashType: number,
  86. /** 提现时间 */
  87. applyTime: number,
  88. /** 提现金额,单位分 */
  89. amount: number,
  90. /** 剩余红包币,1元===10000红包币 */
  91. remain: number,
  92. /** 2:有红包码,其他无红包码 */
  93. CashMode: number,
  94. /** 红包码 */
  95. withdrawalCode: string,
  96. }
  97. export enum ECashType {
  98. assss = 1,
  99. }