marketing.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. import request from '@/utils/request'
  2. //添加、修改
  3. export function addMarketing(data) {
  4. return request({
  5. url: `/api/v1/mp/admin/marketing/${data.id ? 'update' : 'create'}`,
  6. method: 'post',
  7. data
  8. })
  9. }
  10. //查询列表
  11. export function getMarketingList(urlParams, data) {
  12. return request({
  13. url: '/api/v1/mp/admin/marketing/list',
  14. method: 'post',
  15. data,
  16. urlParams
  17. })
  18. }
  19. //查询列表
  20. export function ticketMarketingExport(data) {
  21. return request({
  22. url: '/api/v1/mp/admin/marketing/export',
  23. method: 'post',
  24. data,
  25. })
  26. }
  27. //查询详情
  28. export function getMarketingDetail(id) {
  29. return request({
  30. url: `/api/v1/mp/admin/marketing/detail/${id}`,
  31. method: 'post',
  32. headers: {
  33. 'Content-Type': 'application/x-www-form-urlencoded'
  34. },
  35. })
  36. }
  37. //删除
  38. export function delMarketing(Id) {
  39. return request({
  40. url: `/api/v1/mp/admin/marketing/delete/${Id}`,
  41. method: 'post',
  42. headers: {
  43. 'Content-Type': 'application/x-www-form-urlencoded'
  44. },
  45. })
  46. }
  47. //开启活动
  48. export function setMarketingStatus(data) {
  49. return request({
  50. url: `/api/v1/mp/admin/marketing/on/${data}`,
  51. method: 'post',
  52. headers: {
  53. 'Content-Type': 'application/x-www-form-urlencoded'
  54. },
  55. })
  56. }
  57. //关闭活动
  58. export function setMarketingStatusOff(data) {
  59. return request({
  60. url: `/api/v1/mp/admin/marketing/off/${data}`,
  61. method: 'post',
  62. headers: {
  63. 'Content-Type': 'application/x-www-form-urlencoded'
  64. },
  65. })
  66. }
  67. //查询活动数据列表
  68. export function getMarketingData(id) {
  69. return request({
  70. url: `/api/v1/mp/admin/marketing/data/${id}`,
  71. method: 'post',
  72. headers: {
  73. 'Content-Type': 'application/x-www-form-urlencoded'
  74. },
  75. })
  76. }