index.vue
3.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<!--
* @Date: 2022-09-19 14:11:06
* @LastEditors: hookehuyr hookehuyr@gmail.com
* @LastEditTime: 2023-12-19 15:21:03
* @FilePath: /meihuaApp/src/pages/detail/index.vue
* @Description: 文件描述
-->
<template>
<view style="position: relative; height: 100vh;">
<nut-swiper :init-page="page" :pagination-visible="true" pagination-color="#426543" auto-play="5000">
<nut-swiper-item v-for="(item, index) in state.imgData" :key="index">
<image @tap="showFn" style="width: 100%; height: 150px;" mode="aspectFill" :src="item.src" />
</nut-swiper-item>
</nut-swiper>
<view style="padding: 1rem;">
<view style="color: #0B0B0B; font-size: 1rem; font-weight: bold;">非凡魅力豪华总统套房</view>
<view style="color: #7D7C7C; font-size: 0.8rem;">两室 宜住3人</view>
</view>
<view vif="!showBook" style="width: 100%; height: 1rpx; background-color: rgb(244, 244, 244);"></view>
<view v-if="showBook" id="book-cal" class="book-cal">
<calendar-select @on-dates-change="onDatesChange"></calendar-select>
</view>
<view style="padding: 1rem; text-align: center; font-weight: bold;">房间介绍</view>
<view style="padding: 0 1rem;">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Quidem quibusdam nostrum numquam quaerat corporis totam similique expedita, omnis ratione aut magnam nihil. Modi repudiandae at minus enim beatae fugit. Modi.</view>
<view v-if="showBook" style="position: fixed; bottom: 0; left: 0; right: 0; background-color: #fff; height: 4rem; padding: 30rpx 30rpx 20rpx 30rpx;box-shadow: 0px -5px 4px 0px rgba(0,0,0,0.07);">
<nut-row>
<nut-col :span="18">
<view style="height: 2rem; margin-left: 0.5rem; display: flex; align-items: center;">
<text style="color: #EB2E2E; font-size: 1.3rem; font-weight: bold;">¥980</text>
<text style="color: #7D7C7C; text-decoration: line-through; font-size: 0.85rem; margin-left: 5px;">¥1280</text>
</view>
</nut-col>
<nut-col :span="6">
<view @tap="goToConfirm" style="background-color: #6A4925; border-radius: 1.25rem; padding: 0.25rem 0.5rem; color: #fff; text-align: center; height: 2rem; line-height: 2rem;">预定</view>
</nut-col>
</nut-row>
</view>
<nut-image-preview :show="state.showPreview" :images="state.imgData" :is-Loop="false" @close="hideFn" />
</view>
</template>
<script setup>
import Taro from '@tarojs/taro'
import { ref, computed, reactive } from "vue";
import calendarSelect from '@/components/calendarSelect.vue'
// TODO: 到时候根据后端实际字段修改
// const book_status = ref('已约满');
const book_status = ref('');
const showBook = computed(() => {
return book_status.value !== '已约满'
});
const onDatesChange = ({ startDate, endDate }) => {
console.warn(startDate, endDate);
}
const page = ref(1);
const goToConfirm = () => {
Taro.navigateTo({
url: '/pages/confirm/index?id=123',
})
}
const state = reactive({
showPreview: false,
imgData: [
{
src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
},
{
src: 'https://cdn.ipadbiz.cn/meihua/banner1@2x.png'
},
{
src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
},
{
src: 'https://cdn.ipadbiz.cn/meihua/img1@2x.png'
}
]
});
const showFn = () => {
state.showPreview = true;
};
const hideFn = () => {
state.showPreview = false;
};
</script>
<script>
import "./index.less";
export default {
name: "detailPage",
};
</script>