business.js 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import { request } from '@/utils/request';
  2. /**
  3. * 获取商家列表信息
  4. * @returns
  5. */
  6. export function getSellerList(params){
  7. return request({
  8. url:'/maintain/merchants',
  9. data:params,
  10. method: 'GET',
  11. header:{
  12. 'Content-Type': 'application/x-www-form-urlencoded'
  13. }
  14. })
  15. }
  16. // 获取商家详情信息
  17. export function getSellsDetail(id,data){
  18. return request({
  19. url:`/maintain/merchant/${id}`,
  20. method: 'GET',
  21. data: data,
  22. header:{
  23. 'Content-Type': 'application/x-www-form-urlencoded'
  24. }
  25. })
  26. }
  27. /**
  28. * 商品详情
  29. * @returns
  30. */
  31. export function getGoodsDetail(id){
  32. return request({
  33. url:`/maintain/goods/${id}`,
  34. method: 'GET',
  35. header:{
  36. 'Content-Type': 'application/x-www-form-urlencoded'
  37. }
  38. })
  39. }
  40. /**
  41. * 分类接口 - 获取分类列表
  42. * @returns
  43. */
  44. export function maintainCategories(id){
  45. return request({
  46. url:`/maintain/categories`,
  47. method: 'GET',
  48. header:{
  49. 'Content-Type': 'application/x-www-form-urlencoded'
  50. }
  51. })
  52. }
  53. /**
  54. * 预约接口 - 新增预约
  55. * @param {*} data
  56. * @returns
  57. */
  58. export function addReservation(merchantId,data) {
  59. return request({
  60. url: `/maintain/merchant/${merchantId}/reservation`,
  61. method: 'post',
  62. data: data,
  63. header: {
  64. 'Content-Type': 'application/json',
  65. },
  66. });
  67. }
  68. // 收藏商家接口
  69. export function addFavorite(id) {
  70. return request({
  71. url: `/maintain/merchant/${id}/favorite`,
  72. method: 'post',
  73. header: {
  74. 'Content-Type': 'application/x-www-form-urlencoded',
  75. },
  76. });
  77. }