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

Vue.use(Vuex);
import LoginStore from './modules/login';
import ConversationStore from './modules/conversation';
import MessageStore from './modules/message';
import ContactsStore from './modules/contacts';
import GroupStore from './modules/group';
import InformStore from './modules/inform';
import ReceiveInviteStore from './modules/receiveInvite';
const store = new Vuex.Store({
	modules: {
	  LoginStore,
	  ConversationStore,
	  MessageStore,
	  ContactsStore,
	  GroupStore,
	  InformStore,
	  ReceiveInviteStore,
	},
	state: {
		merchantsDataAll: {}, //查询反显用户的数据
		merchantsStatus: 0, //商户数据状态 0新增 1修改
		vuexstatus: []//用户状态
	},
	getters: {
		merchantsDataAlls(state) {
			return state;
		}
	},
	mutations: {
		changeMerchants(state, n) {
			state.merchantsDataAll = n;
		},
		changeMerchantsStatus(state, n) {
			state.merchantsStatus = n;
		},
		isvuexstatus(state, n) {
			state.vuexstatus = n;
		},
		RESET_STORE: (state) => {
		  console.log('>>>>>重置store', store);
		  store.commit('RESET_MESSAGE_STORE');
		  store.commit('RESET_LOGIN_STORE');
		  store.commit('RESET_CONTACTS_STORE');
		  store.commit('RESET_GROUP_STORE');
		  store.commit('RESET_INFORM_STORE');
		  store.commit('RESET_RECEIVE_INVITE_STIRE');
		  store.commit('RESET_CONVERSATION_STORE');
		},
	},
	actions: {}
})

export default store
