trial-repay-plan.vue 10.9 KB
Newer Older
786817560's avatar
786817560 committed
1 2
<!--
 * @Author: your name
786817560's avatar
786817560 committed
3
 * @Date: 2019-10-30 19:29:24
786817560's avatar
786817560 committed
4
 * @LastEditTime : 2019-12-26 16:47:07
786817560's avatar
786817560 committed
5
 * @LastEditors  : Please set LastEditors
786817560's avatar
786817560 committed
6 7 8
 * @Description: In User Settings Edit
 -->
<template>
786817560's avatar
786817560 committed
9
  <h-view id="repay-plan-trial" class="public-style">
786817560's avatar
786817560 committed
10 11 12 13 14 15
    <h-header :proportion="[5,1,1]" class="bar-custom">
      <div slot="left" class="h-header-btn">
        <img src="@/assets/userBind/arrow.png" @click="$routeGo()">
        <span>融资明细</span>
      </div>
    </h-header>
786817560's avatar
786817560 committed
16 17 18 19 20
    <div class="center">

      <div class="total">
        <div class="sum">
          <div>融资额</div>
786817560's avatar
786817560 committed
21
          <p>{{ info.finance_amount | currency }}</p>
786817560's avatar
786817560 committed
22 23
          <img src="@/assets/contractInquire/num.png" alt="">
          <h3><span>{{ info.lease_times }}</span></h3>
786817560's avatar
786817560 committed
24
        </div>
786817560's avatar
786817560 committed
25 26
        <div class="single">
          <div><h4>保证金</h4><p>{{ info.deposit | currency }}</p></div>
786817560's avatar
786817560 committed
27 28
          <div><h4>首付款</h4><p>{{ info.down_payment | currency }}</p></div>
          <div><h4>手续费</h4><p>{{ info.lease_charge | currency }}</p></div>
786817560's avatar
786817560 committed
29 30
        </div>
      </div>
786817560's avatar
786817560 committed
31 32 33
      <div class="plan-name">
        <div class="header">还款计划</div>
        <img :class="{'rotate':show}" src="@/assets/contractInquire/top.png" alt="" @click="showDetails">
786817560's avatar
786817560 committed
34
      </div>
786817560's avatar
786817560 committed
35 36 37
    </div>
    <h-content id="content" class="plan-content">
      <!-- 已结清 black , 逾期 orange , 还款中 blue , 未还款 green -->
786817560's avatar
786817560 committed
38
      <div v-for="(item,index) in repayLists" :key="index" :class="{'plan-list':true,'or':statu==='orange','bl':statu==='blue','gr':statu==='green'}">
786817560's avatar
786817560 committed
39 40 41 42 43 44
        <div :class="{'period':true,'orange':statu==='orange','blue':statu==='blue','green':statu==='green'}">{{ index + 1 }}</div>
        <img v-if="statu === 'black'" src="@/assets/contractInquire/black.png" alt="" class="left">
        <img v-if="statu === 'orange'" src="@/assets/contractInquire/orange.png" alt="" class="left">
        <img v-if="statu === 'blue'" src="@/assets/contractInquire/blue.png" alt="" class="left">
        <img v-if="statu === 'green'" src="@/assets/contractInquire/green.png" alt="" class="left">
        <div class="time">
786817560's avatar
786817560 committed
45
          <p>{{ item.due_date.substr(0,4) }}</p>
786817560's avatar
786817560 committed
46
          <span>{{ dateConverse(item.due_date).substr(5,10) }}</span>
786817560's avatar
786817560 committed
47
        </div>
786817560's avatar
786817560 committed
48
        <div class="number">
786817560's avatar
786817560 committed
49 50 51 52 53 54 55 56 57 58 59 60
          <div>
            <span>本金</span>
            <span>{{ item.principal |currency }}</span>
          </div>
          <div>
            <span>租金</span>
            <span :class="{'orang':statu==='orange','blu':statu==='blue','gree':statu==='green'}">{{ item.rental |currency }}</span>
          </div>
        </div>
        <div class="name">
          <span>利息</span>
          <span>{{ item.interest | currency }}</span>
786817560's avatar
786817560 committed
61
        </div>
786817560's avatar
786817560 committed
62 63
        <img v-if="statu === 'black'" src="@/assets/contractInquire/done.png" alt="" class="status">
        <img v-if="statu === 'orange'" src="@/assets/contractInquire/prompt.png" alt="" class="status">
786817560's avatar
786817560 committed
64 65
      </div>
    </h-content>
786817560's avatar
786817560 committed
66

786817560's avatar
786817560 committed
67 68 69 70
  </h-view>
</template>

<script>
786817560's avatar
786817560 committed
71

786817560's avatar
786817560 committed
72
export default {
786817560's avatar
786817560 committed
73 74 75
  name: 'RepayPlan',
  components: {
  },
786817560's avatar
786817560 committed
76 77
  data () {
    return {
786817560's avatar
786817560 committed
78
      //  已结清 black , 逾期 orange , 还款中 blue , 未还款 green
786817560's avatar
786817560 committed
79
      statu: 'orange',
786817560's avatar
786817560 committed
80
      info: {},
786817560's avatar
786817560 committed
81 82 83 84
      show: false,
      height: 0,
      oldHeight: 0,
      newHeight: 0,
786817560's avatar
786817560 committed
85
      repayLists: [], // 每期还款
786817560's avatar
786817560 committed
86 87 88 89 90 91 92 93 94 95 96 97 98
    }
  },
  computed: {},
  watch: {},
  beforeRouteEnter (to, from, next) {
    next(vm => {
      if (from.name === 'FinancingDetails') {
        vm.repayQuery()
      }
    })
    next()
  },
  methods: {
786817560's avatar
786817560 committed
99 100 101
    dateConverse (date) {
      return date.replace(/\//g, '-')
    },
786817560's avatar
786817560 committed
102
    // 根据还款期排序
786817560's avatar
786817560 committed
103 104 105 106 107 108 109
    arrSort (property) {
      return function (a, b) {
        var value1 = a[property]
        var value2 = b[property]
        return value1 - value2
      }
    },
786817560's avatar
786817560 committed
110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132
    showDetails () {
      if (!this.flag) {
        this.flag = true
        this.height = document.getElementsByClassName('total')[0].clientHeight
        this.oldHeight = document.getElementById('content').clientHeight
        this.newHeight = this.height + this.oldHeight
      }
      if (!this.show) {
        this.show = !this.show
        document.getElementById('content').style.height = this.newHeight + 'px'
        document.getElementsByClassName('center')[0].style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementsByClassName('center')[0].style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
        document.getElementById('content').style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementById('content').style.transform = 'translate(0px, -' + this.height + 'px) scale(1) translateZ(0px)'
      } else {
        this.show = !this.show
        document.getElementById('content').style.height = this.oldHeight + 'px'
        document.getElementsByClassName('center')[0].style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementsByClassName('center')[0].style.transform = 'translate(0px, -' + 0 + 'px) scale(1) translateZ(0px)'
        document.getElementById('content').style.transition = 'all .3s cubic-bezier(0.165, 0.84, 0.44, 1) 0s'
        document.getElementById('content').style.transform = 'translate(0px, -' + 0 + 'px) scale(1) translateZ(0px)'
      }
    },
786817560's avatar
786817560 committed
133
    // 还款计划查询
786817560's avatar
786817560 committed
134 135 136 137 138 139 140 141 142 143 144
    repayQuery () {
      let vm = this
      let url = $config.basePath + 'prd_repayment_plan'
      let param = {
        quotation_id: vm.$route.params.quotation_id,
      }
      vm.hlsPopup.showLoading('数据加载中')
      vm.hlsHttp.post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.info = res.info
786817560's avatar
786817560 committed
145
          vm.repayLists = res.lists.sort(vm.arrSort('times')) // 根据还款期排序
786817560's avatar
786817560 committed
146 147 148 149 150 151
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
  },
786817560's avatar
786817560 committed
152

786817560's avatar
786817560 committed
153 154
}
</script>
786817560's avatar
786817560 committed
155 156
<style lang='less'>
#repay-plan-trial {
786817560's avatar
786817560 committed
157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220
  .h-header {
    background-color: #1D3FFF;
    .h-header-btn {
      img {
        width: 16px;
        height: 16px;
        margin-left: 4px;
      }

      span {
        font-family: PingFangSC-Semibold;
        margin-left: 16px;
        font-size: 17px;
        letter-spacing: 0.61px;
        line-height: 24px;
      }
    }
  }

  .total {
    position: relative;
    background-color: #1D3FFF;
    height: 138px;
    color: #fff;
    background-image: url(../../assets/contractInquire/background.png);
    background-size: cover;

    .sum {
    padding: 0 20px;
      div {
        font-family: PingFangSC-Semibold;
        font-size: 14px;
        padding-top: 12px;
        padding-bottom: 10px;
      }

      p {
        font-family: Verdana-BoldItalic;
        font-size: 20px;
        font-weight: 700;
        font-style: italic;
        margin-left: -4px;
      }

      img {
        width: 75px;
        position: absolute;
        right: 20px;
        top: 25px;
      }

      h3 {
        position: absolute;
        font-weight: 700;
        margin: 0;
        right: 42px;
        top: 32px;
        color: #1D3FFF;
        font-family: PingFangSC-Semibold;
        font-size: 14px;

        span {
          font-style: italic;
          margin-right: 5px;
786817560's avatar
786817560 committed
221
        }
786817560's avatar
786817560 committed
222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239
      }
    }

    .single {
      display: flex;
      margin-top: 28px;

      div {
        flex: auto;
        text-align: center;

        h4 {
          opacity: 0.8;
          margin: 0;
          font-family: PingFangSC-Regular;
          font-size: 12px;
          color: #FFFFFF;
          margin-bottom: 8px;
786817560's avatar
786817560 committed
240
        }
786817560's avatar
786817560 committed
241 242 243 244 245 246

        p {
          font-family: Verdana;
          font-size: 14px;
          color: #FFFFFF;
          font-weight: 700;
786817560's avatar
786817560 committed
247
        }
786817560's avatar
786817560 committed
248
      }
786817560's avatar
786817560 committed
249 250
    }

786817560's avatar
786817560 committed
251 252 253 254 255 256 257 258 259 260 261 262 263
  }

  .plan-name {
    position: relative;
    background-color: #1D3FFF;
    margin-top: -2px;

    img {
      position: absolute;
      right: 30px;
      top: 12px;
      height: 20px;
      transition: 0s;
786817560's avatar
786817560 committed
264
    }
786817560's avatar
786817560 committed
265 266 267

    .rotate {
      transform: rotate(180deg);
786817560's avatar
786817560 committed
268
    }
786817560's avatar
786817560 committed
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287

    .header {
      position: relative;
      height: 48px;
      line-height: 48px;
      background-color: #fff;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #21254C;
      font-weight: 700;
      text-indent: 2em;
      border-radius: 24px 0 0 0 ;

      &:before {
        content: "";
        position: absolute;
        top: 16px;
        left: 15px;
        width: 4px;
786817560's avatar
786817560 committed
288
        height: 16px;
786817560's avatar
786817560 committed
289 290
        background: #1D3FFF;
      }
786817560's avatar
786817560 committed
291
    }
786817560's avatar
786817560 committed
292 293 294 295 296 297 298 299 300 301
  }

  .plan-content {
    background-color: #fff;
    padding: 0px 11px;

    .plan-list {
      position:relative;
      background-color: #f7f7f7;
      height: 78px;
786817560's avatar
786817560 committed
302
      display: flex;
786817560's avatar
786817560 committed
303 304
      padding-right: 20px;
      padding-left: 10px;
786817560's avatar
786817560 committed
305
      padding-top: 20px;
786817560's avatar
786817560 committed
306 307 308 309 310 311 312
      margin-bottom: 10px;

      .left {
        height: 30px;
        position: absolute;
        left: -8px;
        top: 24px;
786817560's avatar
786817560 committed
313
      }
786817560's avatar
786817560 committed
314 315 316 317 318 319 320 321 322 323 324 325 326 327

      .status {
        position: absolute;
        width:18px;
        right: -3px;
        top: -5px;
      }

      .period {
        position: absolute;
        top: 0;
        left: 0;
        background: rgba(75,74,75,.5);
        border-radius: 4px 0 4px 0;
786817560's avatar
786817560 committed
328 329 330
        // width: 30px;
        padding: 1px 2px;
        height: 20px;
786817560's avatar
786817560 committed
331 332 333 334
        color: #fff;
        font-family: PingFangSC-Semibold;
        font-size: 12px;
        letter-spacing: 1.09px;
786817560's avatar
786817560 committed
335
        line-height: 20px;
786817560's avatar
786817560 committed
336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351
        text-align: center;
      }

      .orange {
        background: rgba(253, 182, 47,.5);
      }

      .blue {
        background-color: rgba(29, 63, 255,.5);
      }

      .green {
        background-color: rgba(27, 162, 97,.5);
      }

      .time {
786817560's avatar
786817560 committed
352
        // flex: 5;
786817560's avatar
786817560 committed
353 354 355 356 357 358

        p {
          font-family: DIN-Regular;
          font-size: 12px;
          color: rgba(56,63,69,0.60);
          margin-bottom: 4px;
786817560's avatar
786817560 committed
359
          margin-top: 8px;
786817560's avatar
786817560 committed
360
        }
786817560's avatar
786817560 committed
361 362 363 364 365 366

        span {
          font-family: DIN-Bold;
          font-weight: 700;
          font-size: 14px;
          color: #21254C;
786817560's avatar
786817560 committed
367
        }
786817560's avatar
786817560 committed
368 369 370
      }

      .name {
786817560's avatar
786817560 committed
371
        // flex: 9;
786817560's avatar
786817560 committed
372 373 374
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: #4B4A4B;
786817560's avatar
786817560 committed
375
        //padding-top: 20px;
786817560's avatar
786817560 committed
376 377 378 379 380 381
        margin-left: 22px;
        span:nth-of-type(2) {
          margin-left: 8px;
        }
        span:nth-of-type(1) {
          opacity: 0.6;
786817560's avatar
786817560 committed
382
        }
786817560's avatar
786817560 committed
383 384 385
      }

      .number {
786817560's avatar
786817560 committed
386
        // flex: 9;
786817560's avatar
786817560 committed
387 388
        display: flex;
        flex-direction: column;
786817560's avatar
786817560 committed
389 390 391
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: #4B4A4B;
786817560's avatar
786817560 committed
392 393 394 395
        margin-left: 20px;
        div:nth-of-type(2) {
          margin-top: 12px;
        }
786817560's avatar
786817560 committed
396 397
        span:nth-of-type(2) {
          margin-left: 8px;
786817560's avatar
786817560 committed
398 399 400 401 402 403 404 405 406 407 408 409 410 411 412
        }
        span.orang {
          color: rgb(253, 182, 47);
          font-weight: 700;
          font-family: PingFangSC-Semibold;
        }
        span.blu {
          color: #1D3FFF;
          font-weight: 700;
          font-family: PingFangSC-Semibold;
        }
        span.gree {
          color: #1BA261;
        }
      }
786817560's avatar
786817560 committed
413
    }
786817560's avatar
786817560 committed
414 415 416

    .or {
        background-color:rgba(253, 182, 47,.05);
786817560's avatar
786817560 committed
417
    }
786817560's avatar
786817560 committed
418 419 420 421 422 423 424

    .bl,.gr {
      background: #FFFFFF;
      box-shadow: 0 1px 5px 0 rgba(219,219,219,0.69);
    }

  }
786817560's avatar
786817560 committed
425 426 427

}
</style>