<template>
  <div class="detail">
    <!-- 民宿名称区域 -->
    <div class="name">{{ detailObj.title }}</div>

    <!-- 民宿信息区域 -->
    <div class="info">
      <img :src="detailObj.url" />

      <div class="info_detail">
        <div class="detail_top">
          <div
            class="top_address"
            title="此处为民宿详细地址民宿详细地址此处为民宿详细地址民宿详细地址"
          >
            位置：此处为民宿详细地址民宿详细地址此处为民宿详细地址民宿详细地址
          </div>
          <div>联系电话：13677985625</div>
        </div>
        <div class="detail_bottom">
          <div class="bottom_box">床位数：250</div>
          <div class="bottom_box">联系人：张三</div>
          <div class="bottom_box">
            星级：
            <el-rate
              v-model="rateValue"
              :max="5"
              disabled
              disabled-void-color="transparent"
            />
          </div>
          <div>营业状态：营业中</div>
        </div>
      </div>
    </div>

    <!-- VR链接区域 -->
    <div class="link">
      VR链接：
      <div class="link_icon">
        <el-link href="https://www.baidu.com" target="_blank">
          <el-icon size="38" color="#7DC0FF"><Link /></el-icon>
        </el-link>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { ref } from "vue";
import { Link } from "@element-plus/icons-vue";

defineProps(["detailObj"]);

const rateValue = ref<number>(5);
</script>

<style lang="scss" scoped>
.detail {
  position: absolute;
  top: 0;
  left: 880px;
  width: 1024px;
  height: 737px;
  background-image: url(@/assets/images/54.png);
  background-size: 100% 100%;

  .name {
    margin-top: 16px;
    margin-left: 339px;
    padding: 0 10px;
    width: 357px;
    height: 66px;
    line-height: 66px;
    text-align: center;
    color: #8ec6fa;
    font-size: 24px;
    font-weight: bold;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
  }

  .info {
    position: relative;
    margin-top: 38px;
    margin-left: 62px;
    width: 859px;
    height: 485px;
    border-radius: 10px;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
    }

    .info_detail {
      position: absolute;
      bottom: 0;
      padding: 0 28px;
      width: 859px;
      height: 117px;
      font-size: 20px;
      background-color: rgba(0, 0, 0, 0.4);

      .detail_top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        height: 58px;

        .top_address {
          width: 540px;
          overflow: hidden;
          white-space: nowrap;
          text-overflow: ellipsis;
        }
      }

      .detail_bottom {
        display: flex;
        align-items: center;
        height: 58px;

        .bottom_box {
          display: flex;
          align-items: center;
          margin-right: 48px;
        }
      }
    }
  }

  .link {
    display: flex;
    align-items: center;
    margin-left: 90px;
    margin-top: 32px;
    font-size: 27px;

    .link_icon {
      transform: rotateY(180deg);
    }
  }
}

::v-deep(.el-rate .el-rate__icon.is-active) {
  margin: 0;
  color: #7dc0ff;
  font-size: 30px;
}
</style>
