<script setup lang='ts'>
import { sceneBookingApi } from '@/api/api/sceneBooking';


const bookedDetail = ref({} as any)

const route = useRoute()

const getDetailById = async() => {
  const res:any = await sceneBookingApi.getDetailByIdAPI(route.params.id)

  if(res.code === 0){
    bookedDetail.value = res.data
  }
}

onMounted(() => {
  getDetailById()

})
</script>

<template>
  <div class='detail-box'>
    <div class="title">
      <img src="@/assets/images/cicle.png" alt="">
      <div class="title-content">我的预约</div>
    </div>
    <div class="info-box">
      <div>参观日期：{{ bookedDetail.bookDate + ' ' + bookedDetail.time }}</div>
      <div>当前状态：{{ bookedDetail.status === 0 ? '未验证' : '已验证' }}</div>
    </div>
    <div class="info-box-card" v-for="(item, index) in bookedDetail.rtf" :key="index">
      <div>参观人姓名：{{ item.name }}</div>
      <div>参观人电话：{{ item.phone }}</div>
      <div>{{ item.type + '号：' + item.num }}</div>
    </div>
    <div class="code-box" >
      <img src="@/assets/images/code.png" alt="">
      <div>验证码：56717</div>
    </div>
  </div>
</template>

<style lang='less' scoped>
.detail-box {
  width: 100%;
  height: 100%;
  background: #F7F3E8;
  overflow: auto;
  padding: 40px 20px;
  font-family: SourceHanSansCN-Regular;

  .title {
    font-size: 1.4em;
    color: #333333;
    font-weight: bold;
    position: relative;
    // line-height: 1.6em;
    display: flex;
    align-items: flex-end;
    margin-bottom: 10px;

    img {
      position: absolute;
      left: 0;
      top: 0;
      height: 1.6em;
    }

    .title-content {
      // position: absolute;
      position: relative;
      left: 0;
      top: 0;
      height: 1.4em;
      z-index: 2;
      line-height: 1.6em;
      color: #333333;
      margin-top: 1%;
      font-family: SourceHanSansCN-Bold;

    }

  }

  .info-box {
    margin-top: 20px;
    color: #333333;
    line-height: 2em;
    font-family: SourceHanSansCN-Regular;
  }

  .info-box-card{
    width: 100%;
    border-radius: 10px;
    background: url(@/assets/images/booked-card.png);
    background-size: 100% 100%;
    margin-top: 30px;
    color: #F7F3E8;
    line-height: 3em;
    font-size: 1.1em;
    padding: 5% 8%;
  }

  .code-box{
    width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 10%;
    img{
      width: 50%;
      margin-bottom: 10px;
    }
    div {
      width: 50%;
      text-align: center;
      color: #333333;
    }
  }

}
</style>