homePage.js 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. import request from "@/sheep/request";
  2. const myHomeAPI = {
  3. // 获取技师列表
  4. getTechnicianList: (params) => {
  5. return request({
  6. url: "/client/coach",
  7. method: "GET",
  8. params: {
  9. latitude: params.latitude, // 必填,纬度
  10. longitude: params.longitude, // 必填,经度
  11. },
  12. custom: {
  13. showLoading: true,
  14. loadingMsg: "加载中...",
  15. },
  16. });
  17. },
  18. // 获取技师位置列表
  19. getTechnicianLocations: () => {
  20. return request({
  21. url: "/client/coach/location",
  22. method: "GET",
  23. custom: {
  24. showLoading: true,
  25. loadingMsg: "加载中...",
  26. },
  27. });
  28. },
  29. // 获取项目列表
  30. getProjectList: (params) => {
  31. return request({
  32. url: "/client/project",
  33. method: "GET",
  34. params: {
  35. area_code: params.area_code, // 必填,区域代码
  36. project_cate_id: params.project_cate_id, // 可选,项目分类ID
  37. type: params.type || 1, // 必填,项目类型(1:普通项目,2:加钟项目)
  38. },
  39. custom: {
  40. showLoading: true,
  41. loadingMsg: "加载中...",
  42. },
  43. });
  44. },
  45. // 获取项目详情
  46. getProjectDetail: (params) => {
  47. return request({
  48. url: "/client/project/detail",
  49. method: "GET",
  50. params: {
  51. id: params.id, // 必填,项目ID
  52. area_code: params.area_code, // 必填,区域代码
  53. },
  54. custom: {
  55. showLoading: true,
  56. loadingMsg: "加载中...",
  57. },
  58. });
  59. },
  60. // 获取用户二维码
  61. getUserQrcode: () => {
  62. return request({
  63. url: `/client/user/invite-code`,
  64. method: "get",
  65. });
  66. },
  67. };
  68. export default myHomeAPI;