12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- export default {
- namespaced: true,
- state: () => ({
- checkinInfo: JSON.parse(uni.getStorageSync('checkinInfo') || '{}'),
- roomType: uni.getStorageSync('roomType') || '',
- 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))
- },
- updateRoomType(state, roomType) {
- state.roomType = roomType
- this.commit('m_business/saveRoomTypeToStorage')
- },
- saveRoomTypeToStorage(state) {
- uni.setStorageSync('roomType', state.roomType)
- },
- 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: {},
- }
|