index.js 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. //我的相关:
  2. const {
  3. http
  4. } = uni.$u
  5. //获取活动商品
  6. export const getActGoodsReq = (params, config = {}) => http.get('/api/getActivityData', params, config)
  7. //首页产品指南
  8. export const getGuideDataReq = (params, config = {}) => http.get('/api/common/getGuideData', params, config)
  9. //首页轮播图
  10. export const getBannerDataReq = (params, config = {}) => http.get('/api/common/getBannerData', params, config)
  11. //首页轮播图
  12. export const getAddressDataReq = (params, config = {}) => http.get('/api/common/getAddressData', params, config)
  13. //首页轮播图
  14. export const getPreviewDataReq = (params, config = {}) => {
  15. let apiUrl = '/api/getPreviewData'
  16. Object.keys(params).forEach((item, index) => {
  17. if (index == 0) {
  18. apiUrl += `?${item}=${params[item]}`
  19. } else {
  20. apiUrl += `&${item}=${params[item]}`
  21. }
  22. })
  23. console.log('处理后的apiUrl', apiUrl);
  24. return http.get(apiUrl, params, config)
  25. }
  26. export const getDataMoneyReq = (params, config = {}) => {
  27. let apiUrl = '/api/getDataMoney'
  28. Object.keys(params).forEach((item, index) => {
  29. if (index == 0) {
  30. apiUrl += `?${item}=${params[item]}`
  31. } else {
  32. apiUrl += `&${item}=${params[item]}`
  33. }
  34. })
  35. console.log('处理后的apiUrl', apiUrl);
  36. return http.get(apiUrl, params, config)
  37. }