index.js 624 B

123456789101112131415161718192021222324252627282930
  1. const { request } = require('../../../api/request')
  2. /**
  3. * 商品详情
  4. * @returns {Promise<*>}
  5. */
  6. export const getProductDetail = (productId) => request({
  7. url: '/api/user/caigou/product/detail',
  8. method: 'POST',
  9. data: {
  10. product_id: productId
  11. },
  12. showLoading: true
  13. })
  14. /**
  15. * 收藏/取消收藏商品
  16. * @param productId 商品ID
  17. * @param type 类型 1收藏2取消收藏
  18. * @returns {Promise<*>}
  19. */
  20. export const postProductCollect = (productId, type) => request({
  21. url: '/api/user/caigou/product/collect',
  22. method: 'POST',
  23. data: {
  24. product_id: productId,
  25. type: type
  26. },
  27. showLoading: true
  28. })