ann0707
2018-08-16 c9bc8ec61cff4076132f6396d99d383a2cdf5a03
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
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
148
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
<template>
    <div class="loan-info-box">
        <x-header slot="header"
                  style="width:100%;height:46px;background-color: #ec6758"
                  title="贷款查询"
                  :left-options="{backText: ''}">
            <router-link to="/bnd/loan/quota" tag="span" class="slotRight_l" slot="right">我的贷款</router-link>
        </x-header>
        <group>
            <tab>
                <tab-item :selected="currTab===0" @on-item-click="repayList">当前账单</tab-item>
                <tab-item :selected="currTab===1" @on-item-click="repayList">历史账单</tab-item>
            </tab>
        </group>
        <div>
            <ul class="list_title">
                <li v-for="i in repayListArr" :key="i.loanId" @click="goBillDetails(i)">
                    <div class="list_header">
                        <h4>【借款账单<span> {{showFormDate(i.creTime)}}</span>】</h4>
                        <span class="list_ritg">{{i.loanStatusValue}}</span>
                    </div>
                    <div class="list_liebiao">
                        <p>账单总额(元)</p>
                        <div class="list_next">
                            <p>¥<span>{{i.loanAmt|formatMoney}}</span></p>
                            <span class="list_porright">详情<i class="iconfont icon-more-up"></i></span>
                        </div>
                    </div>
                    <div class="list_bom">
                        <div>
                            <p>下期应还(元)</p>
                            <span>{{i.nextRepayAmt|formatMoney}}</span>
                        </div>
                        <div>
                            <p>还款期数</p>
                            <span>{{i.nextTerm||i.totalTerm}}/{{i.totalTerm}}期</span>
                        </div>
                        <div>
                            <p>下次还款日</p>
                            <span>{{showFormDate(i.nextRepayDay)||'无'}}</span>
                        </div>
                    </div>
                </li>
                <li v-if="repayListArr.length===0" class="noData">暂无该类型账单</li>
            </ul>
        </div>
    </div>
</template>
 
<script>
    import {XHeader, Group, Tab, TabItem} from 'vux';
    import SystApi from '../../../api/api';
    import statusCodeManage from '../../../api/statusCodeManage';
    import formDate from '../../../tool/date';
    import validate from '../../../tool/validator';
 
    export default {
        name: 'loanDetails',
        components: {XHeader, Group, Tab, TabItem},
        data() {
            return {
                repayListArr: [], // 账单数据列表
                currTab: 0//当前tab选中的下标
            };
        },
        filters: {
            // 金额格式化
            formatMoney(val) {
                return validate.formatMoney(val || 0)
            }
        },
        methods: {
            //格式化日期
            showFormDate(dateTime) {
                return formDate(dateTime, 'YYYY-MM-DD');
            },
            //跳转到账单详情页面
            goBillDetails(i) {
                this.$router.push({
                    path: '/bnd/repayMent/billDetails', query: {loanId: i.loanId,}
                })
            },
            // 查看贷款列表:获取账单列表数据;index:列表类型 1-当前账单,2-历史账单
            repayList(index) {
                this.currTab = index;
                SystApi.repayList({prodId: sessionStorage.prodId, listType: index + 1}).then(res => {
                    this.repayListArr = res.body
                }, err => {
                    statusCodeManage.showTipOfStatusCode(err)
                })
            }
        },
        activated() {
            this.repayList(this.currTab)
        }
    };
</script>
 
<style lang="less">
    @import "../../../style/mixin.less";
 
    .loan-info-box {
        padding-bottom: 1rem;
        background-color: @color-background-default;
        .vux-header {
            .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
            .vux-header-left {
                .left-arrow:before {
                    border: solid 1px @color-white;
                    border-width: 2px 0 0 2px;
                }
            }
        }
 
    }
 
    .slotRight_l {
        color: @color-white;;
        font-size: @font-size-medium;
        position: relative;
        top: -0.1rem;
    }
 
    .vux-tab .vux-tab-item.vux-tab-selected {
        color: @color-gradient-darkBlue-right !important;
        border-bottom: 2px solid @color-gradient-darkBlue-right !important;
    }
 
    .vux-tab .vux-tab-item {
        font-size: @font-size-base !important;
    }
 
    .vux-tab-ink-bar {
        background-color: @color-gradient-darkBlue-right !important;
        height: 1px !important;
    }
 
    .list_title {
        margin: 0 1rem;
        li {
            list-style: none;
            margin-top: 1rem;
        }
        .noData {
            text-align: center;
            font-size: 16px;
        }
        .list_header {
            .color-linear-gradient;
            font-size: @font-size-base;
            color: @color-white;
            position: relative;
            height: 3.5rem;
            line-height: 3.5rem;
            border-top-left-radius: 3px;
            border-top-right-radius: 3px;
            h4 {
                font-weight: normal;
            }
            .list_ritg {
                position: absolute;
                top: 0;
                right: 0.5rem;
            }
 
        }
        .list_liebiao {
            background-color: @color-white;
            padding: 0.8rem;
            font-size: @font-size-small;
            padding-bottom: 0;
            p {
                color: @color-text-third;
            }
            .list_next {
                position: relative;
                border-bottom: 1px dashed @color-divider-regular;
                p {
                    color: @color-gradient-darkBlue-right;
                    font-size: @font-size-large;
                    padding-bottom: 0.5rem;
                }
                .list_porright {
                    display: inline-block;
                    color: @color-text-third;
                    font-size: @font-size-medium;
                    position: absolute;
                    bottom: 1rem;
                    right: 0;
                }
            }
        }
        .list_bom {
            background-color: @color-white;
            overflow: hidden;
            width: 100%;
            > div {
                float: left;
                width: 33.3%;
                text-align: center;
                padding: 0.5rem 0;
            }
            > div p {
                color: @color-text-third;
                font-size: @font-size-small;
            }
            > div span {
                font-size: @font-size-medium;
            }
        }
    }
 
    .iconfont {
        font-size: @font-size-small;
        padding-left: 0.5rem;
    }
</style>