fuliqi
2024-01-24 29c1e7eb5ac16e90d8991a86c1c071bc312ec8d9
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
<template>
  <div class="i-painter2">
    <img :src="imgUrl+'?x-oss-process=image/resize,w_750/format,jpg/quality,q_90/interlace,1'"
         class="img-style" />
    <div class="title">
      <p class="desc-line1">天地精华 民族精神 世界精彩</p>
      <p class="desc-line2">五粮液APP邀请您共品佳酿!</p>
    </div>
    <div class="text">邀请码:{{ code}}</div>
    <div class="erm">
      <img class="code" :src="ewmUrl" alt="" />
    </div>
    <div class="memo">微信长按二维码下载“五粮液新零售”APP</div>
  </div>
</template>
<script>
import QRCode from 'qrcode'
var baseUrl = process.env.VUE_APP_H5_URL
export default {
  name: 'lPainter2',
  props: {
    yqmCode: {
      type: String,
      default: ''
    }
  },
  data() {
    return {
      ewmUrl: '',
      code: 'xxx', // 邀请码
      imgUrl: require('../../../assets/images/share/save_bg2.png')
    }
  },
  watch: {
    yqmCode(newVal, oldVal) {
      this.code = newVal;
    }
  },
  mounted() {
    const _query = this.$route.query;
    if (_query && _query.code) {
      this.code = _query.code;
    }
    this.getQRCode()
  },
  methods: {
    getQRCode() {
      const _url = `${baseUrl}/invite`
      QRCode.toDataURL(_url)
        .then((url) => {
          this.ewmUrl = url
        })
        .catch((err) => {
          console.error(err)
        })
    }
  }
}
</script>
<style lang="less" scoped>
.i-painter2 {
  width: 750px;
  height: 1334px;
  position: relative;
  .img-style {
    width: 750px;
    height: 1334px;
    position: absolute;
    top: 0;
    left: 0;
  }
  .title {
    width: 100%;
    position: absolute;
    top: 145px;
    text-align: center;
  }
  .desc-line1 {
    font-size: 46px;
  }
  .desc-line2 {
    font-size: 28px;
    margin-top: 17px;
  }
  .desc-line1,
  .desc-line2 {
    font-weight: 400;
    color: #f1e6cd;
    font-family: "Times New Roman", Times, serif;
  }
  .text {
    font-size: 26px;
    text-align: center;
    width: 272px;
    line-height: 54px;
    background: #fff;
    color: #db41cc;
    border-radius: 4px;
    position: absolute;
    left: 20px;
    bottom: 60px;
  }
  .erm {
    width: 150px;
    height: 150px;
    position: absolute;
    right: 80px;
    bottom: 120px;
    .code {
      width: 100%;
      height: 100%;
    }
  }
  .memo {
    position: absolute;
    right: 40px;
    bottom: 40px;
    width: 265px;
    font-size: 24px;
    color: #f1e6cd;
  }
}
</style>