1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- export default {
- namespaced: true,
- state: () => ({
- checkinInfo: JSON.parse(uni.getStorageSync('checkinInfo') || '[]'),
- order: JSON.parse(uni.getStorageSync('order') || '{}'),
- currentHotel: JSON.parse(uni.getStorageSync('currentHotel') || '{}'),
- queryOrderResult: JSON.parse(uni.getStorageSync('queryOrderResult') || '{}'),
- idCardInfo: JSON.parse(uni.getStorageSync('idCardInfo') || '[]'),
- }),
- mutations: {
- updateCheckinInfo(state, checkinInfo) {
- state.checkinInfo = checkinInfo
- this.commit('m_business/saveCheckinInfoToStorage')
- },
- saveCheckinInfoToStorage(state) {
- uni.setStorageSync('checkinInfo', JSON.stringify(state.checkinInfo))
- },
- updateOrder(state, order) {
- state.order = order
- this.commit('m_business/saveOrderToStorage')
- },
- saveOrderToStorage(state) {
- uni.setStorageSync('order', JSON.stringify(state.order))
- },
- updateCurrentHotel(state, currentHotel) {
- state.currentHotel = currentHotel
- this.commit('m_business/saveCurrentHotelToStorage')
- },
- saveCurrentHotelToStorage(state) {
- uni.setStorageSync('currentHotel', JSON.stringify(state.currentHotel))
- },
- updateQueryOrderResult(state, queryOrderResult) {
- state.queryOrderResult = queryOrderResult
- this.commit('m_business/saveQueryOrderResultToStorage')
- },
- saveQueryOrderResultToStorage(state) {
- uni.setStorageSync('queryOrderResult', JSON.stringify(state.queryOrderResult))
- },
- updateIdCardInfo(state, idCardInfo) {
- state.idCardInfo = idCardInfo
- this.commit('m_business/saveIdCardInfoToStorage')
- },
- saveIdCardInfoToStorage(state) {
- uni.setStorageSync('idCardInfo', JSON.stringify(state.idCardInfo))
- },
- },
- getters: {},
- }
|