|
@@ -21,12 +21,31 @@ export const actions = {
|
|
|
commit('searchBrands/GET_BRANDS_FAILURE', err)
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
+ searchForDetail ({ commit }, params = {}) {
|
|
|
+ commit('searchDetail/REQUEST_DETAIL', params)
|
|
|
+ return axios.get(`/search/componentGoods/collect`, {params})
|
|
|
+ .then(response => {
|
|
|
+ commit('searchDetail/GET_DETAIL_SUCCESS', response.data)
|
|
|
+ }, err => {
|
|
|
+ commit('searchDetail/GET_DETAIL_FAILURE', err)
|
|
|
+ })
|
|
|
+ },
|
|
|
|
|
|
searchForList ({ commit }, params = {}) {
|
|
|
commit('searchList/REQUEST_LIST', params)
|
|
|
return axios.get(`/api/product/component/search/compGoods`, {params})
|
|
|
.then(response => {
|
|
|
commit('searchList/GET_LIST_SUCCESS', response.data)
|
|
|
+ if (response.data.brands) {
|
|
|
+ commit('searchDetail/REQUEST_DETAIL', params)
|
|
|
+ return axios.get(`/api/product/brand/${response.data.brands.uuid}`)
|
|
|
+ .then(response => {
|
|
|
+ commit('searchDetail/GET_DETAIL_SUCCESS', response.data)
|
|
|
+ }, err => {
|
|
|
+ commit('searchDetail/GET_DETAIL_FAILURE', err)
|
|
|
+ })
|
|
|
+ }
|
|
|
}, err => {
|
|
|
commit('searchList/GET_LIST_FAILURE', err)
|
|
|
})
|