12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- import axios from '~plugins/axios'
- export const actions = {
-
- getPcbKinds ({ commit }, params = {}) {
- commit('kindsData/REQUEST_PCB_KINDS', params)
- return axios.get(`/api/product/kind/${params.parentId}/pcbchildren_all`)
- .then(response => {
- commit('kindsData/GET_PCB_KINDS_SUCCESS', response.data)
- }, err => {
- commit('kindsData/GET_PCB_KINDS_FAILURE', err)
- })
- },
-
- getPcbProduct ({ commit }, params = {}) {
- commit('product/REQUEST_PCB_PRODUCT', params)
- return axios.get(`/api/product/kind/pcbproperty/${params.productId}`)
- .then(response => {
- commit('product/GET_PCB_PRODUCT_SUCCESS', response.data)
- }, err => {
- commit('product/GET_PCB_PRODUCT_FAILURE', err)
- })
- },
-
- searchForKinds ({ commit }, params = {}) {
- commit('search/REQUEST_KINDS', params)
- return axios.get(`/search/PCBGoods/collect`, {params})
- .then(response => {
- commit('search/GET_KINDS_SUCCESS', response.data)
- }, err => {
- commit('search/GET_KINDS_FAILURE', err)
- })
- },
-
- searchForBrands ({ commit }, params = {}) {
- commit('search/REQUEST_BRANDS', params)
- return axios.get(`/search/PCBGoods/collect`, {params})
- .then(response => {
- commit('search/GET_BRANDS_SUCCESS', response.data)
- }, err => {
- commit('search/GET_BRANDS_FAILURE', err)
- })
- },
-
- searchForList ({ commit }, params = {}) {
- commit('search/REQUEST_LIST', params)
- return axios.get(`/search/pcbgoods/page`, {params})
- .then(response => {
- commit('search/GET_LIST_SUCCESS', response.data)
- }, err => {
- commit('search/GET_LIST_FAILURE', err)
- })
- },
- getPcbRecoProduct ({ commit }, params = {}) {
- commit('product/REQUEST_RECO', params)
- return axios.get(`/api/commodity/cms/pcb`, {params})
- .then(response => {
- commit('product/GET_RECO_SUCCESS', response.data)
- }, err => {
- commit('product/GET_RECO_FAILURE', err)
- })
- }
- }
|