repay-plan.vue 7.51 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12
<template>
  <h-view id="repay-plan" class="public-style">
    <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>

    <h-content class="plan-content">
      <div class="header">还款计划</div>
      <div class="plan-list">
linxin's avatar
linxin committed
13
        <div v-for="(item,index) in lists" :key="index" class="plan-item">
14
          <div class="left">
linxin's avatar
linxin committed
15 16
            <p>{{ selectYear(item.repayment_date) }}</p>
            <span>{{ selectMonth(item.repayment_date) }}</span>
17 18 19 20
          </div>
          <div :class="{right:true,white:show!=='done'}">
            <div :class="{number:true,blue:show==='undone',orange:show==='doing'}">{{ index + 1 }}</div>
            <div class="top">
linxin's avatar
linxin committed
21 22
              <div><p>现金流项目</p><span :class="{black:show!=='done'}">{{ item.cf_item_name }}</span></div>
              <div><p>支付方式</p><span>{{ item.pay_method }}</span></div>
23
            </div>
linxin's avatar
linxin committed
24 25
            <div class="center"><p>应还金额</p><p :class="{bold:show==='undone'}">{{ item.due_amount|currency }}</p></div>
            <div class="center"><p>已还金额</p><p :class="{yellow:show==='doing'}">{{ item.received_amount|currency }}</p></div>
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
          </div>
        </div>
      </div>
    </h-content>
  </h-view>
</template>

<script>

export default {
  components: {
  },
  data () {
    return {
      // 状态 {已还全部 done}  {还一部分 doning} {没还 undone}
      show: 'doing',
linxin's avatar
linxin committed
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
      lists: [
        {
          'due_amount': '48800',
          'cf_item': '2',
          'cf_item_name': '首付款',
          'received_amount': '0',
          'pay_method': '自主还款',
          'repayment_date': '2019/10/17',
        },
        {
          'due_amount': '4000',
          'cf_item': '3',
          'cf_item_name': '手续费',
          'received_amount': '400',
          'pay_method': '代扣',
linxin's avatar
linxin committed
57
          'repayment_date': '2020/10/12',
linxin's avatar
linxin committed
58 59 60 61 62 63 64
        },
        {
          'due_amount': '400',
          'cf_item': '14',
          'cf_item_name': 'gps费用',
          'received_amount': '200',
          'pay_method': '自主还款',
linxin's avatar
linxin committed
65
          'repayment_date': '2021/10/19',
linxin's avatar
linxin committed
66 67
        },
      ],
68 69
    }
  },
linxin's avatar
linxin committed
70

71 72
  computed: {},
  watch: {},
linxin's avatar
linxin committed
73 74
  beforeRouteEnter (to, from, next) {
    next(vm => {
linxin's avatar
linxin committed
75
      vm.getRefund()
linxin's avatar
linxin committed
76 77
    })
  },
78
  methods: {
linxin's avatar
linxin committed
79 80 81 82 83 84 85
    selectMonth (e) {
      let arr = e.split('/')
      return `${arr[1]}-${arr[2]}`
    },
    selectYear (e) {
      return e.substring(0, 4)
    },
linxin's avatar
linxin committed
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101
    getRefund () {
      let vm = this
      let url = process.env.basePath + 'con_equip_repayment_plan'
      let param = {
        contract_id: this.$route.params.contract_id,
      }
      hlsPopup.showLoading('请稍候')
      vm.$post(url, param).then(function (res) {
        vm.hlsPopup.hideLoading()
        if (res.result === 'S') {
          vm.lists = res.lists
        } else {
          hlsPopup.showLongCenter(res.message)
        }
      })
    },
102 103 104 105 106 107
  },
}
</script>
<style lang='less' >
#repay-plan {
  .h-header {
linxin's avatar
linxin committed
108
    background-color: @headerColor;
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147
    .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;
      }
    }
  }

  .plan-content {
    background-color: #EFEFEF;
    padding-bottom: 10px;
    .header {
      position: relative;
      height: 40px;
      line-height: 40px;
      background-color: #fff;
      font-family: PingFangSC-Semibold;
      font-size: 14px;
      color: #21254C;
      font-weight: 700;
      text-indent: 1.5em;
      border-bottom: 1px solid #F1F0F5;

      &:before {
        content: "";
        position: absolute;
        top: 12px;
        left: 0;
        width: 4px;
        height: 16px;
linxin's avatar
linxin committed
148
        background: @headerColor;
149 150 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 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320
      }

      &:after {
        position: absolute;
        bottom: 0px;
        left: 40px;
        content: "";
        width: 0;
        height: 0;
        border-width: 6px;
        border-style: solid;
        border-color:transparent transparent #EFEFEF transparent;
      }
    }

    .plan-list {
      .plan-item {
        display: flex;
        height: 120px;
        margin-top: 8px;
        padding-left: 8px;

        .left {
          position: relative;
          flex: 13;

          p {
            font-family: DIN-Regular;
            font-size: 12px;
            color: rgba(56,63,69,0.60);
            margin-bottom: 5px;
          }

          span {
            font-family: DIN-Bold;
            font-size: 14px;
            color: #21254C;
            font-weight: 700;
          }

          &:before {
            content: '';
            position: absolute;
            left: 20px;
            top: 36px;
            height: 82px;
            width: 5px;
            border-left: 2px dotted #21254C;
            opacity: 0.3;
          }
        }

        &:last-child {
          .left {
            &:before {
              content:'';
              border-left: 2px dotted transparent;
            }
          }
        }

        .right {
          padding-left: 28px;
          position: relative;
          flex:77;
          background-color: #f8f8f8;
          border-radius: 4px 0 0 4px;
          line-height: 40px;

          .number {
            position: absolute;
            left: 0px;
            width: 20px;
            height: 20px;
            line-height: 20px;
            text-align: center;
            background: rgba(75, 74, 75, .6);
            border-radius: 4px 0 4px 0;
            color: white;
          }

          .blue {
            background: #00469C;
          }

          .orange {
            background: #FDB62F;
          }

          .top {
            height: 40px;
            border-bottom: 1px solid #F1F0F5;
            display: flex;

            div {
              flex: 3;
              display: flex;
              padding-right: 15px;

              p {
                flex: 1;
                opacity: 0.6;
                font-family: PingFangSC-Regular;
                font-size: 13px;
                color: #4B4A4B;
              }

              span {
                flex:1;
                opacity: 0.8;
                font-family: PingFangSC-Medium;
                font-size: 13px;
                color: #4B4A4B;
                text-align: right;
              }

              span.black {
                  opacity: 1;
              }

              &:first-child {
                flex:4;
                span {
                  text-align: left;
                  text-indent: .5em;
                }
              }
            }
          }

          .center {
            border-bottom: 1px solid #F1F0F5;
            display: flex;
            padding-right: 15px;

            p {
              flex: 1;
              opacity: 0.6;
              font-family: Verdana;
              font-size: 13px;
              color: #4B4A4B;

              &:last-child {
                text-align: right;
              }
            }

            p.yellow {
              color: #FDB62F;
              font-style:italic;
              font-family: Verdana-BoldItalic;
              font-weight: 700;
              opacity: 1;
            }

            p.bold {
              font-family: Verdana-BoldItalic;
              font-weight: 700;
              opacity: 1;
            }
          }
        }

        .white {
          background: #fff;
        }
      }
    }
  }

}
</style>