You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.1 KiB
34 lines
1.1 KiB
import deviceServer from '../subpackage/device/js/device_server';
|
|
import deviceApi from '../subpackage/device/js/device_api';
|
|
|
|
export default {
|
|
state(){
|
|
return {
|
|
storeList: [],
|
|
curStoreInfo: {}
|
|
}
|
|
},
|
|
mutations: {
|
|
setStoreList(state, query){
|
|
state.storeList = query;
|
|
},
|
|
setStoreInfo(state, query){
|
|
state.curStoreInfo = query;
|
|
}
|
|
},
|
|
actions: { // 小程序模块化访问失败 this.$store.dispatch('device/getStoreList')
|
|
getStoreList({ commit, state , rootState}){
|
|
return deviceServer.get({
|
|
url: deviceApi.stadiumList,
|
|
data: { brand_id: rootState.brandInfo.brand.id },
|
|
failMsg: '加载失败!',
|
|
})
|
|
.then(res=>{
|
|
let _list = res.list || [];
|
|
commit('setStoreList', _list);
|
|
if(JSON.stringify(state.curStoreInfo) == '{}'&&_list.length)commit('setStoreInfo', _list[0]);
|
|
return res;
|
|
})
|
|
}
|
|
}
|
|
}
|