<template>
  <h-view class="public-style result" title="试算结果">
    <!--<h-header :has-border="false" class="bar-custom">
      <div slot="left" class="h-header-btn" @click="$routeGo()">
        <i class="ion-ios-arrow-back"/>
      </div>
      <div slot="center">试算结果</div>
    </h-header>-->
    <h-content class=" has-footer">
      <div class="top">
        <div class="top-content">
          <div class="leasing">融资额（元）</div>
          <div class="amount">\{{ calc.result.finance_amount | currency }}</div>
          <div class="bottom-row">
            <div class="installment">
              <div> 月供(元)</div>
              <div>\{{ calc.result.mouth_rental | currency }}</div>
            </div>
            <div class="installment">
              <div>首次支付(元)</div>
              <div>\{{ calc.result.first_amount | currency }}</div>
            </div>
            <div class="installment">
              <div>合同期数</div>
              <div>\{{ calc.result.times_from }}</div>
            </div>
          </div>
        </div>
      </div>
      <list-item>
        <item>
          <div slot="name" class="">首付款（元）</div>
          <div slot="content">\{{ calc.result.down_payment |currency }}</div>
        </item>
        <item>
          <div slot="name" class="">保证金（元）</div>
          <div slot="content">\{{ calc.result.deposit |currency }}</div>
        </item>
        <item>
          <div slot="name" class="">手续费（元）</div>
          <div slot="content">\{{ calc.result.lease_charge |currency }}</div>
        </item>
        <item>
          <div slot="name" class="">尾付款（元）</div>
          <div slot="content">\{{ calc.result.balloon |currency }}</div>
        </item>
      </list-item>
    </h-content>
    <bottom-tab>
      <tab-button class="left-button" @click.native="$routeGo()">重算</tab-button>
      <tab-button class="right-button" @click.native="goDetails">融资明细</tab-button>
    </bottom-tab>
  </h-view>
</template>

<script>
import calService from './calculateService'
export default {
  name: 'ResultMain',
  data () {
    return {
      calc: calService.getCalc(),
    }
  },
  methods: {
    goDetails () {
      this.$router.push({
        name: 'ResultDetails',
      })
    },
  },
}
</script>

<style lang="less">
  .result{
    .content {
      .top {
        width: 100%;
        height: 160px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin: 10px 0;
        background-color: #F7F7F8;

        .top-content {
          width: 92%;
          height: 160px;
          margin: 15px 0;
          background-color: @headerColor;
          border-radius: 5px;

          .bottom-row {
            color: #ffffff;
            margin-top: 15px;
            display: flex;
            justify-content: space-between;

            .installment {
              width: 33%;
              height: 45px;
              margin-left: 15px;
              font-size: 14px;
              line-height: 25px;
              border-right: 1px solid #FFFFFF; /*no*/
              display: flex;
              flex-direction: column;
              &:last-child{
                border-right: none
              }
            }
          }

          .leasing {
            font-size: 15px;
            color: #FFFFFF;
            margin-left: 15px;
            padding-top: 20px;
          }

          .amount {
            font-size: 22px;
            color: #FFFFFF;
            margin-left: 15px;
            padding-top: 15px;
          }
        }
      }
    }

    .h-bottom-tab {
      .left-button{
        background-color: @headerColor;
        color: #fff;
      }
      .right-button{
        background-color: #E55F5F;
        color: #fff;
      }
    }
  }
</style>
