index.js 1.01 KB
Newer Older
zhangpeng committed
1 2
import Vue from 'vue'
import Vuex from 'vuex'
zhangcheng committed
3 4 5
import user from './modules/user'
import menu from './modules/menu'
import getters from './getters'
zhangpeng committed
6 7
Vue.use(Vuex)
const store = new Vuex.Store({
zhangcheng committed
8 9 10 11
	modules: {
		user,
		menu
	},
zhangpeng committed
12 13 14
    state: {
		list: [
			{
15 16
				icon: "/static/imgs/icon-unselect-menu.png",
				activeIcon: '/static/imgs/icon-selected-menu.png',
zhangpeng committed
17 18 19 20 21
				customIcon: false,
				pagePath: "/pages/menu/menu",
				text: '菜单'
			},
			{
22 23
				icon: "/static/imgs/icon-unselect-order.png",
				activeIcon: '/static/imgs/icon-selected-order.png',
zhangpeng committed
24 25 26 27 28
				pagePath: "/pages/order/order",
				text: '订单',
				customIcon: false
			},
			{
29 30
				icon: "/static/imgs/icon-unselect-mine.png",
				activeIcon: '/static/imgs/icon-selected-mine.png',
zhangpeng committed
31 32 33 34
				pagePath: "/pages/mine/mine",
				text: '我的'
			}
		],
zhangcheng committed
35
		
zhangpeng committed
36
		orderId:''//外部扫码进入的商品id
zhangpeng committed
37 38
	},
    mutations: {
zhangcheng committed
39
		
zhangpeng committed
40 41 42
		// 设置扫码进入的商品id
		setOrderId(state, orderId) {
           state.orderId = orderId;
zhangpeng committed
43 44
		}
	},
zhangcheng committed
45
	getters,
zhangpeng committed
46 47 48
    actions: {}
})
export default store