vuex
This commit is contained in:
@@ -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
|
||||
});
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -302,9 +302,19 @@ export default {
|
||||
delMessage({ type }) {
|
||||
return vm.$u.post('/message/readMessage', { type });
|
||||
},
|
||||
<<<<<<< HEAD
|
||||
// 已读消息
|
||||
refreshToken({ }) {
|
||||
return vm.$u.post('/Auth/refreshToken', { });
|
||||
=======
|
||||
// 屏蔽列表
|
||||
articlShieldList() {
|
||||
return vm.$u.post('/Article/articlShieldList');
|
||||
},
|
||||
// 取消屏蔽
|
||||
articleDelShield({ id }) {
|
||||
return vm.$u.post('article/articleDelShield', { member_id: id });
|
||||
>>>>>>> 76a0e7e8bdfc42e7e46cc74d2cfb43fc4f544e7b
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
41
common/store/index.js
Normal file
41
common/store/index.js
Normal 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
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user