<template>
  <view class="head-new-vu flex al-item-center">
    <swiper
      class="swiper-box"
      vertical="true"
      autoplay="true"
      circular="true"
      :indicator-dots="false"
      :auto-play="true"
    >
      <swiper-item
        class="swiper-item"
        v-for="(item, idx) in shopNotice"
        :key="idx"
        @click="goto"
        :data-url="item.hrefurl"
      >
        <view class="new-cnt">
          <image class="notice-icon" :src="noticeIcon ? noticeIcon:event_rul + '/static/theme/note-icon.svg'"></image>
          <view class="notice-txt">{{ item.title }}</view>
        </view>
      </swiper-item>
    </swiper>
  </view>
</template>

<script>
var app = getApp();
export default {
  props: {
    noticeIcon: {
      type: String,
      default: '',
    },
    shopNotice: {
      type: Array,
      default: function() {
        return [];
      },
    },
  },
  data() {
    return {
      event_rul: app.globalData.event_url,
    };
  },
  mounted() {},
  methods: {},
};
</script>

<style lang="scss" scoped>
.head-new-vu {
  width: 100%;
  height: 80rpx;
  margin-top: 16rpx;
  border-radius: 10rpx;
  background: #FFF;
  padding: 0 20rpx;
  .swiper-box,.swiper-item {
    width: 100%;
    height: 100%;
  }

  .new-cnt {
    height: 100%;
    display: flex;
    align-items: center;
    .notice-icon {
      width: 50rpx;
      height: 50rpx;
      flex-shrink: 0;
      margin-right: 12rpx;
    }
    .notice-txt {
      flex: 1;
      color: #666;
      overflow: hidden;
      white-space: nowrap;
      text-overflow: ellipsis;
    }
  }
}

</style>