|
@@ -1,38 +1,39 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="mainPage">
|
|
2
|
+ <div class="mainPage" id="canvasPage">
|
3
|
3
|
<div class="imgArr" :hidden="true">
|
4
|
4
|
<img
|
5
|
5
|
v-for="item in imgTotal"
|
6
|
6
|
:key="item"
|
7
|
|
- :src="'https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-' + item + '.png'"
|
|
7
|
+ :src="'http://wx.jinchengjiaye.com/h5-2019/static/images/icon-' + item + '.png'"
|
8
|
8
|
@load="imgLoad"
|
9
|
9
|
alt
|
10
|
10
|
>
|
11
|
11
|
</div>
|
12
|
12
|
<div class="subPage" v-if="showPage">
|
13
|
13
|
<img
|
14
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-12.png"
|
|
14
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-12.png"
|
15
|
15
|
style="z-index: 3;"
|
16
|
16
|
class="centerLabel cover"
|
17
|
17
|
alt
|
18
|
18
|
>
|
19
|
19
|
<img
|
20
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-10.png"
|
|
20
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-10.png"
|
21
|
21
|
class="icon10"
|
22
|
22
|
style="position: absolute;left:9vw;top:3.7vh;z-index:100;width: 31.2vw;"
|
|
23
|
+ v-if="imgSrc === null"
|
23
|
24
|
:class="{'active': currentPage !== 0}"
|
24
|
25
|
alt
|
25
|
26
|
>
|
26
|
|
- <div class="page1" :class="{'show': currentPage === 1}">
|
|
27
|
+ <div class="page1" :class="{'show': currentPage === 1 && imgSrc === null}">
|
27
|
28
|
<img
|
28
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-3.png"
|
|
29
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-3.png"
|
29
|
30
|
class="icon3"
|
30
|
31
|
style="position: absolute;left:0;top:0;z-index:2;width: 87.5vw;"
|
31
|
32
|
:class="{'active': currentPage === 1}"
|
32
|
33
|
alt
|
33
|
34
|
>
|
34
|
35
|
<img
|
35
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-4.png"
|
|
36
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-4.png"
|
36
|
37
|
class="icon4"
|
37
|
38
|
style="position: absolute;right:0;bottom:0;z-index:2;width: 77vw;"
|
38
|
39
|
:class="{'active': currentPage === 1}"
|
|
@@ -40,7 +41,7 @@
|
40
|
41
|
>
|
41
|
42
|
<div class="centerLabel" style="z-index: 3">
|
42
|
43
|
<img
|
43
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-11.png"
|
|
44
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-11.png"
|
44
|
45
|
class="icon11"
|
45
|
46
|
style="width: 36.5vw;"
|
46
|
47
|
:class="{'active': currentPage === 1}"
|
|
@@ -51,7 +52,7 @@
|
51
|
52
|
style="overflow: visible;position: relative;-webkit-transform-style: preserve-3d !important;transform-style: preserve-3d !important;"
|
52
|
53
|
>
|
53
|
54
|
<img
|
54
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-2.png"
|
|
55
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-2.png"
|
55
|
56
|
class="icon2"
|
56
|
57
|
style="width:68vw;transform: translateY(.2rem);-webkit-transform: translateY(.2rem);"
|
57
|
58
|
:class="{'active': currentPage === 1}"
|
|
@@ -61,14 +62,14 @@
|
61
|
62
|
<div class="circle circle2 centerLabel" :class="{'active': currentPage === 1}"></div>
|
62
|
63
|
</div>
|
63
|
64
|
<img
|
64
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-13.png"
|
|
65
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-13.png"
|
65
|
66
|
class="icon13"
|
66
|
67
|
style="width:56vw;display:inline-block;margin-top: .4rem;"
|
67
|
68
|
:class="{'active': currentPage === 1}"
|
68
|
69
|
alt
|
69
|
70
|
>
|
70
|
71
|
<img
|
71
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-1.png"
|
|
72
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-1.png"
|
72
|
73
|
class="icon1"
|
73
|
74
|
style="width: 35.7vw;margin-top: .2rem;"
|
74
|
75
|
:class="{'active': currentPage === 1}"
|
|
@@ -77,154 +78,121 @@
|
77
|
78
|
>
|
78
|
79
|
</div>
|
79
|
80
|
</div>
|
80
|
|
- <div class="page2" :class="{'show': currentPage === 2}">
|
|
81
|
+ <div class="page2" :class="{'show': currentPage === 2 && imgSrc === null}">
|
81
|
82
|
<img
|
82
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-7.png"
|
|
83
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-7.png"
|
83
|
84
|
class="icon7"
|
84
|
85
|
style="position: absolute;left:0;top:0;z-index:2;width: 100vw;"
|
85
|
86
|
:class="{'active': currentPage === 2}"
|
86
|
87
|
alt
|
87
|
88
|
>
|
88
|
89
|
<img
|
89
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-6.png"
|
|
90
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-6.png"
|
90
|
91
|
class="icon6"
|
91
|
92
|
style="position: absolute;right:0;bottom:0;z-index:2;width: 100vw;"
|
92
|
93
|
:class="{'active': currentPage === 2}"
|
93
|
94
|
alt
|
94
|
95
|
>
|
95
|
96
|
<img
|
96
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-5.png"
|
|
97
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-5.png"
|
97
|
98
|
class="icon5"
|
98
|
99
|
style="position: absolute;right:9vw;bottom:3.5vh;z-index:11;width: 43.7vw;"
|
99
|
100
|
:class="{'active': currentPage === 2}"
|
100
|
101
|
alt
|
101
|
102
|
>
|
|
103
|
+ <div class="nextStep" v-if="userSelectFlag.length" @click="nextStep">
|
|
104
|
+ <span>下一步</span>
|
|
105
|
+ </div>
|
102
|
106
|
<div class="centerLabel">
|
103
|
107
|
<img
|
104
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-13.png"
|
|
108
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-13.png"
|
105
|
109
|
class="icon13"
|
106
|
110
|
style="width:66vw;display:inline-block;margin-top: .4rem;"
|
107
|
111
|
:class="{'active': currentPage === 2}"
|
108
|
112
|
alt
|
109
|
113
|
>
|
110
|
114
|
<div class="content">
|
111
|
|
- <span class="flagItem flagItem1" :class="{'active': currentPage === 2}">努力的目标</span>
|
112
|
|
- <span class="flagItem flagItem2" :class="{'active': currentPage === 2}">努力的目标</span>
|
113
|
|
- <span class="flagItem flagItem3" :class="{'active': currentPage === 2}">努力的目标</span>
|
114
|
|
- <span class="flagItem flagItem4" :class="{'active': currentPage === 2}">努力的目标</span>
|
115
|
|
- <span class="flagItem flagItem5" :class="{'active': currentPage === 2}">努力的目标</span>
|
116
|
|
- <span class="flagItem flagItem6" :class="{'active': currentPage === 2}">努力的目标</span>
|
117
|
|
- <span class="flagItem flagItem7" :class="{'active': currentPage === 2}">努力的目标</span>
|
118
|
|
- <span class="flagItem flagItem8" :class="{'active': currentPage === 2}">努力的目标</span>
|
119
|
|
- <span class="flagItem flagItem9" :class="{'active': currentPage === 2}">努力的目标</span>
|
120
|
|
- <span class="flagItem flagItem10" :class="{'active': currentPage === 2}">努力的目标</span>
|
|
115
|
+ <span
|
|
116
|
+ v-for="(item, index) in selectFlag"
|
|
117
|
+ :key="index"
|
|
118
|
+ class="flagItem"
|
|
119
|
+ :class="{'active': currentPage === 2, [`flagItem${index+1}`]: true, 'selected': item.select}"
|
|
120
|
+ @click="selectFlagItem(item, index)"
|
|
121
|
+ >{{item.value}}</span>
|
121
|
122
|
</div>
|
122
|
123
|
</div>
|
123
|
124
|
</div>
|
124
|
|
- <div class="page3" :hidden="currentPage !== 3">
|
125
|
|
- <img
|
126
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-8.png"
|
127
|
|
- class="icon8"
|
128
|
|
- style="position: absolute;left:0;bottom:0;z-index:2;width: 100vw;"
|
129
|
|
- alt
|
130
|
|
- >
|
131
|
|
- <img
|
132
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-9.png"
|
133
|
|
- class="icon9"
|
134
|
|
- style="position: absolute;left:0;bottom:0;z-index:3;width: 100vw;"
|
135
|
|
- alt
|
136
|
|
- >
|
137
|
|
- <div class="centerLabel">
|
138
|
|
- <span>亲爱的你,新年好</span>
|
139
|
|
- <span>亲爱的你,新年好</span>
|
140
|
|
- <span>亲爱的你,新年好</span>
|
141
|
|
- <span>亲爱的你,新年好</span>
|
142
|
|
- <span>亲爱的你,新年好</span>
|
143
|
|
- <span>亲爱的你,新年好</span>
|
144
|
|
- <span>亲爱的你,新年好</span>
|
145
|
|
- <span>亲爱的你,新年好</span>
|
146
|
|
- <span>亲爱的你,新年好</span>
|
147
|
|
- <span>亲爱的你,新年好</span>
|
148
|
|
- </div>
|
149
|
|
- </div>
|
150
|
|
- <div class="page4" :hidden="currentPage !== 4">
|
|
125
|
+ <div class="page3" :class="{'show': currentPage === 3 && imgSrc === null}">
|
151
|
126
|
<img
|
152
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-8.png"
|
|
127
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-8.png"
|
153
|
128
|
class="icon8"
|
154
|
129
|
style="position: absolute;left:0;bottom:0;z-index:2;width: 100vw;"
|
155
|
130
|
alt
|
156
|
131
|
>
|
157
|
132
|
<img
|
158
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-9.png"
|
|
133
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-9.png"
|
159
|
134
|
class="icon9"
|
160
|
135
|
style="position: absolute;left:0;bottom:0;z-index:3;width: 100vw;"
|
161
|
136
|
alt
|
162
|
137
|
>
|
163
|
|
- <div class="centerLabel">
|
164
|
|
- <span>亲爱的你,新年好</span>
|
165
|
|
- <span>亲爱的你,新年好</span>
|
166
|
|
- <span>亲爱的你,新年好</span>
|
167
|
|
- <span></span>
|
168
|
|
- <span>亲爱的你,新年好</span>
|
169
|
|
- <span>亲爱的你,新年好</span>
|
170
|
|
- <span>亲爱的你,新年好</span>
|
171
|
|
- <span>亲爱的你,新年好</span>
|
172
|
|
- <span>亲爱的你,新年好</span>
|
173
|
|
- <span>亲爱的你,新年好</span>
|
174
|
|
- </div>
|
175
|
|
- </div>
|
176
|
|
- <div class="page5" :hidden="currentPage !== 5">
|
177
|
|
- <img
|
178
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-8.png"
|
179
|
|
- class="icon8"
|
180
|
|
- style="position: absolute;left:0;bottom:0;z-index:2;width: 100vw;"
|
181
|
|
- alt
|
182
|
|
- >
|
183
|
|
- <img
|
184
|
|
- src="https://jingcheng-h5temp.oss-cn-shanghai.aliyuncs.com/20181229-images/icon-9.png"
|
185
|
|
- class="icon9"
|
186
|
|
- style="position: absolute;left:0;bottom:0;z-index:3;width: 100vw;"
|
187
|
|
- alt
|
188
|
|
- >
|
189
|
|
- <div class="userIcon">
|
|
138
|
+ <div class="userIcon" style="z-index: 20;">
|
190
|
139
|
<a>
|
191
|
140
|
<img :src="userIcon" class="centerLabel cover" alt>
|
192
|
141
|
</a>
|
193
|
142
|
</div>
|
194
|
|
- <div class="centerLabel">
|
195
|
|
- <span>亲爱的你,新年好</span>
|
196
|
|
- <span>亲爱的你,新年好</span>
|
197
|
|
- <span>亲爱的你,新年好</span>
|
|
143
|
+ <div class="centerLabel" style="z-index: 20">
|
|
144
|
+ <img
|
|
145
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-15.png"
|
|
146
|
+ width="100%"
|
|
147
|
+ alt
|
|
148
|
+ >
|
198
|
149
|
<span></span>
|
199
|
|
- <span>亲爱的你,新年好</span>
|
200
|
|
- <span>亲爱的你,新年好</span>
|
201
|
|
- <span>亲爱的你,新年好</span>
|
202
|
|
- <span>亲爱的你,新年好</span>
|
203
|
|
- <span>亲爱的你,新年好</span>
|
204
|
|
- <span>亲爱的你,新年好</span>
|
|
150
|
+ <img
|
|
151
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-16.png"
|
|
152
|
+ v-if="showEndTextIndex === 0"
|
|
153
|
+ width="100%"
|
|
154
|
+ alt
|
|
155
|
+ >
|
|
156
|
+ <img
|
|
157
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-17.png"
|
|
158
|
+ v-if="showEndTextIndex === 1"
|
|
159
|
+ width="100%"
|
|
160
|
+ alt
|
|
161
|
+ >
|
|
162
|
+ <img
|
|
163
|
+ src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-18.png"
|
|
164
|
+ v-if="showEndTextIndex === 2"
|
|
165
|
+ width="100%"
|
|
166
|
+ alt
|
|
167
|
+ >
|
205
|
168
|
</div>
|
206
|
169
|
<div class="bottomText">
|
207
|
170
|
<div class="qrCode">
|
208
|
171
|
<a>
|
209
|
|
- <img :src="qrCode" class="centerLabel cover" alt>
|
|
172
|
+ <img src="http://wx.jinchengjiaye.com/h5-2019/static/images/icon-19.png" class="centerLabel cover" alt>
|
210
|
173
|
</a>
|
211
|
174
|
</div>
|
212
|
175
|
<span>长按二维码</span>
|
213
|
176
|
<span>祝福你的2019</span>
|
214
|
177
|
</div>
|
215
|
178
|
</div>
|
|
179
|
+ <div class="page4" :class="{'show': currentPage === 4 && imgSrc !== null}">
|
|
180
|
+ <img :src="imgSrc" width="100%" class="cover" alt>
|
|
181
|
+ </div>
|
216
|
182
|
</div>
|
217
|
183
|
</div>
|
218
|
184
|
</template>
|
219
|
185
|
|
220
|
186
|
<script>
|
|
187
|
+import html2canvas from 'html2canvas'
|
|
188
|
+import musicPlay from '../../util/music'
|
221
|
189
|
export default {
|
222
|
190
|
name: '',
|
223
|
191
|
data () {
|
224
|
192
|
return {
|
225
|
193
|
showPage: false,
|
226
|
194
|
imgNum: 0,
|
227
|
|
- imgTotal: 18,
|
|
195
|
+ imgTotal: 19,
|
228
|
196
|
currentPage: 0,
|
229
|
197
|
userIcon: '',
|
230
|
198
|
qrCode: '',
|
|
@@ -255,7 +223,11 @@ export default {
|
255
|
223
|
'实现财务自由',
|
256
|
224
|
'方案一次过',
|
257
|
225
|
'男(女)神回复我信息'
|
258
|
|
- ]
|
|
226
|
+ ],
|
|
227
|
+ selectFlag: [],
|
|
228
|
+ userSelectFlag: [],
|
|
229
|
+ showEndTextIndex: Math.floor(Math.random() * 3),
|
|
230
|
+ imgSrc: null
|
259
|
231
|
}
|
260
|
232
|
},
|
261
|
233
|
computed: {
|
|
@@ -263,12 +235,40 @@ export default {
|
263
|
235
|
components: {
|
264
|
236
|
},
|
265
|
237
|
created () {
|
|
238
|
+ '*********'.split('*').forEach(x => {
|
|
239
|
+ while (true) {
|
|
240
|
+ const inx = Math.floor(Math.random() * this.flagList.length)
|
|
241
|
+ const res = this.flagList[inx]
|
|
242
|
+ if (this.selectFlag.indexOf(res) === -1) {
|
|
243
|
+ this.selectFlag.push({
|
|
244
|
+ select: false,
|
|
245
|
+ value: res
|
|
246
|
+ })
|
|
247
|
+ break
|
|
248
|
+ }
|
|
249
|
+ }
|
|
250
|
+ })
|
266
|
251
|
},
|
267
|
252
|
mounted () {
|
268
|
253
|
this.$nextTick(() => {
|
|
254
|
+ musicPlay('http://wx.jinchengjiaye.com/h5-2019/static/images/Thomas%20Greenberg.mp3')
|
269
|
255
|
})
|
270
|
256
|
},
|
271
|
257
|
methods: {
|
|
258
|
+ nextStep () { // 下一步
|
|
259
|
+ this.currentPage = this.userSelectFlag.length ? 3 : 2
|
|
260
|
+ window.setTimeout(() => {
|
|
261
|
+ this.convert2canvas(document.getElementById('canvasPage')).then((res) => {
|
|
262
|
+ this.imgSrc = res
|
|
263
|
+ this.currentPage = 4
|
|
264
|
+ })
|
|
265
|
+ }, 300)
|
|
266
|
+ },
|
|
267
|
+ selectFlagItem (item, index) {
|
|
268
|
+ document.getElementsByClassName('flagItem')[index].style = 'transition: all .3s ease;-webkit-transition: all .3s ease;'
|
|
269
|
+ item.select = true
|
|
270
|
+ this.userSelectFlag.push(item)
|
|
271
|
+ },
|
272
|
272
|
imgLoad () { // 图片加载进度存储
|
273
|
273
|
this.imgNum += 1
|
274
|
274
|
if (this.imgNum === this.imgTotal) {
|
|
@@ -280,6 +280,33 @@ export default {
|
280
|
280
|
},
|
281
|
281
|
returnImgNum () { // 图片加载进度读取
|
282
|
282
|
return Math.floor((this.imgNum / this.imgTotal) * 100)
|
|
283
|
+ },
|
|
284
|
+ convert2canvas (dom) {
|
|
285
|
+ return new Promise((resolve, reject) => {
|
|
286
|
+ var shareContent = dom
|
|
287
|
+ var width = shareContent.offsetWidth // 获取dom 宽度
|
|
288
|
+ var height = shareContent.offsetHeight // 获取dom 高度
|
|
289
|
+ var canvas = document.createElement('canvas') // 创建一个canvas节点
|
|
290
|
+ var scale = 1 // 定义任意放大倍数 支持小数
|
|
291
|
+ canvas.width = width * scale // 定义canvas 宽度 * 缩放
|
|
292
|
+ canvas.height = height * scale // 定义canvas高度 *缩放
|
|
293
|
+ canvas.getContext('2d').scale(scale, scale) // 获取context,设置scale
|
|
294
|
+ var opts = {
|
|
295
|
+ scale: scale, // 添加的scale 参数
|
|
296
|
+ canvas: canvas, // 自定义 canvas
|
|
297
|
+ width: width, // dom 原始宽度
|
|
298
|
+ height: height,
|
|
299
|
+ useCORS: true // 【重要】开启跨域配置
|
|
300
|
+ }
|
|
301
|
+ html2canvas(shareContent, opts).then(function (canvas) {
|
|
302
|
+ var context = canvas.getContext('2d') // 【重要】关闭抗锯齿
|
|
303
|
+ context.mozImageSmoothingEnabled = false
|
|
304
|
+ context.webkitImageSmoothingEnabled = false
|
|
305
|
+ context.msImageSmoothingEnabled = false
|
|
306
|
+ context.imageSmoothingEnabled = false
|
|
307
|
+ resolve(canvas.toDataURL('image/jpeg'))
|
|
308
|
+ })
|
|
309
|
+ })
|
283
|
310
|
}
|
284
|
311
|
}
|
285
|
312
|
}
|