|
@@ -1,7 +1,8 @@
|
|
|
import { message } from 'ant-design-vue'
|
|
import { message } from 'ant-design-vue'
|
|
|
import store from '@/store'
|
|
import store from '@/store'
|
|
|
import {
|
|
import {
|
|
|
- getHotelsAPI
|
|
|
|
|
|
|
+ getHotelsAPI,
|
|
|
|
|
+ getHotelByIdAPI
|
|
|
} from '@/api/hotel'
|
|
} from '@/api/hotel'
|
|
|
|
|
|
|
|
const hotel = {
|
|
const hotel = {
|
|
@@ -32,10 +33,10 @@ const hotel = {
|
|
|
set_hotelListLoading: function(state, data) {
|
|
set_hotelListLoading: function(state, data) {
|
|
|
state.hotelListLoading = data
|
|
state.hotelListLoading = data
|
|
|
},
|
|
},
|
|
|
- set_currenhotelId: function(state, data) {
|
|
|
|
|
|
|
+ set_currentHotelId: function(state, data) {
|
|
|
state.currentHotelId = data
|
|
state.currentHotelId = data
|
|
|
},
|
|
},
|
|
|
- set_currenhotelInfo: function(state, data) {
|
|
|
|
|
|
|
+ set_currentHotelInfo: function(state, data) {
|
|
|
state.currentHotelInfo = {
|
|
state.currentHotelInfo = {
|
|
|
...state.currentHotelInfo,
|
|
...state.currentHotelInfo,
|
|
|
...data
|
|
...data
|
|
@@ -49,20 +50,16 @@ const hotel = {
|
|
|
if(res){
|
|
if(res){
|
|
|
commit('set_hotelList', res)
|
|
commit('set_hotelList', res)
|
|
|
commit('set_hotelListLoading', false)
|
|
commit('set_hotelListLoading', false)
|
|
|
- console.log(state.hotelList)
|
|
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
- // getByHotelId: async({commit, state}) => {
|
|
|
|
|
- // const res = await getByHotelIdAPI({
|
|
|
|
|
- // hotelId: state.currenhotelId
|
|
|
|
|
- // })
|
|
|
|
|
- // if(res){
|
|
|
|
|
- // commit('set_currenhotelInfo', res)
|
|
|
|
|
- // commit('set_rateParams',{
|
|
|
|
|
- // rate: state.currenhotelInfo.myRate/2
|
|
|
|
|
- // })
|
|
|
|
|
- // }
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ getHotelById: async({commit, state}) => {
|
|
|
|
|
+ const res = await getHotelByIdAPI({
|
|
|
|
|
+ hotelId: state.currentHotelId
|
|
|
|
|
+ })
|
|
|
|
|
+ if(res){
|
|
|
|
|
+ commit('set_currentHotelInfo', res)
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|