voucher.js 749 B

12345678910111213141516171819202122232425
  1. import request from './request.js';
  2. const getList = async (data) => {
  3. const res = await request.get({ url: `/discount/info/list`, data });
  4. return res.data;
  5. }
  6. const getInfo = async (id) => {
  7. const res = await request.get({ url: `/discount/info/${id}` });
  8. return res.data;
  9. }
  10. const receivevoucher = async (discountId) => {
  11. const res = await request.post({ url: `/discount/receive/${discountId}` });
  12. return res.data;
  13. }
  14. const getMyList = async (data) => {
  15. const res = await request.get({ url: `/discount/record/list` });
  16. return res.data;
  17. }
  18. const getDict = async (dictType) => {
  19. const res = await request.get({ url: `/dict/data/type/${dictType}` });
  20. return res.data;
  21. }
  22. export default { getList, getInfo, receivevoucher, getMyList, getDict };