card-list.vue 2.64 KB
<template>
  <LayoutApp title="我的银行卡">
    <div class="card-list">
      <div v-for="(card, index) in bankCardList" :key="index" class="card-item">
        <div class="card-info">
          <p class="bank-name">{{card.bankName}}</p>
          <p class="card-id">
            <span>****</span>
            <span>****</span>
            <span>****</span>
            <span class="num">{{card.bankCardNo}}</span>
          </p>
          <p class="user-name">持卡人:{{card.name}}</p>
        </div>
      </div>
    </div>

    <p class="change-tip">更换银行卡请致电官方客服</p>
    <p class="tel-num">
      <a href="tel:400-889-9646" class="tel-href">400-889-9646</a>
    </p>
  </LayoutApp>
</template>

<script>
import { createNamespacedHelpers } from 'vuex';
import LayoutApp from '../../components/layout/layout-app';
import {Scroll} from 'cube-ui';
const {mapState, mapActions} = createNamespacedHelpers('mine/bankCard');

export default {
  asyncData({store}) {
    return store.dispatch('mine/bankCard/fetchBankCard');
  },
  name: 'cardList',
  data() {
    return {};
  },
  mounted() {
    if (!this.bankCardList.length) {
      this.fetchBankCard();
    }
  },
  methods: {
    ...mapActions(['fetchBankCard'])
  },
  computed: {
    ...mapState(['bankCardList'])
  },
  components: {
    LayoutApp,
  }
};
</script>

<style lang="scss" scoped>
  /deep/ .layout-context {
    background-color: #f0f0f0!important;
  }
  .card-list {
    padding: 50px;
  }

  .card-item {
    margin: 30px;
    padding: 40px;
    background: linear-gradient(#363636, #1b181d);
    color: #fff;
    border-radius: 10px;
    position: relative;
    overflow: hidden;

    &:after {
      content: "";
      width: 100%;
      height: 120%;
      background: linear-gradient(116deg, #666, #111);
      transform: rotate(63deg);
      position: absolute;
      top: -20%;
      right: -31%;
      z-index: 1;
      opacity: 0.4;

    }

    .card-info {
      position: relative;
      z-index: 2;
    }

    .bank-name {
      font-size: 44px;
    }

    .card-id {
      font-size: 32px;
      padding-right: 30px;
      margin: 46px 0 40px;
      display: flex;
      justify-content: space-between;
      letter-spacing: 2px;

      .num {
        font-size: 40px;
        position: relative;
        top: -6px;
      }
    }

    .user-name {
      font-size: 28px;
      opacity: 0.9;
      position: relative;
      bottom: -6px;
    }
  }

  .change-tip,
  .tel-num {
    text-align: center;
    font-size: 28px;
    line-height: 1.5;
    color: #444;
    margin-bottom: 14px;
  }

  .tel-href {
    color: #d0021b;
    font-size: 27px;
    text-decoration: underline;
  }
</style>