bargain.js 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. import request from "@/utils/request.js";
  2. // 获得砍价活动列表
  3. export function getBargainActivityList(count) {
  4. return request.get("app-api/promotion/bargain-activity/list", {
  5. count
  6. }, {
  7. noAuth: true // TODO 芋艿:后续要做调整
  8. });
  9. }
  10. // 获得砍价活动详情
  11. export function getBargainActivityDetail(id) {
  12. return request.get("app-api/promotion/bargain-activity/get-detail", {
  13. id
  14. }, {
  15. noAuth: true // TODO 芋艿:后续要做调整
  16. });
  17. }
  18. // 获得砍价活动分页
  19. export function getBargainActivityPage(count) {
  20. return request.get("app-api/promotion/bargain-activity/page", {
  21. count
  22. }, {
  23. noAuth: true // TODO 芋艿:后续要做调整
  24. });
  25. }
  26. // 获得砍价记录的概要信息
  27. export function getBargainRecordSummary() {
  28. return request.get("app-api/promotion/bargain-record/get-summary", {}, {
  29. noAuth: true // TODO 芋艿:后续要做调整
  30. });
  31. }
  32. // 获得砍价记录的分页
  33. export function getBargainRecordPage(data) {
  34. return request.get("app-api/promotion/bargain-record/page", data, {
  35. noAuth: true // TODO 芋艿:后续要做调整
  36. });
  37. }
  38. // 获得砍价活动详情
  39. export function getBargainRecordDetail(id, activityId) {
  40. return request.get("app-api/promotion/bargain-record/get-detail", {
  41. id: id > 0 ? id : undefined,
  42. activityId: activityId > 0 ? activityId : undefined
  43. }, {
  44. noAuth: true // TODO 芋艿:后续要做调整
  45. });
  46. }
  47. // 创建砍价记录(参与拼团活动)
  48. export function createBargainRecord(activityId) {
  49. return request.post("app-api/promotion/bargain-record/create", {
  50. activityId
  51. });
  52. }
  53. // 创建砍价助力(给拼团记录砍一刀)
  54. export function createBargainHelp(recordId) {
  55. return request.post("app-api/promotion/bargain-help/create", {
  56. recordId: recordId
  57. });
  58. }
  59. // 获得砍价助力列表
  60. export function getBargainHelpList(recordId) {
  61. return request.get("app-api/promotion/bargain-help/list", {
  62. recordId: recordId
  63. }, {
  64. noAuth: true // TODO 芋艿:后续要做调整
  65. });
  66. }