|
|
@@ -1,19 +1,113 @@
|
|
|
<template>
|
|
|
- <div>hotelDetail</div>
|
|
|
+ <a-layout>
|
|
|
+ <a-layout-content>
|
|
|
+ <div class="hotelDetailCard">
|
|
|
+ <h1>
|
|
|
+ {{ currentHotelInfo.title }}
|
|
|
+ </h1>
|
|
|
+ <div class="hotel-info">
|
|
|
+ <a-card style="width: 240px">
|
|
|
+ <img
|
|
|
+ alt="example"
|
|
|
+ src="@/assets/cover.jpeg"
|
|
|
+ slot="cover"
|
|
|
+ referrerPolicy="no-referrer"
|
|
|
+ />
|
|
|
+ </a-card>
|
|
|
+ <div class="info">
|
|
|
+ <div class="items" v-if="currentHotelInfo.name">
|
|
|
+ <span class="label">酒店名称:</span>
|
|
|
+ <span class="value">{{ currentHotelInfo.name }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-if="currentHotelInfo.address">
|
|
|
+ <span class="label">地址</span>
|
|
|
+ <span class="value">{{ currentHotelInfo.address }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-if="currentHotelInfo.casts">
|
|
|
+ <span class="label">主演:</span>
|
|
|
+ <span class="value" v-for="item in currentHotelInfo.casts" :key="item.index">{{ item }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-if="currentHotelInfo.rate">
|
|
|
+ <span class="label">评分:</span>
|
|
|
+ <span class="value">{{ currentHotelInfo.rate }}</span>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-if="currentHotelInfo.hotelStar">
|
|
|
+ <span class="label">星级:</span>
|
|
|
+ <a-rate style="font-size: 15px" :value="currentHotelInfo.rate" disabled allowHalf/>
|
|
|
+ </div>
|
|
|
+ <div class="items" v-if="currentHotelInfo.description">
|
|
|
+ <span class="label">酒店简介:</span>
|
|
|
+ <span class="value">{{ currentHotelInfo.description }}</span>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+
|
|
|
+ </div>
|
|
|
+ <a-divider></a-divider>
|
|
|
+ </a-layout-content>
|
|
|
+ </a-layout>
|
|
|
</template>
|
|
|
<script>
|
|
|
+import { mapGetters, mapActions, mapMutations } from 'vuex'
|
|
|
export default {
|
|
|
name: 'hotelDetail',
|
|
|
+ components: {
|
|
|
+
|
|
|
+ },
|
|
|
data() {
|
|
|
return {
|
|
|
|
|
|
}
|
|
|
},
|
|
|
- mounted(){
|
|
|
-
|
|
|
+ computed: {
|
|
|
+ ...mapGetters([
|
|
|
+ 'currentHotelInfo',
|
|
|
+ ])
|
|
|
+ },
|
|
|
+ mounted() {
|
|
|
+ this.set_currentHotelId(Number(this.$route.params.hotelId))
|
|
|
+ this.getHotelById()
|
|
|
+ },
|
|
|
+ beforeRouteUpdate(to, from, next) {
|
|
|
+ this.set_currentHotelId(Number(to.params.hotelId))
|
|
|
+ this.getHotelById()
|
|
|
+ next()
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ ...mapMutations([
|
|
|
+ 'set_currentHotelId',
|
|
|
+ ]),
|
|
|
+ ...mapActions([
|
|
|
+ 'getHotelById'
|
|
|
+ ])
|
|
|
}
|
|
|
}
|
|
|
</script>
|
|
|
-<style scoped>
|
|
|
-
|
|
|
+<style scoped lang="less">
|
|
|
+ .hotelDetailCard {
|
|
|
+ padding: 50px 50px;
|
|
|
+ }
|
|
|
+ .hotel-info {
|
|
|
+ display: flex;
|
|
|
+ align-items: stretch;
|
|
|
+ justify-content: flex-start;
|
|
|
+ .info{
|
|
|
+ padding: 10px 0;
|
|
|
+ display: flex;
|
|
|
+ flex-direction: column;
|
|
|
+ margin-left: 20px;
|
|
|
+ .items {
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ .label{
|
|
|
+ margin-right: 10px;
|
|
|
+ font-size: 18px;
|
|
|
+ }
|
|
|
+ .value {
|
|
|
+ margin-right: 15px
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
</style>
|