import Vue from 'vue'
import Vuex from 'vuex'


const state = {
	curThemeType: 'light',
}
const mutations = {

}

const actions = {
	handleActionAgree({
		commit
	}, boo) {
		commit('handleAgree', boo);
	},
	setCurThemeType({
		commit,
		dispatch,
		getters,
		state
	}, data) {
		//设置主题是给原生tabBar设置主题
		dispatch('tabBarChangeTheme', data)
		state.curThemeType = data;
	},
	//原生tabBar主题不刷新，进入到首页再刷新一次
	updateTabBarTheme({
		dispatch,
		state
	}) {
		//设置主题是给原生tabBar设置主题
		dispatch('tabBarChangeTheme', state.curThemeType);
	},
}



const getters = {
	themeType(
		state
	) {
		return state.curThemeType;
	}
}



export default {
	state,
	mutations,
	actions,
	getters
}