|
|
@@ -142,17 +142,14 @@ export const actions = {
|
|
|
// 获得器件详情信息
|
|
|
loadComponentDetail ({commit}, params = {}) {
|
|
|
let id = params.id
|
|
|
- // console.log(id)
|
|
|
commit('componentDetail/REQUEST_DETAIL', params)
|
|
|
return axios.get(`/api/product/component/${id}`)
|
|
|
.then(response => {
|
|
|
- console.log('response', response.data)
|
|
|
commit('componentDetail/GET_DETAIL_SUCCESS', response.data)
|
|
|
if (response.data) {
|
|
|
commit('componentMenu/REQUEST_MENU', params)
|
|
|
return axios.get(`/api/product/kind/structing/${response.data.kindid}`)
|
|
|
.then(response => {
|
|
|
- console.log('response', response.data)
|
|
|
commit('componentMenu/GET_MENU_SUCCESS', response.data)
|
|
|
}, err => {
|
|
|
commit('componentMenu/GET_MENU_FAILURE', err)
|
|
|
@@ -165,11 +162,9 @@ export const actions = {
|
|
|
// 获取器件详情页面包屑导航
|
|
|
loadComponentMenu ({commit}, params = {}) {
|
|
|
let pid = params.id
|
|
|
- console.log(pid)
|
|
|
commit('componentMenu/REQUEST_MENU', params)
|
|
|
return axios.get(`/api/product/kind/structing/${pid}`)
|
|
|
.then(response => {
|
|
|
- console.log('response', response.data)
|
|
|
commit('componentMenu/GET_MENU_SUCCESS', response.data)
|
|
|
}, err => {
|
|
|
commit('componentMenu/GET_MENU_FAILURE', err)
|
|
|
@@ -177,29 +172,27 @@ export const actions = {
|
|
|
},
|
|
|
// 器件详情页选择商家
|
|
|
loadComponentStore ({commit}, params = {}) {
|
|
|
- let sid = params.uuid
|
|
|
+ let id = params.uuid
|
|
|
commit('componentStore/REQUEST_STORE', params)
|
|
|
- return axios.get(`/api/store-service/stores/uuid/${sid}`)
|
|
|
+ return axios.get(`/api/store-service/stores/uuid/${id}`)
|
|
|
.then(response => {
|
|
|
- console.log('response', response.data)
|
|
|
commit('componentStore/GET_STORE_SUCCESS', response.data)
|
|
|
}, err => {
|
|
|
commit('componentStore/GET_STORE_FAILURE', err)
|
|
|
})
|
|
|
},
|
|
|
- // 器件详情页商家信息列表
|
|
|
- loadComponentInformation ({commit}, uuid = '', ignoreUMALL = '', pageParams = { page: 1, count: 10 }) {
|
|
|
- // let params = { uuid: uuid.uuid, ignoreUMALL: 'uuid.ignoreUMALL', ignoreStore: uuid.ignoreStore, storeIds: uuid.storeId, minPriceRMB: uuid.minPriceRMB }
|
|
|
+ // 器件详情页商家列表
|
|
|
+ loadComponentInformation ({commit}, uuid = '', pageParams = { page: 1, count: 10 }) {
|
|
|
let params = {}
|
|
|
- console.log('ComponentInformation', params)
|
|
|
- console.log('ComponentInformation', uuid)
|
|
|
- console.log('ComponentInformation', ignoreUMALL)
|
|
|
+ let filter = {uuid: uuid.uuid, ignoreUMall: false, ignoreStore: false}
|
|
|
+ // let sorting = {minPriceRMB: 'ASC'}
|
|
|
+ params.filter = filter
|
|
|
+ // params.sorting = sorting
|
|
|
params.page = pageParams.page
|
|
|
params.count = pageParams.count
|
|
|
- commit('componentInformation/REQUEST_INFORMATION', params)
|
|
|
+ commit('componentInformation/REQUEST_INFORMATION')
|
|
|
return axios.get('/api/commodity/goods/page', { params })
|
|
|
.then(response => {
|
|
|
- console.log('loadComponentInformation', response.data)
|
|
|
commit('componentInformation/GET_INFORMATION_SUCCESS', response.data)
|
|
|
}, err => {
|
|
|
commit('componentInformation/GET_INFORMATION_FAILURE', err)
|
|
|
@@ -213,9 +206,10 @@ export const actions = {
|
|
|
return axios.get(`/api/product/brand/${id}`)
|
|
|
.then(response => {
|
|
|
let brand = response.data || {}
|
|
|
- console.log('loadBrandDetail', response.data !== null)
|
|
|
commit('brandDetail/GET_DETAIL_SUCCESS', response.data)
|
|
|
return Promise.all([
|
|
|
+ loadBrandCategories({ commit }, { id: brand.id }),
|
|
|
+ loadBrandComponent({ commit }, {count: 10, filter: { brandid: brand.id }, page: 1})
|
|
|
loadBrandCategories({ commit }, {id: brand.id}),
|
|
|
loadBrandComponent({ commit }, {count: 10, filter: { brandid: brand.id }})
|
|
|
])
|
|
|
@@ -244,6 +238,16 @@ export const actions = {
|
|
|
commit('brandComponent/GET_COMPONENT_FAILURE', err)
|
|
|
})
|
|
|
},
|
|
|
+ // 获取品牌详情分页信息
|
|
|
+ loadBrandPages ({commit}, params = {}) {
|
|
|
+ commit('brandPages/REQUEST_PAGES', params)
|
|
|
+ return axios.get('/api/product/PAGES/list', { params })
|
|
|
+ .then(response => {
|
|
|
+ commit('brandPages/GET__SUCCESS', response.data)
|
|
|
+ }, err => {
|
|
|
+ commit('brandPages/GET_COMPONENT_FAILURE', err)
|
|
|
+ })
|
|
|
+ },
|
|
|
// 获取帮助中心信息
|
|
|
loadHelpSnapsho ({ commit }, params = {}) {
|
|
|
commit('help/REQUEST_SNAPSHO')
|