<template>
  <div class="circle-item" @click="toCircleDetail">
    <img class="cover" :src="item.coverImage" alt="" />
    <div class="circle-info">
      <h3>{{ item.name }}</h3>
      <p>{{ item.remark }}</p>
      <div class="price">
        <div class="tg-info">
          <img class="photo" :src="item.advisor.avatar" alt="" srcset="" />
          <span>{{ item.showName }}</span>
        </div>
        <!-- <h5>￥<strong>19333</strong>/6个月</h5> -->
        <h5>{{ item.authorityId ? "收费" : "免费" }}</h5>
      </div>
    </div>
  </div>
</template>
<script setup>
import { defineProps } from "vue"
import { useRouter, useRoute } from "vue-router"
/**
 * 路由实例
 */
const router = useRouter()
const route = useRoute()

const props = defineProps({
  item: {
    type: Object,
    default: () => {},
  },
})

const toCircleDetail = () => {
  router.push(
    `/circle/interact?id=${props.item.id}&saleUserId=${
      route.query.saleUserId || ""
    }`
  )
}
</script>
<style lang="scss" scoped>
.circle-item {
  display: flex;
  .cover {
    display: block;
    width: 168px;
    height: 200px;
    margin-right: 20px;
  }
  .circle-info {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 1;
    h3 {
      line-height: 58px;
      font-size: 36px;
      text-align: left;
    }
    p {
      font-size: 28px;
      color: #999;
      line-height: 36px;
      text-align: left;
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2; // 表示需要显示的行数
      -webkit-box-orient: vertical; //子代元素垂直显示
    }
    .price {
      display: flex;
      justify-content: space-between;
      .tg-info {
        display: flex;
        align-items: center;
        img {
          width: 32px;
          height: 32px;
          border-radius: 50%;
          margin-right: 4px;
        }
        span {
          font-size: 28px;
          color: #999;
        }
      }
      h5 {
        color: #2196f3;
        font-size: 28px;
        strong {
          font-size: 36px;
        }
      }
    }
  }
}
</style>
