home.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  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. header: {
  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. header: {
  26. 'content-type': 'application/x-www-form-urlencoded',
  27. },
  28. });
  29. }
  30. /**
  31. *@description 获取首页分类的数据
  32. */
  33. export function getCategoriesApi() {
  34. return request({
  35. url: '/maintain/categories',
  36. methods: get,
  37. header: {
  38. 'content-type': 'application/x-www-form-urlencoded',
  39. },
  40. });
  41. }
  42. // 热门搜索商家
  43. export function listHotMerchant(data) {
  44. return request({
  45. url: `/maintain/listHotMerchant/`,
  46. method: 'post',
  47. data: data,
  48. header: {
  49. 'Content-Type': 'application/json',
  50. },
  51. });
  52. }
  53. // 猜你喜欢的商家
  54. export function likeMerchant(data) {
  55. return request({
  56. url: `/maintain/likeMerchant/`,
  57. method: 'post',
  58. data: data,
  59. header: {
  60. 'Content-Type': 'application/json',
  61. },
  62. });
  63. }
  64. /**
  65. *@description 热门搜索接口 - 添加用户点击埋点
  66. */
  67. export function hotMerchant(id) {
  68. return request({
  69. url: `/maintain/hotMerchant/${id}`,
  70. method: 'get',
  71. header: {
  72. 'content-type': 'application/x-www-form-urlencoded',
  73. },
  74. });
  75. }