<template>
  <div class="max-member" @click="jumpUrl('maxMember')">
    <div class="max-member-top">
      {{ formattedMaxMemberInfo && formattedMaxMemberInfo.expireTime }}
    </div>
    <div class="max-member-bottom">
      <cr-swipe
        class="swiper-con"
        :autoplay="2000"
        vertical
        :touchable="false"
        :show-indicators="false"
      >
        <cr-swipe-item
          v-for="(item, index) in formattedMaxMemberInfo && formattedMaxMemberInfo.text"
          :key="index"
          >{{ item }}</cr-swipe-item
        >
      </cr-swipe>
    </div>
  </div>
</template>

<script>
import config from '@/config';
import localStorageService from '@/service/localStorage.service';
export default {
  props: {
    maxMemberInfo: {
      type: Object,
      default: () => {}
    }
  },
  data() {
    return {};
  },
  computed: {
    formattedMaxMemberInfo() {
      return this.maxMemberInfo;
    }
  },
  methods: {
    jumpUrl(path) {
      const vccToken = this.$route.query.vccToken || localStorageService.get('vccToken');
      const jumpLink = `${config.vipHost}/${path}?vccToken=${vccToken}`;
      window.location.href = jumpLink;
    }
  }
};
</script>

<style lang="less" scoped>
.max-member {
  display: flex;
  background: url('https://img.lkbang.net/max-equities.6293c865.png') no-repeat;
  background-size: cover;
  border-radius: @border-radius-md;
  position: relative;
  .swiper-con {
    height: 28px;
    line-height: 28px;
  }
  &-top {
    position: absolute;
    .text-size(12);
    color: #a8b6d7;
    right: 14px;
    top: 23px;
  }
  &-bottom {
    position: absolute;
    .text-size(12);
    color: #fff;
    bottom: 0;
    right: 20px;
  }
}
</style>
