<template>
  <div class="container">
    <div class="pay-back-title">
      <p class="text">剩余待还(元)</p>
      <p class="num">{{ amount }}</p>
    </div>
    <p class="contain">
      包含以下部分
    </p>
    <div class="content">
      <div class="item">
        <span class="title">本金</span>
        <span class="text"> {{ perTermAmount }}元 </span>
      </div>
      <div class="item" @click="handleServiceCharge">
        <span class="title">综合服务费</span>
        <span class="text">
          {{ perTermFee }}
          <i class="iconfont icon-arrow" />
        </span>
      </div>
      <div v-if="overdueFee != '0.00'" class="item" @click="handleServiceCharge">
        <span class="title">逾期</span>
        <span class="text">
          {{ overdueFee }}
        </span>
      </div>
    </div>
    <cr-popup v-model="isPop" class="pop" round closeable position="bottom">
      <h2 class="pop-title">综合服务费详情</h2>
      <div class="pop-item">
        <span class="title">总计</span>
        <span class="text">{{ perTermFee }}元</span>
      </div>
      <div class="pop-content">
        <p class="title">
          费用说明
        </p>
        <p class="text">
          综合服务费：包括依据用户与资金提供方以及相关担保方、保险方的约定，按期向资金提供方缴纳的利息、分期服务费等，以及向担保方缴纳的担保费、保险费等在内的全部资金成本。除还款本金以及该金额外用户无需就贷款事项支付其他任何费用。
        </p>
      </div>
    </cr-popup>
  </div>
</template>
<script>
export default {
  components: {},
  data() {
    return {
      isPop: false,
      overdueFee: '',
      overdueFeeDesc: '',
      perTermAmount: '',
      perTermFee: '',
      perTermFeeDesc: '',
      amount: ''
    };
  },
  computed: {},
  mounted() {
    const {
      overdueFee,
      overdueFeeDesc,
      perTermAmount,
      perTermFee,
      perTermFeeDesc,
      amount
    } = this.$route.params;
    this.overdueFee = overdueFee;
    this.overdueFeeDesc = overdueFeeDesc;
    this.perTermAmount = perTermAmount;
    this.perTermFee = perTermFee;
    this.perTermFeeDesc = perTermFeeDesc;
    this.amount = amount;
  },
  methods: {
    handleServiceCharge() {
      this.isPop = true;
    }
  }
};
</script>
<style lang="less" scoped>
.pop {
  padding-bottom: 80px;
  .pop-title {
    font-size: 12px;
    color: #333333;
    text-align: center;
    height: 40px;
    line-height: 40px;
    border-bottom: 1px solid #f0f2f5;
  }
  .pop-item {
    margin-left: 20px;
    display: flex;
    border-bottom: 1px solid #f0f2f5;
    justify-content: space-between;
    height: 48px;
    line-height: 48px;
    padding-right: 20px;
    span {
      display: block;
      font-size: 14px;
      color: #999999;
    }
    .text {
      color: #333333;
    }
  }
  .pop-content {
    margin-top: 20px;
    font-size: 14px;
    padding-left: 20px;
    box-sizing: border-box;
    color: #333333;
    padding-right: 10px;
    .title {
      margin-bottom: 14px;
    }
    .text {
      font-size: 13px;
      line-height: 1.2;
    }
  }
}
.pay-back-title {
  padding-top: 30px;
  text-align: center;
  padding-bottom: 51px;
  .text {
    font-size: 12px;
    color: #333333;
    margin-bottom: 10px;
  }
  .num {
    font-size: 30px;
    color: #333333;
  }
}
.container {
  min-height: 100%;
  background: #fff;
}
.content {
  padding: 0 20px;
  box-sizing: border-box;
  margin-bottom: 188px;
}
.contain {
  font-size: 14px;
  color: #999999;
  line-height: 40px;
  background: #f8f8f8;
  padding-left: 20px;
}
.item {
  display: flex;
  border-bottom: 1px solid #f0f2f5;
  justify-content: space-between;
  height: 48px;
  line-height: 48px;
  span {
    display: block;
    font-size: 14px;
    color: #999999;
  }
  .text {
    color: #333333;
  }
}
</style>
