<template>
  <view class="date-selector" @click="showCalendar">
    <view class="date-item">
      <view class="date-label">入住日期</view>
      <view class="date-box">
        <view class="date-content">
          <text class="date-text">{{ checkInDate }}</text>
          <text class="day-text">{{ checkInDay }}</text>
        </view>
      </view>
    </view>

    <view class="nights-info">
      <text class="nights-text">{{ nights }}晚</text>
    </view>

    <view class="date-item">
      <view class="date-label">退房日期</view>
      <view class="date-box">
        <view class="date-content">
          <text class="date-text">{{ checkOutDate }}</text>
          <text class="day-text">{{ checkOutDay }}</text>
        </view>
      </view>
    </view>
  </view>
</template>

<script setup>
import { defineProps, defineEmits } from "vue";

// 定义事件
const emit = defineEmits(["showCalendar"]);

// 定义方法
const showCalendar = () => {
  emit("showCalendar");
};

// Props定义
const props = defineProps({
  checkInDate: {
    type: String,
    default: "08月25日",
  },
  checkOutDate: {
    type: String,
    default: "08月25日",
  },
  checkInDay: {
    type: String,
    default: "周一",
  },
  checkOutDay: {
    type: String,
    default: "周一",
  },
  nights: {
    type: Number,
    default: 1,
  },
});
</script>

<style scoped lang="scss">
@import "./styles/index.scss";
</style>
