<template>
  <div class="com flex" v-if="list.length">
    <img class="icon" src="/img/copy/market/icon5.png" alt="">
    <van-swipe
      vertical
      class="notice-swipe"
      :autoplay="3000"
      :show-indicators="false"
    >
      <van-swipe-item v-for="(item) in list" style="height: 17px;" :key="item.id">
        <div class="text">
          {{ item.user_title }} <span class="span">{{ $t('follow.l164') }}</span> {{ item.expert_title }}
        </div>
      </van-swipe-item>
    </van-swipe>
  </div>
</template>
<script>
import { getExpertFollowList } from "@/api/copy";
export default {
  data () {
    return {
      list: []
    }
  },
  created () {
    this.getExpertFollowList()
  },
  methods: {
    getExpertFollowList() {
      getExpertFollowList({
        pageNum: 1,
        pageSize: 10,
      }).then(res => {
        this.list = res.list || []
      }).catch(() => {})
    },
    formatTime(val) {
      if (val) {
        return (val.split(' ')[0]).replace(new RegExp(/-/gm), "/")
      }
      return ''
    }
  }
}
</script>
<style lang="less" scoped>
.com {
  height: 37px;
  padding: 0 16px;
  column-gap: 9px;
  .icon {
    min-width: 15px;
    max-width: 15px;
  }
}
.van-swipe {
  flex: 1;
  height: 17px;
  line-height: 17px;
  .van-swipe-item {
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .text {
    font-size: 12px;
    color: #888888;
  }
  .span {
    color: #B6B6B6;
  }
}
</style>