|
|
@@ -9,12 +9,7 @@ function countStoreOrderCount (store) {
|
|
|
return axios.get('/api/provider/order/storeid/' + store.uuid + '/count')
|
|
|
}
|
|
|
function findStoreFocusInMobil (store) {
|
|
|
- axios.get('/trade/storeFocus/ifFocus?storeid=' + store.id).then(response => {
|
|
|
- return response.data
|
|
|
- }, err => {
|
|
|
- console.log(err)
|
|
|
- return false
|
|
|
- })
|
|
|
+ return axios.get('/trade/storeFocus/ifFocus?storeid=' + store.id)
|
|
|
}
|
|
|
export const actions = {
|
|
|
// 获取销售排行榜信息
|
|
|
@@ -118,19 +113,24 @@ export const actions = {
|
|
|
let listData = response.data
|
|
|
let focusData = []
|
|
|
for (let i = 0; i < listData.content.length; i++) {
|
|
|
- focusData.push(findStoreFocusInMobil({id: listData.content[i].id}))
|
|
|
+ let str = findStoreFocusInMobil({id: listData.content[i].id})
|
|
|
+ focusData.push(str)
|
|
|
}
|
|
|
// 合并请求,获取店铺关注信息
|
|
|
return Promise.all(focusData)
|
|
|
.then(result => {
|
|
|
if (result) {
|
|
|
for (let i = 0; i < result.length; i++) {
|
|
|
- listData.content[i].isFocus = result[i] ? result[i].data : false
|
|
|
+ listData.content[i].isFocus = result[i] ? result[i].data : 'false'
|
|
|
}
|
|
|
}
|
|
|
commit('stores/GET_STORE_LIST_SUCCESS', listData)
|
|
|
}, err => {
|
|
|
- commit('stores/GET_STORE_LIST_FAILURE', err)
|
|
|
+ console.log(err)
|
|
|
+ for (let i = 0; i < listData.content.length; i++) {
|
|
|
+ listData.content[i].isFocus = 'false'
|
|
|
+ }
|
|
|
+ commit('stores/GET_STORE_LIST_SUCCESS', listData)
|
|
|
})
|
|
|
}, err => {
|
|
|
commit('stores/GET_STORE_LIST_FAILURE', err)
|