hot.vue 1.65 KB
<template>
  <div class="hot" v-if="list.length > 0">
    <ul>
      <li v-for="(item, index) in list" :key="index" @click="goProduct(item)">
        <div class="hot-image">
          <ImgSize class="item-imge" :src="item.image_url" :width="100" :height="80"/>
        </div>
        <div class="hot-name">{{item.series_name}}</div>
      </li>
      <li @click="goMore">
        <div class="hot-image hot-more">更多</div>
        <div class="hot-name">More</div>
      </li>
    </ul>
  </div>
</template>

<script>
import ImgSize from '../../../../components/img-size';

export default {
  name: 'hot',
  props: {
    list: {
      type: Array,
      default: true,
    },
    
  },
  components: {
    ImgSize,
  },
  methods: {
    goProduct() {
      alert('跳转列表!');
    },

    goMore() {
      alert('跳转更多!');
    }

    // onClick() {
    //   this.$yoho.goNewPage({
    //     url: 'https://activity.yoho.cn/feature/5729.html?title=活动规则&openby:yohobuy={"action":"go.h5","params":{"title":"活动规则","url":"https://activity.yoho.cn/feature/5729.html"}}'
    //   });
    // }
  }
};
</script>

<style lang="scss" scoped>
.hot {
  margin: 40px 0;
  ul {
    overflow: hidden;
    li {
      width: 25%;
      float: left;
      text-align: center;
      margin-top: 20px;
      .hot-image {
        width: 150px;
        height: 100px;
        overflow: hidden;
        margin: 0 auto;
        img {
          width: 100%;
          height: 100%;
          display: block;
        }
      }
      .hot-name {
        margin-top: 20px;
      }
      .hot-more {
        line-height: 100px;
        border: 1px solid #999;
      }
    }
  }
}
</style>