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') || '{}'),
- guestInfo: JSON.parse(uni.getStorageSync('checkinInfo') || '[]'),
- }),
- 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))
- },
- updateGuestInfo(state, guestInfo) {
- state.guestInfo = guestInfo
- this.commit('m_business/saveGuestInfoToStorage')
- },
- saveGuestInfoToStorage(state) {
- uni.setStorageSync('guestInfo', JSON.stringify(state.guestInfo))
- },
- },
- getters: {},
- }
|