index.vue 1.86 KB
<template>
  <div class="book-item van-hairline--bottom" @click="handle">
    <van-row>
      <van-col span="8">
        <van-image width="7rem" height="7rem" :src="item.cover" style="text-align: center;" />
      </van-col>
      <van-col class="wrapper" span="16">
        <p class="title van-multi-ellipsis--l2">{{ item.name }}</p>
        <div v-if="type === 'C'" class="van-multi-ellipsis--l2 content">{{ item.note }}</div>
        <div class="sub">
          <van-icon :name="icon_video" />&nbsp;&nbsp;<span>{{ item.prod_num }}个作品</span>
        </div>
        <div v-if="type === 'B'" class="upload" @click="onUpload(item)">上传视频</div>
      </van-col>
    </van-row>
  </div>
</template>

<script setup>
import icon_video from '@images/video.png'
import { ref, reactive, onMounted } from 'vue'
const props = defineProps({
  item: Object,
  type: String
})
const emit = defineEmits(['on-click']);
const handle = () => {
  if (props.type === 'C') { // 类型是客户端时,才能查看
    emit('on-click', '')
  }
}

// 上传视频
const onUpload = (v) => {
  console.warn(v);
}
onMounted(() => {

})
</script>

<script>
export default {
  data() {
    return {

    }
  },
  mounted() {

  },
  methods: {

  }
}
</script>

<style lang="less" scoped>
.book-item {
  // margin: 1rem;
  padding: 1rem;

  .wrapper {
    padding-left: 1rem;

    .title {
      font-size: 1.15rem;
      color: #222222;
      font-weight: bold;
      margin: 0.5rem 0;
    }

    .content {
      font-size: 0.85rem;
      color: #999999;
      margin: 0.5rem 0;
    }

    .sub {
      font-size: 0.85rem;
      color: #999999;
      margin-top: 0.5rem;
    }

    .upload {
      color: #713610;
      background-color: #F9D95C;
      border-radius: 15px;
      width: 4rem;
      padding: 0.25rem 0.5rem;
      font-size: 0.8rem;
      text-align: center;
      margin-top: 1rem;
    }
  }
}
</style>