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.
 
 
 
 
 

81 lines
2.4 KiB

import Vue from 'vue';
import Vuex from 'vuex';
import mutations from './mutations';
import actions from './actions';
import device from './device';
Vue.use(Vuex);
export default new Vuex.Store({
modules: {
device
},
state: {
// #ifndef H5
APPID: uni.getAccountInfoSync().miniProgram.appId,
// #endif
brandInfo: {
brand: {}
},
// permissionObj: { // 权限代号对应
// '1001': '营业额',
// '1002': '收款记录',
// '1003': '经营分析',
// '1004': '预约订单',
// '1005': '会员卡订单',
// '1006': '积分订单',
// '1007': '员工管理',
// '1008': '查询核销',
// '1009': '场地管理',
// '1010': '设备管理',
// '1011': '商品零售',
// '1012': '订单管理',
// '1013': '课程管理',
// },
permissionObj: { // 权限代号对应
'1001': '营业额',
'1002': '收款记录',
'1012': '订单管理',
'1007': '员工管理',
'1008': '核销查询',
'1009': '场地管理',
'1010': '设备管理',
'1011': '商品零售',
// '1013': '课程管理',
'1014': '储值卡管理',
'1015': '进场人数异常',
'1016': '系统工具',
'1017': '钱包提现',
'1018': '退款权限'
},
// 场地占用提交页面信息
occupyInfo: {
storeInfo: {}, // 店铺信息
dateInfo: {}, // 时间信息
typeInfo: {}, // 球场类型
venueList: [], // 选择场地列表
orderInfo: {}, // 订单信息 // 20230620 新增挂账需求,用于回显确认订单
},
isLogin: false, // 登陆状态
},
mutations,
actions,
getters: {
permissionArr: state=>{
let _arr = [], _obj = state.permissionObj;
for(let key in _obj){
_arr.push({
key,
name: _obj[key],
})
}
console.warn(_arr.length)
return _arr;
},
loginState: state =>{
let _isLogin = state.isLogin;
let _token = uni.getStorageSync('token');
// 只是想获得一个响应的token状态
if(_isLogin || !_isLogin)return !!_token;
}
}
});