123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123 |
- import axios from '~/plugins/axios'
- export const actions = {
-
- getSupplierList ({ commit }, params = {}) {
- commit('data/REQUEST_LIST')
- return axios.get('/vendor/introduction/vendor/list', {params})
- .then(response => {
- commit('data/GET_LIST_SUCCESS', response.data)
- }, err => {
- commit('data/GET_LIST_FAILURE', err)
- })
- },
-
- getSupplierEnInfo ({ commit }, params = {}) {
- commit('data/REQUEST_EN')
- return axios.get(`/basic/enterprise/${params.uu}/info`, {params})
- .then(response => {
- commit('data/GET_EN_SUCCESS', response.data)
- }, err => {
- commit('data/GET_EN_FAILURE', err)
- })
- },
-
- getSupplierProductList ({ commit }, params = {}) {
- commit('data/REQUEST_PRODUCT_LIST')
- return axios.get(`/vendor/introduction/product/list`, {params})
- .then(response => {
- commit('data/GET_PRODUCT_LIST_SUCCESS', response.data)
- }, err => {
- commit('data/GET_PRODUCT_LIST_FAILURE', err)
- })
- },
-
- loadVendorList ({commit}, params) {
- commit('merchant/REQUEST_MERCHANT')
- return axios.get('/vendor/introduction/vendor/list', {params})
- .then(res => {
- commit('merchant/GET_MERCHANT_SUCCESS', res.data)
- }, (err) => {
- commit('merchant/GET_MERCHANT_FAILURE', err)
- })
- },
-
- loadVendorAll ({commit}, params) {
- commit('merchant/REQUEST_MERCHANTALL')
- return axios.get('/vendor/introduction/vendor/list', {params})
- .then(res => {
- commit('merchant/GET_MERCHANTALL_SUCCESS', res.data)
- }, (err) => {
- commit('merchant/GET_MERCHANTALL_FAILURE', err)
- })
- },
-
- loadMaterialList ({commit}, params = {}) {
- commit('material/REQUEST_MATERIAL')
- return axios.get('/vendor/introduction/product/list', {params})
- .then(res => {
- commit('material/GET_MATERIAL_SUCCESS', res.data)
- }, (err) => {
- commit('material/GET_MATERIAL_FAILURE', err)
- })
- },
-
- loadMaterialDetail ({commit}, params = {}) {
- commit('detail/REQUEST_DETAIL')
- return axios.get('/vendor/introduction/product/detail', {params})
- .then(res => {
- commit('detail/GET_DETAIL_SUCCESS', res.data)
- if (res.data.cmpUuId) {
- commit('detail/REQUEST_CMPINFO')
- return axios.get(`/api/commodity/component/${res.data.cmpUuId}`)
- .then(res => {
- commit('detail/GET_CMPINFO_SUCCESS', res.data)
- }, (err) => {
- commit('detail/GET_CMPINFO_FAILURE', err)
- })
- }
- }, (err) => {
- commit('detail/GET_DETAIL_FAILURE', err)
- })
- },
-
- loadEnUser ({commit}, params = {}) {
- commit('material/REQUEST_ENUSER')
- return axios.get(`/basic/enterprise/${params.enUU}/info`)
- .then(res => {
- commit('material/GET_ENUSER_SUCCESS', res.data)
- }, (err) => {
- commit('material/GET_ENUSER_FAILURE', err)
- })
- },
-
- loadNewMerchant ({commit}, params = {}) {
- commit('merchant/REQUEST_NEWMERCHANT')
- return axios.get(`/api/store-service/stores`, {params})
- .then(res => {
- commit('merchant/GET_NEWMERCHANT_SUCCESS', res.data)
- }, (err) => {
- commit('merchant/GET_NEWMERCHANT_FAILURE', err)
- })
- },
-
- loadRecommend ({commit}, params = {}) {
- commit('merchant/REQUEST_RECOMMEND')
- return axios.get(`/vendor/introduction/vendor/recommend`, {params})
- .then(res => {
- commit('merchant/GET_RECOMMEND_SUCCESS', res.data)
- }, (err) => {
- commit('merchant/GET_RECOMMEND_FAILURE', err)
- })
- },
-
- loadSupplierBanner ({commit}) {
- commit('detail/REQUEST_BANNER')
- return axios.get(`/cmsApi?method=queryContentPage&module=supplier_banner_carousel&orderBy=order_number ASC`)
- .then(res => {
- commit('detail/GET_BANNER_SUCCESS', res.data)
- }, (err) => {
- commit('detail/GET_BANNER_FAILURE', err)
- })
- }
- }
|