index.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. const {
  2. http
  3. } = uni.$u
  4. // 获取活动商品
  5. export const getActivityDataReq = (params, config = {}) => http.get('/api/getActivityData', params, config)
  6. // 获取小程序指南
  7. export const getUserGuideReq = (params, config = {}) => http.get('/api/common/getUserGuide', params, config)
  8. // 获取关于我们
  9. export const getAboutReq = (params, config = {}) => http.get('/api/getAbout', params, config)
  10. // 获取我的收藏
  11. // export const getMyCollectDataReq = (params, config = {}) => http.get('/api/users/getMyCollectData', params, config)
  12. export const getMyCollectDataReq = (params, config = {}) => {
  13. let apiUrl = '/api/users/getMyCollectData'
  14. Object.keys(params).forEach((item, index) => {
  15. if (index == 0) {
  16. apiUrl += `?${item}=${params[item]}`
  17. } else {
  18. apiUrl += `&${item}=${params[item]}`
  19. }
  20. })
  21. console.log('处理后的apiUrl', apiUrl);
  22. return http.get(apiUrl, params, config)
  23. }
  24. // 获取我的收藏
  25. export const getMyCollectDetailReq = (params, config = {}) => {
  26. let apiUrl = '/api/goods/getGoodsDetail'
  27. Object.keys(params).forEach((item, index) => {
  28. if (index == 0) {
  29. apiUrl += `?${item}=${params[item]}`
  30. } else {
  31. apiUrl += `&${item}=${params[item]}`
  32. }
  33. })
  34. console.log('处理后的apiUrl', apiUrl);
  35. return http.get(apiUrl, params, config)
  36. }