spu.js 905 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. "use strict";
  2. const sheep_request_index = require("../../request/index.js");
  3. const SpuApi = {
  4. // 获得商品 SPU 列表
  5. getSpuListByIds: (ids) => {
  6. return sheep_request_index.request({
  7. url: "/product/spu/list-by-ids",
  8. method: "GET",
  9. params: { ids },
  10. custom: {
  11. showLoading: false,
  12. showError: false
  13. }
  14. });
  15. },
  16. // 获得商品 SPU 分页
  17. getSpuPage: (params) => {
  18. return sheep_request_index.request({
  19. url: "/product/spu/page",
  20. method: "GET",
  21. params,
  22. custom: {
  23. showLoading: false,
  24. showError: false
  25. }
  26. });
  27. },
  28. // 查询商品
  29. getSpuDetail: (id) => {
  30. return sheep_request_index.request({
  31. url: "/product/spu/get-detail",
  32. method: "GET",
  33. params: { id },
  34. custom: {
  35. showLoading: false,
  36. showError: false
  37. }
  38. });
  39. }
  40. };
  41. exports.SpuApi = SpuApi;