1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- export default {
- namespaced: true,
- state: () => ({
- checkinInfo: JSON.parse(uni.getStorageSync('checkinInfo') || '{}'),
- reservationInfo: uni.getStorageSync('reservationInfo') || {},
- hotelParams: JSON.parse(uni.getStorageSync('hotelParams') || '{}'),
- currentHotelId: uni.getStorageSync('currentHotelId') || '',
- currentHotelName: uni.getStorageSync('currentHotelName') || '',
- }),
- mutations: {
- updateCheckinInfo(state, checkinInfo) {
- state.checkinInfo = checkinInfo
- this.commit('m_business/saveCheckinInfoToStorage')
- },
- saveCheckinInfoToStorage(state) {
- uni.setStorageSync('checkinInfo', JSON.stringify(state.checkinInfo))
- },
- updateReservationInfo(state, reservationInfo) {
- state.reservationInfo = reservationInfo
- this.commit('m_business/saveReservationInfoToStorage')
- },
- saveReservationInfoToStorage(state) {
- uni.setStorageSync('reservationInfo', state.reservationInfo)
- },
- updateHotelParams(state, hotelParams) {
- state.hotelParams = hotelParams
- this.commit('m_business/saveHotelParamsToStorage')
- },
- saveHotelParamsToStorage(state) {
- uni.setStorageSync('hotelParams', state.hotelParams)
- },
- updateCurrentHotelId(state, currentHotelId) {
- state.currentHotelId = currentHotelId
- this.commit('m_business/saveCurrentHotelIdToStorage')
- },
- saveCurrentHotelIdToStorage(state) {
- uni.setStorageSync('currentHotelId', state.currentHotelId)
- },
- updateCurrentHotelName(state, currentHotelName) {
- state.currentHotelName = currentHotelName
- this.commit('m_business/saveCurrentHotelNameToStorage')
- },
- saveCurrentHotelNameToStorage(state) {
- uni.setStorageSync('currentHotelName', state.currentHotelName)
- },
- },
- getters: {},
- }
|