<template>
  <n-card class="exhibition-box" @click="handleTodetail">
    <div class="box">
      <img class="cover" :src="cover" />
      <div class="info">
        <div class="title">{{ title }}</div>
        <div class="content—box">{{ content }}</div>
        <div class="label-box">
          <div class="label location">{{ location }}</div>
          <div class="label type">{{ type }}</div>
          <div v-if="isHasVR" class="vr_button"></div>
        </div>
      </div>
    </div>
  </n-card>
</template>
<script setup>
import { useRouter } from "vue-router";
const router = useRouter();

defineOptions({
  name: "exhibition-box",
});

const props = defineProps({
  id: {
    type: [String, Number],
    default: () => "",
  },
  title: {
    type: String,
    default: () => "",
  },
  cover: {
    type: String,
    default: () => "",
  },
  content: {
    type: String,
    default: () => "",
  },
  location: {
    type: String,
    default: () => "",
  },
  type: {
    type: String,
    default: () => "",
  },
  isHasVR: {
    type: [Boolean, undefined],
    default: () => undefined,
  },
});
const handleTodetail = () => {
  if (props.id) {
    console.log("router", router);
    router.push("/exhibition-detail/" + props.id);
    console.log("111", props.id);
  }
};
</script>

<style lang="scss" scoped>
.n-card.exhibition-box {
  --n-title-font-weight: 600 !important;
  --n-title-font-size: 1.75rem !important;
  --n-padding-top: 0.625rem !important;
  --n-padding-bottom: 0.625rem !important;
  border-radius: 1.875rem;
  box-shadow: var(--main-box-shadow);
  cursor: pointer;
}
.exhibition-box {
  .box {
    width: 100%;
    height: 100%;
    display: inline-flex;
    flex-direction: row;

    .cover {
      height: 13.4375rem;
      width: auto;
    }
    .info {
      flex: 1;
      padding-left: 3.125rem;
      .title {
        font-size: 1.75rem;
        font-weight: 700;
        padding: 0.5rem 0 1rem 0;
      }
      .content—box {
        font-size: 16px;
        color: #6e6e6e;
        height: 6.25rem;
        overflow: hidden;
      }
      .label-box {
        display: inline-flex;
        height: 2.5rem;
        align-items: center;
        gap: 0 10px;
        width: 100%;
        color: #6e6e6e;
        font-size: 1rem;
        .label {
          background-image: url("img/dot.png");
          background-size: 0.9375rem 0.9375rem;
          background-repeat: no-repeat;
          padding-left: 1.375rem;
          background-position: center left;
        }
      }
    }
  }
}
</style>
