<template>
  <div class="main">
    <div class="item">
      <p class="label">姓名</p>
      <p class="value">{{ extra.aac003 }}</p>
    </div>
    <div class="item">
      <p class="label">人员识别号</p>
      <p class="value">{{ detail.baz805 }}</p>
    </div>
    <div class="item">
      <p class="label">社保账号</p>
      <p class="value">{{ extra.bac045 }}</p>
    </div>
    <div class="item">
      <p class="label">身份证号</p>
      <p class="value">{{ extra.aae135 }}</p>
    </div>
    <div class="item">
      <p class="label">银行名称</p>
      <p class="value">{{ detail.baz838 }}</p>
    </div>
    <div class="item">
      <p class="label">银行卡号</p>
      <p class="value">{{ detail.aae010 }}</p>
    </div>
    <div class="item">
      <p class="label">卡状态</p>
      <p class="value">{{ detail.aaz502 }}</p>
    </div>
    <div class="item">
      <p class="label">发卡日期</p>
      <p class="value">{{ detail.ext004 }}</p>
    </div>
  </div>
</template>

<script>
import { social } from "@/api/insurance";
export default {
  data() {
    return {
      idCard: null,
      detail: {},
      extra: {},
    };
  },
  methods: {
    init() {
      this.$toast.loading({
        duration: 0, // 持续展示 toast
        forbidClick: true,
        message: "加载中...",
      });
      Promise.all([
        social({ aae135: this.idCard, busCode: "WS-S0001", encryptIdCard: this.idCard }),
        social({ aae135: this.idCard, busCode: "WS-A0001", encryptIdCard: this.idCard }),
      ]).then((res) => {
        this.$toast.clear();
        this.detail = res[0].data.tradeMsg.data;
        this.extra = res[1].data.tradeMsg.data;
      });
    },
  },
  created() {
    let res = sessionStorage.getItem("ZJCD-UserInfo");
    this.idCard = JSON.parse(res).idCardNo;
    if (this.idCard) this.init();
  },
};
</script>

<style lang="stylus" scoped>
.main {
  height 100vh
  overflow-y auto;
  background #fff

  .item {
    padding 39px 30px
    display flex;
    align-items center;
    justify-content space-between
    border-bottom 1px solid #eee

    .label {
      font-size: 32px;
      color: #333333;
    }
    .value {
      width calc(100vw - 300px)
      text-align right
      line-height 50px
      font-size: 32px;
      color: #333333;
    }
  }
}
</style>
