|
@@ -7,7 +7,8 @@ const state = {
|
|
|
roleArr: [], // 角色
|
|
|
outletList: [], // 门店列表
|
|
|
categoryArr: [], // 商品分类列表
|
|
|
- goodsAttrArr: [] // 获取规格列表
|
|
|
+ goodsAttrArr: [], // 获取规格列表
|
|
|
+ goodsArr: [] // 商品列表
|
|
|
}
|
|
|
|
|
|
const mutations = {
|
|
@@ -28,6 +29,9 @@ const mutations = {
|
|
|
},
|
|
|
SET_GOODSATTRARR: (state, val) => {
|
|
|
state.goodsAttrArr = val
|
|
|
+ },
|
|
|
+ SET_GOODSARR: (state, val) => {
|
|
|
+ state.goodsArr = val
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -71,6 +75,13 @@ const actions = {
|
|
|
if (code === 200) {
|
|
|
commit('SET_GOODSATTRARR', data.list)
|
|
|
}
|
|
|
+ },
|
|
|
+ // 获取商品列表
|
|
|
+ async fetchGoodsArr ({ commit }) {
|
|
|
+ const { code, data } = await fetch('/v1/bar/product/list?page=1&page_size=10000&product_status=1', {}, 'get')
|
|
|
+ if (code === 200) {
|
|
|
+ commit('SET_GOODSARR', data.list)
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|