const state = {
	tabbarActive: 0,
	tabbarPageScrollTop: [0, 0, 0, 0],
	currentRouter: {
		meta: {}
	},
	duration: 3000,
	emptyDescription: "这里什么都没有",
	finishedText: "没有更多了",
	successText: "刷新成功",
	showNavBar: true,
	title: null,
	//
	shipList: [],
	curShipSn: null,
	curShipMMsi: null,
	curShipDevice: null,
	chatUsrId: null
}

const mutations = {
	SET_TABBARACTIVE: (state, object) => {
		state.tabbarActive = object
	},
	SET_APPLYPURCHASEDETAILS: (state, object) => {
		state.applyPurchaseDetails = object
	},
	SET_SPAREPARTACCESSDETAILSOUT: (state, object) => {
		state.sparePartAccessDetailsOut = object
	},
	SET_SPAREPARTACCESSDETAILSIN: (state, object) => {
		state.sparePartAccessDetailsIn = object
	},
	SET_SPAREPARTAPPLYDETAILS: (state, object) => {
		state.sparePartApplyDetails = object
	},
	SET_SPAREPARTAPPLYDETAILSBUY: (state, object) => {
		state.sparePartApplyDetailsBuy = object
	},
	SET_MAINTENANCEAPPLYDETAILS: (state, object) => {
		state.maintenanceApplyDetails = object
	}
}

const actions = {
	setTabbarActive({ commit }, object) {
		commit('SET_TABBARACTIVE', object)
	},
	setShoppingCart({
		commit
	}, object) {
		commit('SET_APPLYPURCHASEDETAILS', object)
	},
	setSparePartAccessDetailsOut({
		commit
	}, object) {
		commit('SET_SPAREPARTACCESSDETAILSOUT', object)
	},
	setSparePartAccessDetailsIn({
		commit
	}, object) {
		commit('SET_SPAREPARTACCESSDETAILSIN', object)
	},
	setSparePartApplyDetails({
		commit
	}, object) {
		commit('SET_SPAREPARTAPPLYDETAILS', object)
	},
	sparePartApplyDetailsBuy({
		commit
	}, object) {
		commit('SET_SPAREPARTAPPLYDETAILSBUY', object)
	},
	setMaintenanceApplyDetails({
		commit
	}, object) {
		commit('SET_MAINTENANCEAPPLYDETAILS', object)
	},
}

export default {
  namespaced: true,
  state,
  mutations,
  actions
}
