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
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
<template>
    <div class="loan-info-box">
        <x-header slot="header"
                  style="width:100%;height:46px;background-color: #ec6758"
                  title="贷款信息确认"
                  :left-options="{backText: ''}"></x-header>
        <group>
            <div class="info_queren">
                <h4>贷款人信息</h4>
            </div>
            <ul class="list_shuju">
                <li>
                    <span>贷款人</span>
                    <span>{{loanInfo.userName}}</span>
                </li>
                <li>
                    <span>贷款金额</span>
                    <span>{{loanInfo.loanAmt|formatMoney}}</span>
                </li>
                <li>
                    <span>还款期数</span>
                    <span>{{loanInfo.loanTerm}}期</span>
                </li>
                <li>
                    <span>每期还款金额</span>
                    <span>{{loanInfo.repayAmt|formatMoney}}</span>
                </li>
                <li>
                    <span>首次还款日</span>
                    <span>{{showFormDate(loanInfo.firstRepayDay)}}</span>
                </li>
                <li>
                    <span>固定还款日</span>
                    <span>暂定</span>
                </li>
                <li>
                    <span>还款方式</span>
                    <span>{{loanInfo.repayType}}</span>
                </li>
                <li>
                    <span>收还款银行卡</span>
                    <span>{{loanInfo.bankName}} ****{{loanInfo.bankCardNo}}</span>
                </li>
            </ul>
        </group>
 
        <div style="height: 20px"></div>
        <div class="xieyi">
            <input type='checkbox' v-model="isAgree" name='VoteOption1' id="checkbox"/>
            <label for="checkbox">我已阅读并同意<span>《包银协议1》</span>、<span>《包银协议2》</span>、<span>《包银协议3》</span></label>
        </div>
        <box gap="0 15px">
            <x-button :type="isAgree?'primary':''" @click.native="isPay = true" :disabled="!isAgree">下一步</x-button>
        </box>
        <div style="height: 20px"></div>
        <div class="passwrod_jianpan">
            <pay-keyboard
                v-if="isPay"
                :is-pay='isPay'
                @pas-end='pasEnd'
                @close='isPay=false'>
                <!-- 自定义支付动画 -->
                <div slot="loading-ani">
                    <svg></svg>
                </div>
            </pay-keyboard>
        </div>
    </div>
</template>
 
<script>
    import {XHeader, Group, XInput, XButton, Box, md5} from 'vux';
    import validate from '../../../tool/validator';
    import formDate from '../../../tool/date';
    import SysApi from '../../../api/api';
    import statusCodeManage from '../../../api/statusCodeManage';
    //    ---------支付密码----
    import payKeyboard from '../../../components/payKeyboard/PayKeyboard'
 
    export default {
        name: 'quotaInfo',
        components: {XHeader, Group, XInput, XButton, Box, payKeyboard},
        data() {
            return {
                isPay: false,  // 是否显示支付密码输入框
                isAgree: false, // 是否同意
                loanInfo: {}
            };
        },
        filters: {
            // 金额格式化
            formatMoney(val) {
                return validate.formatMoney(val) + '元'
            }
        },
        methods: {
            //格式化日期
            showFormDate(dateTime) {
                return formDate(dateTime, 'YYYY-MM-DD');
            },
            // 输入支付密码回调的方法
            pasEnd(val) {
                this.isPay = false;
                this.loanInfo.pwd = md5(sessionStorage.newPhoneNum + val);
                let parmas = {
                    prodId: sessionStorage.prodId,
                    pwd: this.loanInfo.pwd,
                    loanAmt: this.loanInfo.loanAmt,
                    loanTerm: this.loanInfo.loanTerm,
                    loanUse: this.loanInfo.loanUse,
                    riskInfo: {
                        deviceId: "yhjguyg",
                        IMEI: "IMEI",
                        IDFA: "IDFA",
                        ip: "192.168.10.93",
                        longiTude: "104.108676",
                        latiTude: "30.593814",
                        mac: "daqasdsxzc",
                        wifiMac: "43f1",
                        wifiList: [],
                        phoneModel: "iphone",
                        operationSys: "ios",
                        appNameList: []
                    }
                };
                SysApi.submitLoan(parmas).then(
                    res => {
                        this.$router.push({path: '/bnd/loan/loanMessage'});
                    },
                    err => {
                        statusCodeManage.showTipOfStatusCode(err)
                    }
                )
            }
        },
        activated() {
            this.isPay = false;
            this.loanInfo = JSON.parse(sessionStorage.loanInfo)
        }
    };
</script>
 
<style lang="less">
    @import "../../../style/mixin.less";
 
    .loan-info-box {
        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;
                }
            }
        }
        .weui-cells {
            margin-top: 0;
        }
 
    }
 
    .loan-info-box .weui-btn_primary {
        .color-linear-gradient(@color-primary-light, @color-primary, 90deg);
    }
 
    .loan-info-box .weui-btn_primary:not(.weui-btn_disabled):active {
        color: rgba(255, 255, 255, 0.6);
        background-color: rgb(241, 95, 79);;
    }
 
    .info_queren {
        position: relative;
        height: 3.5rem;
        padding: 0 1rem;
        border-bottom: 1px solid @color-divider-regular;
        h4 {
            font-size: @font-size-primary;
            font-weight: normal;
            line-height: 3.5rem;
 
        }
 
    }
 
    .list_shuju {
        padding: 1rem;
        li {
            padding-bottom: 0.4rem;
        }
        span {
            display: inline-block;
        }
        span:first-child {
            color: @color-text-secondary;
            width: 9rem;
            font-size: @font-size-base;
        }
        span:last-child {
            color: @color-text-third;
            font-size: @font-size-medium;
        }
    }
 
    .xieyi {
        padding: 0 1rem 1.25rem;
        text-align: left;
        input {
            vertical-align: middle;
        }
        span {
            display: inline-block;
            color: @color-primary;
        }
    }
 
    .passwrod_jianpan {
        .title v-1px-b pr {
            span {
                display: inline-block;
                font-size: @font-size-base !important;
            }
            .pa {
                left: 15px !important;
                .icon {
                    width: 1.5rem !important;
                    height: 1.5rem !important;
                }
            }
        }
    }
 
    .weui-btn:after {
        border: none !important;
    }
 
    .weui-btn {
        font-size: @font-size-primary !important;
    }
</style>