rewardActivity.ts 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. import request from '@/config/axios'
  2. export interface RewardActivityVO {
  3. id?: number
  4. name?: string
  5. startTime?: Date
  6. endTime?: Date
  7. startAndEndTime?: Date[] // 只前端使用
  8. remark?: string
  9. conditionType?: number
  10. productScope?: number
  11. productScopeValues?: number[] // 商品范围:值为 品类编号列表 或 商品编号列表 ,用于提交
  12. productCategoryIds?: number[] // 仅用于表单,不提交
  13. productSpuIds?: number[] // 仅用于表单,不提交
  14. rules: RewardRule[]
  15. }
  16. // 优惠规则
  17. export interface RewardRule {
  18. limit?: number
  19. discountPrice?: number
  20. freeDelivery?: boolean
  21. givePoint?: boolean
  22. point?: number
  23. giveCoupon?: boolean
  24. couponIds?: number[]
  25. couponCounts?: number[]
  26. }
  27. // 新增满减送活动
  28. export const createRewardActivity = async (data: RewardActivityVO) => {
  29. return await request.post({ url: '/promotion/reward-activity/create', data })
  30. }
  31. // 更新满减送活动
  32. export const updateRewardActivity = async (data: RewardActivityVO) => {
  33. return await request.put({ url: '/promotion/reward-activity/update', data })
  34. }
  35. // 查询满减送活动列表
  36. export const getRewardActivityPage = async (params) => {
  37. return await request.get({ url: '/promotion/reward-activity/page', params })
  38. }
  39. // 查询满减送活动详情
  40. export const getReward = async (id: number) => {
  41. return await request.get({ url: '/promotion/reward-activity/get?id=' + id })
  42. }
  43. // 删除限时折扣活动
  44. export const deleteRewardActivity = async (id: number) => {
  45. return await request.delete({ url: '/promotion/reward-activity/delete?id=' + id })
  46. }