liangjin
2021-04-01 ffcc13c38517386aee4f1b629b0be25a951cd2c2
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
<!--
 * @Author: 小明丶
 * @Date: 2020-06-08 11:13:16
 * @LastEditors: 小明丶
 * @LastEditTime: 2020-06-13 19:15:35
 * @Description: 花呗间联二维码页面
--> 
<template>
  <div class="hbjl-qr-vue">
    <v-navbar title="生成订单"></v-navbar>
    <div class="top-back-box">
      <div class="back-line-box"></div>
      <div class="qr-box">
        <div class="code-box">
          <img :src="qrCode" alt />
        </div>
        <div class="tip-box">
          <p>二维码失效时间为半小时</p>
          <p>请尽快提供给用户完成扫码</p>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import QRCode from 'qrcode';
export default {
  data() {
    return {
      qrCode:'',
      params:{}
    }
  },
  created(){
    //创建二维码
    this.params = { ...this.$route.query };
    let url = JSON.stringify(this.params)
    //let url = `{'insAmt':'${this.params.insAmt}','userAmt':'${this.params.userAmt}','term':'${this.params.term}','inviteCode':'${this.params.inviteCode}','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>
.hbjl-qr-vue {
  & {
    min-height: 100vh;
    background: #efefef;
    position: relative;
  }
  .top-back-box {
    width: 100%;
    height: 117px;
    background: url("../../../../assets/img/bg_top.png");
    background-size: cover;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    // align-items: center;
    .back-line-box {
      width: 335px;
      height: 14px;
      background: rgba(56, 50, 87, 1);
      border-radius: 7px;
      margin-top: 49px;
    }
    .qr-box {
      & {
        width: 300px;
        height: 300px;
        background: rgba(255, 255, 255, 1);
        box-shadow: 0px 12px 15px 0px rgba(63, 58, 80, 0.05);
        border-radius: 0px 0px 5px 5px;
        margin-top: -7px;
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
      }
      .code-box {
        & {
          width: 200px;
          height: 200px;
          background: url("../../../../assets/img/bg_code.png");
          margin-top: 36px;
          box-sizing: border-box;
          padding: 8px;
        }
        img {
          width: 184px;
          height: 184px;
        }
      }
      .tip-box {
        & {
          text-align: center;
          width: 100%;
        }
        p {
          font-size: 12px;
          font-family: PingFang SC;
          font-weight: 500;
          color: rgba(153, 153, 153, 1);
        }
      }
    }
  }
}
</style>