sellerVoucher.js 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import { requestApi } from '../util/network'
  2. // 获取代金券列表
  3. export const getVoucherList =
  4. (params) =>
  5. requestApi(
  6. '/Sellervoucher/templatelist',
  7. 'POST',
  8. {
  9. page: params.page,
  10. per_page: params.per_page
  11. },
  12. 'seller'
  13. )
  14. // 获取代金券
  15. export const getVoucherInfo =
  16. (tid) =>
  17. requestApi(
  18. '/Sellervoucher/templateinfo',
  19. 'POST',
  20. {
  21. tid: tid
  22. },
  23. 'seller'
  24. )
  25. // 续期套餐
  26. export const addQuota =
  27. (quota_quantity) =>
  28. requestApi(
  29. '/Sellervoucher/quotaadd',
  30. 'POST',
  31. {
  32. 'quota_quantity': quota_quantity
  33. },
  34. 'seller'
  35. )
  36. // 获取公共数据
  37. export const getCommonData =
  38. () =>
  39. requestApi(
  40. '/Sellervoucher/get_common_data',
  41. 'POST',
  42. {
  43. },
  44. 'seller'
  45. )
  46. // 新增代金券
  47. export const addVoucher =
  48. (txt_template_title, txt_template_total, select_template_price, txt_template_limit, txt_template_describe, txt_template_enddate, storeclass_id, eachlimit) =>
  49. requestApi(
  50. '/Sellervoucher/templateadd',
  51. 'POST',
  52. {
  53. txt_template_title: txt_template_title,
  54. txt_template_total: txt_template_total,
  55. select_template_price: select_template_price,
  56. txt_template_limit: txt_template_limit,
  57. txt_template_describe: txt_template_describe,
  58. txt_template_enddate: txt_template_enddate,
  59. storeclass_id: storeclass_id,
  60. eachlimit: eachlimit
  61. },
  62. 'seller'
  63. )
  64. // 编辑代金券
  65. export const editVoucher =
  66. (tid, txt_template_title, txt_template_total, select_template_price, txt_template_limit, txt_template_describe, txt_template_enddate, storeclass_id, eachlimit, tstate) =>
  67. requestApi(
  68. '/Sellervoucher/templateedit',
  69. 'POST',
  70. {
  71. tid: tid,
  72. txt_template_title: txt_template_title,
  73. txt_template_total: txt_template_total,
  74. select_template_price: select_template_price,
  75. txt_template_limit: txt_template_limit,
  76. txt_template_describe: txt_template_describe,
  77. txt_template_enddate: txt_template_enddate,
  78. storeclass_id: storeclass_id,
  79. eachlimit: eachlimit,
  80. tstate: tstate
  81. },
  82. 'seller'
  83. )