hookehuyr

fix 完善房间组件显示

1 <!-- 1 <!--
2 * @Date: 2023-12-13 13:42:23 2 * @Date: 2023-12-13 13:42:23
3 * @LastEditors: hookehuyr hookehuyr@gmail.com 3 * @LastEditors: hookehuyr hookehuyr@gmail.com
4 - * @LastEditTime: 2023-12-19 15:02:45 4 + * @LastEditTime: 2023-12-20 10:57:44
5 * @FilePath: /meihuaApp/src/components/roomCard.vue 5 * @FilePath: /meihuaApp/src/components/roomCard.vue
6 - * @Description: 文件描述 6 + * @Description: 房间详情组件
7 --> 7 -->
8 <template> 8 <template>
9 <view class="room-card-component" @tap="handleTap"> 9 <view class="room-card-component" @tap="handleTap">
10 - <image style="width: 100%; height: 10rem;" mode="aspectFill" src="https://cdn.ipadbiz.cn/meihua/img1@2x.png" /> 10 + <image class="room-cover" mode="aspectFill" src="https://cdn.ipadbiz.cn/meihua/img1@2x.png" />
11 - <view style="padding: 0.5rem;"> 11 + <view class="room-info">
12 <nut-row> 12 <nut-row>
13 - <nut-col span="18"> 13 + <nut-col span="18" class="room-info-left">
14 <view style="color: #0B0B0B; font-weight: bold;">非凡魅力豪华总统套房</view> 14 <view style="color: #0B0B0B; font-weight: bold;">非凡魅力豪华总统套房</view>
15 <view style="color: #7D7C7C; font-size: 0.8rem;">两室 宜住3人</view> 15 <view style="color: #7D7C7C; font-size: 0.8rem;">两室 宜住3人</view>
16 </nut-col> 16 </nut-col>
17 - <nut-col span="6"> 17 + <nut-col span="6" class="room-info-right">
18 <view style="float: right; color: #EB2E2E; font-weight: bold; font-size: 1.1rem;">¥980</view> 18 <view style="float: right; color: #EB2E2E; font-weight: bold; font-size: 1.1rem;">¥980</view>
19 <view style="float: right; color: #7D7C7C; font-size: 0.8rem; text-decoration: line-through;">¥1280</view> 19 <view style="float: right; color: #7D7C7C; font-size: 0.8rem; text-decoration: line-through;">¥1280</view>
20 </nut-col> 20 </nut-col>
21 </nut-row> 21 </nut-row>
22 </view> 22 </view>
23 - <view style="width: 100%; height: 10rem; position: absolute; left: 0; top: 0; background-color: rgba(0, 0, 0, 0.5);"> 23 + <view class="room-status">
24 - <view style="position: absolute; left: calc(50% - 200rpx / 2); right: 0; top: 50rpx;"> 24 + <view class="room-status-wrapper">
25 - <image style="width: 200rpx; height: 200rpx;" mode="aspectFill" src="https://cdn.ipadbiz.cn/meihua/icon_checked@2x.png" /> 25 + <image mode="aspectFill" src="https://cdn.ipadbiz.cn/meihua/icon_checked@2x.png" />
26 </view> 26 </view>
27 </view> 27 </view>
28 </view> 28 </view>
...@@ -41,12 +41,12 @@ const props = defineProps({ ...@@ -41,12 +41,12 @@ const props = defineProps({
41 41
42 const handleTap = () => { 42 const handleTap = () => {
43 Taro.navigateTo({ 43 Taro.navigateTo({
44 - url: '../detail/index', 44 + url: '../detail/index?id=123',
45 }) 45 })
46 } 46 }
47 47
48 onMounted(() => { 48 onMounted(() => {
49 - console.warn(props.status); 49 + console.warn('房间详情的状态属性', props.status);
50 }) 50 })
51 51
52 </script> 52 </script>
...@@ -60,12 +60,27 @@ onMounted(() => { ...@@ -60,12 +60,27 @@ onMounted(() => {
60 border: 1px solid #f9f9f9; 60 border: 1px solid #f9f9f9;
61 border-radius: 0.5rem; 61 border-radius: 0.5rem;
62 overflow: hidden; 62 overflow: hidden;
63 -} 63 + .room-cover {
64 - 64 + width: 100%;
65 -.room-card-component img { 65 + height: 10rem;
66 -} 66 + }
67 - 67 + .room-info {
68 -.room-card-component.nut-row { 68 + padding: 0.5rem;
69 - // padding: 0.5rem; 69 + }
70 + .room-status {
71 + width: 100%;
72 + height: 10rem;
73 + position: absolute;
74 + left: 0;
75 + top: 0;
76 + background-color: rgba(0, 0, 0, 0.5);
77 + .room-status-wrapper {
78 + position: absolute; left: calc(50% - 200rpx / 2); right: 0; top: 50rpx;
79 + image {
80 + width: 200rpx;
81 + height: 200rpx;
82 + }
83 + }
84 + }
70 } 85 }
71 </style> 86 </style>
......