searchData.js 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. import axios from '~plugins/axios'
  2. export const actions = {
  3. // 获取搜索kind
  4. searchForKinds ({ commit }, params = {}) {
  5. commit('searchKinds/REQUEST_KINDS', params)
  6. return axios.get(`/search/componentGoods/collect`, {params})
  7. .then(response => {
  8. commit('searchKinds/GET_KINDS_SUCCESS', response.data)
  9. }, err => {
  10. commit('searchKinds/GET_KINDS_FAILURE', err)
  11. })
  12. },
  13. // 获取搜索brand
  14. searchForBrands ({ commit }, params = {}) {
  15. commit('searchBrands/REQUEST_BRANDS', params)
  16. return axios.get(`/search/componentGoods/collect`, {params})
  17. .then(response => {
  18. commit('searchBrands/GET_BRANDS_SUCCESS', response.data)
  19. }, err => {
  20. commit('searchBrands/GET_BRANDS_FAILURE', err)
  21. })
  22. },
  23. // 获取搜索list
  24. searchForList ({ commit }, params = {}) {
  25. commit('searchList/REQUEST_LIST', params)
  26. return axios.get(`/api/product/component/search/compGoods`, {params})
  27. .then(response => {
  28. commit('searchList/GET_LIST_SUCCESS', response.data)
  29. }, err => {
  30. commit('searchList/GET_LIST_FAILURE', err)
  31. })
  32. },
  33. // 获取搜索货源
  34. searchForStoreType ({ commit }, params = {}) {
  35. commit('searchStoreType/REQUEST_STORETYPE', params)
  36. return axios.get(`/search/componentGoods/collect`, {params})
  37. .then(response => {
  38. commit('searchStoreType/GET_STORETYPE_SUCCESS', response.data)
  39. }, err => {
  40. commit('searchStoreType/GET_STORETYPE_FAILURE', err)
  41. })
  42. },
  43. // 获取搜索币种
  44. searchForCrname ({ commit }, params = {}) {
  45. commit('searchCrname/REQUEST_CRNAME', params)
  46. return axios.get(`/search/componentGoods/collect`, {params})
  47. .then(response => {
  48. commit('searchCrname/GET_CRNAME_SUCCESS', response.data)
  49. }, err => {
  50. commit('searchCrname/GET_CRNAME_FAILURE', err)
  51. })
  52. }
  53. }