cashWheel.ts 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. import { server } from "@/utils/client";
  2. export interface Activity {
  3. /**
  4. * ID 编号
  5. */
  6. id: number;
  7. /**
  8. * 活动名称
  9. */
  10. name: string;
  11. /**
  12. * 渠道管理配置
  13. */
  14. share_configs: ShareConfig[];
  15. /**
  16. * 分享渠道开关
  17. */
  18. share_enable: string;
  19. /**
  20. * 分享手机号开关1 开启 2 关闭
  21. */
  22. share_phone_enable: 1 | 2;
  23. // 短信内容
  24. note: string;
  25. }
  26. export interface ShareConfig {
  27. icon: string;
  28. id: string;
  29. name: string;
  30. url: string;
  31. }
  32. export interface WheelsType {
  33. /**
  34. * 正在进行的转盘活动
  35. */
  36. activate: Activate;
  37. activities: Activity[];
  38. not_receive: NotReceive[];
  39. total: number;
  40. num: number;
  41. }
  42. /**
  43. * 正在进行的转盘活动
  44. */
  45. export interface Activate {
  46. /**
  47. * 转盘基金余额
  48. */
  49. amount: number;
  50. /**
  51. * 截止时间
  52. */
  53. end_time: number;
  54. history: History[];
  55. can: 0 | 1;
  56. // 倒计时
  57. count_down: number;
  58. }
  59. export interface History {
  60. /**
  61. * 增加的金额
  62. */
  63. amount: number;
  64. /**
  65. * 时间
  66. */
  67. time: number;
  68. /**
  69. * 获取来源 1 初始化 2 玩转盘 3 邀请下载
  70. */
  71. type: number;
  72. }
  73. export interface NotReceive {
  74. /**
  75. * 领取ID
  76. */
  77. unique_id: string;
  78. }
  79. /**
  80. * 启动转盘
  81. * POST /v1/api/user/turntable/run
  82. * 接口ID:237904502
  83. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-237904502
  84. */
  85. export interface RunType {
  86. index: number;
  87. amount: number;
  88. }
  89. export const getWheelRunApi = (data: { activity_id: number }) => {
  90. return server.post<RunType>({
  91. url: "/v1/api/user/turntable/run",
  92. data,
  93. });
  94. };
  95. /**
  96. * @description 获取转盘信息
  97. */
  98. export interface WheelComboType extends Activate, Activity {}
  99. export const getWheelApi = () => {
  100. return server.request<WheelsType>({
  101. url: "/v1/api/user/turntable/info",
  102. method: "post",
  103. data: {},
  104. });
  105. };
  106. /**
  107. * 领取转盘奖励
  108. * POST /v1/api/user/turntable/receive
  109. * 接口ID:237883491
  110. * 接口地址:https://app.apifox.com/link/project/4790544/apis/api-237883491
  111. */
  112. export const getWheelReceiveApi = (data: { unique_id: string }) => {
  113. return server.post({
  114. url: "/v1/api/user/turntable/receive",
  115. data,
  116. });
  117. };