<template>
  <div class="wallet" @click="_wallet">
    <div class="btn">
      <div class="icon" :style="{background: channelInfo && channelInfo.screenDirection === 'vertical' ? `url(${defaultIcon}) no-repeat center center` : ''}"></div>
    </div>
    <div class="title">提现</div>
  </div>
</template>
<script>
import { mapGetters } from 'vuex';

export default {
  name: 'suspension-wallet',
  data() {
    return {
       defaultIcon: require('./img/icon-wallet.png')
    };
  },
  computed: {
    ...mapGetters({
      type: 'type',
      channelInfo: 'channelInfo',
      userInfo: 'userInfo',
      jumpUrls: 'jumpUrls'
    })
  },
  methods: {
    _wallet() {
      if (!this.userInfo.id) {
        this.$layer.msg('请先登录');
        this.$Bus.$emit('bus-showLogin', true);
      } else {
        window.location.href = this.jumpUrls.center_wallet;
      }
    }
  }
};
</script>
<style lang="less" scoped>
.wallet {
  width: 0.8rem;
  height: 0.8rem;
  .btn {
    position: relative;
    padding: 0 0.1rem;
    width: 0.8rem;
    height: 0.6rem;
    background: var(--suspension-wallet-bg) no-repeat center center;
    background-size: contain;
    .icon {
      width: 100%;
      height: 100%;
      background: var(--suspension-wallet-icon) no-repeat center center;
      background-size: auto 50%;
    }
  }
  .title {
    margin-top: 0.04rem;
    line-height: 0.18rem;
    text-align: center;
    white-space: nowrap;
    font-size: 0.16rem;
  }
}
</style>
