This commit is contained in:
2020-07-15 16:21:43 +08:00
parent 1854ffff03
commit cc9fb2b48b
11 changed files with 190 additions and 31 deletions

View File

@@ -1,6 +1,14 @@
export default {
init(vm){
return {
// 获取首页轮播
getIndexSwiper() {
return vm.$u.post('adv/indexadv');
},
// 获取首页轮播
getZhiBoSwiper() {
return vm.$u.post('adv/divebroadcastxadv');
},
// 发现列表
getArticlelist({ page, value, store_id, member_id, is_video_img }){
return vm.$u.post('article/articlelist', {
@@ -29,6 +37,12 @@ export default {
article_id: article_id,
});
},
// 直播列表
// getZhiboList() {
// return vm.$u.post('article/articleCollect', {
// article_id: article_id,
// });
// },
// 屏蔽用户
articleAddShield({ article_id, member_id }) {
return vm.$u.post('article/articleAddShield', {
@@ -129,8 +143,14 @@ export default {
});
},
// 商品详情
// getGoodsDetails({ id }) {
// return vm.$u.post('Goods/goodDetails', {
// goods_id: id
// });
// },
// 商品详情
getGoodsDetails({ id }) {
return vm.$u.post('Goods/goodDetails', {
return vm.$u.post('goods/goodsInfo', {
goods_id: id
});
},
@@ -149,7 +169,23 @@ export default {
return vm.$u.post('goods/goodsInfo', {
goods_id: id
});
}
},
// 秒杀推荐
recommendedSpike() {
return vm.$u.post('Spike/recommendedSpike');
},
// 秒杀详情
getSpikeInfo({ id }) {
return vm.$u.post('Spike/spikeInfo', {
groupbuy_id: id
});
},
// 秒杀列表
getSpikeList({ page }) {
return vm.$u.post('spike/spikeList', {
page: page
});
},
}
}

View File

@@ -302,6 +302,14 @@ export default {
delMessage({ type }) {
return vm.$u.post('/message/readMessage', { type });
},
// 屏蔽列表
articlShieldList() {
return vm.$u.post('/Article/articlShieldList');
},
// 取消屏蔽
articleDelShield({ id }) {
return vm.$u.post('article/articleDelShield', { member_id: id });
},
}
}
}

41
common/store/index.js Normal file
View File

@@ -0,0 +1,41 @@
// 商品相关
const moduleA = {
state: () => ({
count: 0
}),
mutations: {
increment (state) {
// 这里的 `state` 对象是模块的局部状态
state.count++
}
},
getters: {
doubleCount (state) {
return state.count * 2
}
}
}
// 用户相关
const moduleB = {
state: () => ({
count: 0
}),
mutations: {
increment (state) {
// 这里的 `state` 对象是模块的局部状态
state.count++
}
},
getters: {
doubleCount (state) {
return state.count * 2
}
}
}
const store = new Vuex.Store({
modules: {
shop: moduleA,
user: moduleB
}
})