liangjin
2021-03-25 22da82a196247f959f527c753ee8cb6d3236621a
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
<!--
 * @Date: 2019-08-30 11:29:46
 * @LastEditors: 小明丶
 * @LastEditTime: 2019-10-28 15:10:38
 * @Description: 
 -->
<template>
    <div class="getQRCode">
        <x-header title="扫码办理" :left-options="{backText:''}" style="background-color:#3A3A3A;"></x-header>
        <div class="black-block"></div>
        <div class="order-info">
            <div class="cell-item-style">
                <span class="title">还款总额</span>
                <span class="value">{{params.insAmt}}元</span>
            </div>
            <div class="cell-item-style">
                <span class="title">分期期数</span>
                <span class="value">{{params.insTerm}}期</span>
            </div>
            <img class="qrcodeImg" :src="qrCode" alt="qrcode">
            <p class="notice">扫一扫,办理分期业务</p>
        </div>
    </div>
</template>
<script>
    import QRCode from 'qrcode';
    import {mapGetters} from 'vuex';
    export default {
        name: 'getQRCode',
        data() {
            return {
                qrCode: '',
                params: {
                    insAmt: 0,
                    insTerm: 0,
                },
            }
        },
        computed:{
            ...mapGetters(['orgType'])
        },
        created() {
            this.params = { ...this.$route.query };
            let url = `${sessionStorage.getItem('jumpUrl')}/#/?insTerm=${this.params.insTerm}&prodName=${this.params.prodName}&prodId=${this.params.prodId}&storeId=${this.orgType}&settAmt=${this.params.settAmt}&insAmt=${this.params.insAmt}&mgrId=${this.params.mgrId}`;
            QRCode.toDataURL(
                url,
                {
                    margin: 1,
                    width: 400
                },
                (err, url) => {
                    if (err) console.error(err);
                    this.qrCode = url;
                }
            );
        }
    }
</script>
<style lang="less" scoped>
.getQRCode {
    padding-top: 44px;
    position: relative;
    .vux-header {
        &:after {
            border-bottom: none !important;
        }
    }
    .vux-header-title {
        span {
            color: #ffffff;
        }
    }
    .left-arrow {
        &:before {
            border-color: #ffffff !important;
        }
    }
    .black-block {
        margin-top: -11px;
        width: 100%;
        height: 116px;
        background-color: #3a3a3a;
    }
    .order-info {
        height: 480px;
        width: 351px;
        text-align: center;
        box-sizing: border-box;
        background-color: #ffffff;
        padding-top: 50px;
        position: absolute;
        top: 85px;
        left: 50%;
        transform: translateX(-50%);
        .cell-item-style {
            box-sizing: border-box;
            padding-bottom: 10px;
            margin: 0 35px;
            margin-bottom: 40px;
            border-bottom: 1px solid #dddddd;
            .flexLayout(space-between, center, row);
            .title {
                color: #a3a3a3;
                font-size: 14px;
            }
            .value {
                color: #3a3a3a;
                font-size: 14px;
            }
        }
        .last-cell {
            margin-bottom: 25px !important;
        }
        .qrcodeImg {
            width: 190px;
            height: 190px;
        }
        .notice {
            color: #3a3a3a;
            font-size: 12px;
        }
    }
}
</style>