<template>
  <div class="graphic">
    <div class="banner">
      <div v-for="(item, index) in data.arrImgUrls" :key="index">
        <img
          v-show="index === 0"
          :src="item" 
          :preview="data.mid"
          preview-text="">
      </div>
    </div>
    <p class="desc" @click="goDetail">{{ data.profileDesc }}</p>
    <Follow :data="data" />
    <WinShop v-if="data.isWin" :data="data.winData"/>
    <span class="ad-sign" v-show="data.isAd"></span>
  </div>
</template>

<script>
import Vue from 'vue'
import Follow from './Follow.vue'
import WinShop from './WinShop.vue'
export default {
  components: {
    Follow,
    WinShop
  },
  props: {
    data: Object
  },
  data() {
    return {
      loadImg: false
    }
  },
  mounted() {

  },
  methods: {
    goDetail() {
      location.href = this.data.detailUrl;
    }
  }
}
</script>

<style lang="scss" scoped>
  .graphic{
    position: relative;
    .banner{
      img{
        width: 100%;
        object-fit: cover;
      }
    }
    .desc{
      display: -webkit-box;
      -webkit-line-clamp:2;
      overflow: hidden;
      text-overflow: ellipsis;
      -webkit-box-orient: vertical;
      font-size: 13px;
      line-height: 0.36rem;
      margin: 0.14rem;
      color: #282F3C;
    }
    .ad-sign{
      position: absolute;
      top: 0;
      right: 0;
      width: 0.3rem;
      height: 0.18rem;
      background: url('../imgs/icon_adimg.png');
      background-position: center center;
      background-size: 100% 100%;
    }
  }
</style>