trial-repay-plan.vue 10.7 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-11-13 10:34:23
786817560's avatar
786817560 committed
5 6 7 8
 * @LastEditors: Please set LastEditors
 * @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="name">
786817560's avatar
786817560 committed
49 50
          <span>款项</span>
          <span>租金</span>
786817560's avatar
786817560 committed
51 52
        </div>
        <div class="number">
786817560's avatar
786817560 committed
53
          <span>应还金额</span>
786817560's avatar
786817560 committed
54
          <span :class="{'orang':statu==='orange','blu':statu==='blue','gree':statu==='green'}">{{ item.rental |currency }}</span>
786817560's avatar
786817560 committed
55
        </div>
786817560's avatar
786817560 committed
56 57
        <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
58 59
      </div>
    </h-content>
786817560's avatar
786817560 committed
60

786817560's avatar
786817560 committed
61 62 63 64
  </h-view>
</template>

<script>
786817560's avatar
786817560 committed
65

786817560's avatar
786817560 committed
66
export default {
786817560's avatar
786817560 committed
67 68 69
  name: 'RepayPlan',
  components: {
  },
786817560's avatar
786817560 committed
70 71
  data () {
    return {
786817560's avatar
786817560 committed
72
      //  已结清 black , 逾期 orange , 还款中 blue , 未还款 green
786817560's avatar
786817560 committed
73
      statu: 'orange',
786817560's avatar
786817560 committed
74
      info: {},
786817560's avatar
786817560 committed
75 76 77 78
      show: false,
      height: 0,
      oldHeight: 0,
      newHeight: 0,
786817560's avatar
786817560 committed
79
      repayLists: [], // 每期还款
786817560's avatar
786817560 committed
80 81 82 83 84 85 86 87 88 89 90 91 92
    }
  },
  computed: {},
  watch: {},
  beforeRouteEnter (to, from, next) {
    next(vm => {
      if (from.name === 'FinancingDetails') {
        vm.repayQuery()
      }
    })
    next()
  },
  methods: {
786817560's avatar
786817560 committed
93 94 95
    dateConverse (date) {
      return date.replace(/\//g, '-')
    },
786817560's avatar
786817560 committed
96
    // 根据还款期排序
786817560's avatar
786817560 committed
97 98 99 100 101 102 103
    arrSort (property) {
      return function (a, b) {
        var value1 = a[property]
        var value2 = b[property]
        return value1 - value2
      }
    },
786817560's avatar
786817560 committed
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126
    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
127
    // 还款计划查询
786817560's avatar
786817560 committed
128 129 130 131 132 133 134 135 136 137 138
    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
139
          vm.repayLists = res.lists.sort(vm.arrSort('times')) // 根据还款期排序
786817560's avatar
786817560 committed
140 141 142 143 144 145
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
  },
786817560's avatar
786817560 committed
146

786817560's avatar
786817560 committed
147 148
}
</script>
786817560's avatar
786817560 committed
149 150
<style lang='less'>
#repay-plan-trial {
786817560's avatar
786817560 committed
151 152 153 154 155 156 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
  .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
215
        }
786817560's avatar
786817560 committed
216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233
      }
    }

    .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
234
        }
786817560's avatar
786817560 committed
235 236 237 238 239 240

        p {
          font-family: Verdana;
          font-size: 14px;
          color: #FFFFFF;
          font-weight: 700;
786817560's avatar
786817560 committed
241
        }
786817560's avatar
786817560 committed
242
      }
786817560's avatar
786817560 committed
243 244
    }

786817560's avatar
786817560 committed
245 246 247 248 249 250 251 252 253 254 255 256 257
  }

  .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
258
    }
786817560's avatar
786817560 committed
259 260 261

    .rotate {
      transform: rotate(180deg);
786817560's avatar
786817560 committed
262
    }
786817560's avatar
786817560 committed
263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281

    .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
282
        height: 16px;
786817560's avatar
786817560 committed
283 284
        background: #1D3FFF;
      }
786817560's avatar
786817560 committed
285
    }
786817560's avatar
786817560 committed
286 287 288 289 290 291 292 293 294 295
  }

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

    .plan-list {
      position:relative;
      background-color: #f7f7f7;
      height: 78px;
786817560's avatar
786817560 committed
296
      display: flex;
786817560's avatar
786817560 committed
297 298
      padding-right: 20px;
      padding-left: 10px;
786817560's avatar
786817560 committed
299
      padding-top: 20px;
786817560's avatar
786817560 committed
300 301 302 303 304 305 306
      margin-bottom: 10px;

      .left {
        height: 30px;
        position: absolute;
        left: -8px;
        top: 24px;
786817560's avatar
786817560 committed
307
      }
786817560's avatar
786817560 committed
308 309 310 311 312 313 314 315 316 317 318 319 320 321

      .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
322 323 324
        // width: 30px;
        padding: 1px 2px;
        height: 20px;
786817560's avatar
786817560 committed
325 326 327 328
        color: #fff;
        font-family: PingFangSC-Semibold;
        font-size: 12px;
        letter-spacing: 1.09px;
786817560's avatar
786817560 committed
329
        line-height: 20px;
786817560's avatar
786817560 committed
330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345
        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
346
        // flex: 5;
786817560's avatar
786817560 committed
347 348 349 350 351 352

        p {
          font-family: DIN-Regular;
          font-size: 12px;
          color: rgba(56,63,69,0.60);
          margin-bottom: 4px;
786817560's avatar
786817560 committed
353
          margin-top: 8px;
786817560's avatar
786817560 committed
354
        }
786817560's avatar
786817560 committed
355 356 357 358 359 360

        span {
          font-family: DIN-Bold;
          font-weight: 700;
          font-size: 14px;
          color: #21254C;
786817560's avatar
786817560 committed
361
        }
786817560's avatar
786817560 committed
362 363 364
      }

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

      .number {
786817560's avatar
786817560 committed
380
        // flex: 9;
786817560's avatar
786817560 committed
381 382 383
        font-family: PingFangSC-Regular;
        font-size: 13px;
        color: #4B4A4B;
786817560's avatar
786817560 committed
384 385 386 387
        padding-top: 20px;
        margin-left: 40px;
        span:nth-of-type(2) {
          margin-left: 8px;
786817560's avatar
786817560 committed
388 389 390 391 392 393 394 395 396 397 398 399 400 401 402
        }
        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
403
    }
786817560's avatar
786817560 committed
404 405 406

    .or {
        background-color:rgba(253, 182, 47,.05);
786817560's avatar
786817560 committed
407
    }
786817560's avatar
786817560 committed
408 409 410 411 412 413 414

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

  }
786817560's avatar
786817560 committed
415 416 417

}
</style>