store.js 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. import request from '../utils/request.js'
  2. class store extends request {
  3. // static errorHandel(res) {
  4. // console.log(res);
  5. // }
  6. static async getStoreList(page = 1, pageSize = 10,otherParam = '') {
  7. const res = await this.getRequest(`${this.BASE_URL}Store/index?page=${page}&pageSize=${pageSize}`+otherParam, this._defaultHeader)
  8. return res.data;
  9. }
  10. static async getStoreById(id) {
  11. const res = await this.getRequest(`${this.BASE_URL}Store/read?id=${id}`, this._defaultHeader)
  12. return res.data;
  13. }
  14. static async getStaffsListByStoreId(id,page = 1, pageSize = 10000) {
  15. const res = await this.getRequest(`${this.BASE_URL}Staff/index?page=${page}&pageSize=${pageSize}&storeId=${id}&status=1`, this._defaultHeader)
  16. return res.data;
  17. }
  18. static async getNearStore(lat, lon) {
  19. const res = await this.postRequest(`${this.BASE_URL}Store/getStore`, {
  20. lat,
  21. lon
  22. })
  23. return res.data;
  24. }
  25. static async getStoreAppointTime(id) {
  26. const res = await this.postRequest(`${this.BASE_URL}Store/appointmentTime?storeId=${id}`)
  27. return res.data;
  28. }
  29. }
  30. export default store