wallet.ts 854 B

123456789101112131415161718192021222324252627282930
  1. import { get, post } from './http';
  2. const apis = {
  3. PRE_ONE_KEY: '/api/substituteOrder/preOneKeySubmit',
  4. COUPON: '/api/coupon/pageMyValidCoupon',
  5. BILL: '/api/wallet/bill',
  6. };
  7. export const preOneKeySubmit = async () => {
  8. const res = await post(apis.PRE_ONE_KEY);
  9. return res;
  10. };
  11. export const info = async (type: string, loading = false) => {
  12. const res = await get('/api/wallet/getByType', { type }, { loading });
  13. return res.data;
  14. };
  15. export default {
  16. preOneKeySubmit,
  17. info,
  18. coupons: async (size = 30) => {
  19. const res = await post(apis.COUPON, { size }, { loading: true });
  20. return res.data;
  21. },
  22. bill: async (current: number, size: number, walletType: string, type: string) => {
  23. const res = await post(apis.BILL, { current, size, walletType, type });
  24. return res.data;
  25. },
  26. };