home.js 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. import request from '@/utils/request';
  2. /**
  3. * 获取当前位置
  4. * @returns
  5. */
  6. export function getCurrentLocation(data) {
  7. return request({
  8. url: '/maintain/location',
  9. method: 'get',
  10. data: data,
  11. headers: {
  12. 'content-type': 'application/x-www-form-urlencoded',
  13. },
  14. });
  15. }
  16. /**
  17. * 获取首页
  18. * @returns
  19. */
  20. export function getHomePageApi(data) {
  21. return request({
  22. url: '/maintain/customer/index',
  23. method: 'get',
  24. data: data,
  25. headers: {
  26. 'content-type': 'application/x-www-form-urlencoded',
  27. },
  28. });
  29. }
  30. /**
  31. *@description 轮播图
  32. */
  33. export function getSwiperListApi() {
  34. return request({
  35. url: '/maintain/listCarouselImages/',
  36. method: 'get',
  37. headers: {
  38. 'content-type': 'application/json',
  39. },
  40. });
  41. }
  42. /**
  43. *@description 获取首页分类的数据
  44. */
  45. export function getCategoriesApi() {
  46. return request({
  47. url: '/maintain/categories',
  48. methods: 'get',
  49. headers: {
  50. 'content-type': 'application/x-www-form-urlencoded',
  51. },
  52. });
  53. }
  54. // 热门搜索商家
  55. export function listHotMerchant(data) {
  56. return request({
  57. url: `/maintain/listHotMerchant/`,
  58. method: 'post',
  59. data: data,
  60. headers: {
  61. 'Content-Type': 'application/json',
  62. },
  63. });
  64. }
  65. // 猜你喜欢的商家
  66. export function likeMerchant(data) {
  67. return request({
  68. url: `/maintain/likeMerchant/`,
  69. method: 'post',
  70. data,
  71. headers: {
  72. 'Content-Type': 'application/json',
  73. },
  74. });
  75. }
  76. /**
  77. *@description 热门搜索接口 - 添加用户点击埋点
  78. */
  79. export function hotMerchant(id) {
  80. return request({
  81. url: `/maintain/hotMerchant/${id}`,
  82. method: 'get',
  83. headers: {
  84. 'content-type': 'application/x-www-form-urlencoded',
  85. },
  86. });
  87. }