|
|
@@ -18,7 +18,7 @@
|
|
18
|
18
|
<view class="activite-card">
|
|
19
|
19
|
<image
|
|
20
|
20
|
class="activite-card-logo"
|
|
21
|
|
- src="https://cdn.bjtdba.com/vod/image/2025-02-18/20250218234259970.png"
|
|
|
21
|
+ src="./assets/xfb.png"
|
|
22
|
22
|
mode=""
|
|
23
|
23
|
></image>
|
|
24
|
24
|
|
|
|
@@ -35,11 +35,11 @@
|
|
35
|
35
|
</view>
|
|
36
|
36
|
<view class="activite-prompt-img">
|
|
37
|
37
|
<image
|
|
38
|
|
- src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141611538.png"
|
|
|
38
|
+ src="./assets/zfb.png"
|
|
39
|
39
|
mode=""
|
|
40
|
40
|
></image>
|
|
41
|
41
|
<image
|
|
42
|
|
- src="https://cdn.bjtdba.com/vod/image/2022-08-23/20220823141556288.png"
|
|
|
42
|
+ src="./assets/wx.png"
|
|
43
|
43
|
mode=""
|
|
44
|
44
|
></image>
|
|
45
|
45
|
</view>
|
|
|
@@ -54,7 +54,7 @@
|
|
54
|
54
|
></image>
|
|
55
|
55
|
<view class="downLoad-text"> 保存图片 </view>
|
|
56
|
56
|
</view> -->
|
|
57
|
|
- <view class="downLoadButton" @click="clickGeneratePicture2">
|
|
|
57
|
+ <view class="downLoadButton" @click="clickGeneratePicture2">
|
|
58
|
58
|
<image
|
|
59
|
59
|
class="downLoad-image"
|
|
60
|
60
|
src="../../static/saveImage.png"
|
|
|
@@ -62,7 +62,7 @@
|
|
62
|
62
|
></image>
|
|
63
|
63
|
<view class="downLoad-text"> 保存图片 </view>
|
|
64
|
64
|
</view>
|
|
65
|
|
- </view>
|
|
|
65
|
+ </view>
|
|
66
|
66
|
<!-- ************************* 海报画板 **********************-->
|
|
67
|
67
|
<view style="position: absolute; bottom: 10%; left: 0%" v-show="flag">
|
|
68
|
68
|
<l-painter
|
|
|
@@ -125,11 +125,12 @@ export default {
|
|
125
|
125
|
this.$nextTick(() => {
|
|
126
|
126
|
this.queryByKey();
|
|
127
|
127
|
});
|
|
128
|
|
- this.qrcode_src = e.qrcode_src;
|
|
|
128
|
+ this.qrcode_src = e.qrcode_src.replace('https://cdn.bjtdba.com', '');
|
|
|
129
|
+ // this.qrcode_src = e.qrcode_src;
|
|
|
130
|
+
|
|
129
|
131
|
this.code_id = e.code_id;
|
|
130
|
132
|
},
|
|
131
|
133
|
mounted() {
|
|
132
|
|
-
|
|
133
|
134
|
},
|
|
134
|
135
|
methods: {
|
|
135
|
136
|
|
|
|
@@ -335,7 +336,33 @@ export default {
|
|
335
|
336
|
},
|
|
336
|
337
|
});
|
|
337
|
338
|
},
|
|
|
339
|
+ async downloadImage() {
|
|
|
340
|
+ try {
|
|
|
341
|
+ // 获取 DOM 元素
|
|
|
342
|
+ const element = document.getElementById('huoquId');
|
|
|
343
|
+ // 使用 html2canvas 将 DOM 转为 canvas
|
|
|
344
|
+ const canvas = await html2canvas(element);
|
|
|
345
|
+ // 将 canvas 转为图片地址
|
|
|
346
|
+ const imageUrl = canvas.toDataURL('image/png');
|
|
|
347
|
+ // 触发下载
|
|
|
348
|
+ this.downloadFile(imageUrl, 'image.png');
|
|
|
349
|
+ } catch (error) {
|
|
|
350
|
+ console.error('生成图片失败:', error);
|
|
|
351
|
+ }
|
|
|
352
|
+ },
|
|
|
353
|
+ // 下载文件的方法
|
|
|
354
|
+ downloadFile(url, filename) {
|
|
|
355
|
+ const link = document.createElement('a');
|
|
|
356
|
+ link.href = url;
|
|
|
357
|
+ link.download = filename;
|
|
|
358
|
+ document.body.appendChild(link);
|
|
|
359
|
+ link.click();
|
|
|
360
|
+ document.body.removeChild(link);
|
|
|
361
|
+ },
|
|
338
|
362
|
clickGeneratePicture2() {
|
|
|
363
|
+ this.downloadImage();
|
|
|
364
|
+
|
|
|
365
|
+ return;
|
|
339
|
366
|
let _this = this;
|
|
340
|
367
|
let fileName = "pension_分享海报.jpg";
|
|
341
|
368
|
// this.drawCanvas();
|
|
|
@@ -345,7 +372,7 @@ export default {
|
|
345
|
372
|
// const imageUrl = canvas.toDataURL('image/png');
|
|
346
|
373
|
// _this.saveImageData(imageUrl);
|
|
347
|
374
|
// });
|
|
348
|
|
- //
|
|
|
375
|
+ //
|
|
349
|
376
|
if (this.qrcode_src == "") {
|
|
350
|
377
|
uni.showToast({
|
|
351
|
378
|
title: "无生成二维码",
|
|
|
@@ -526,7 +553,7 @@ page {
|
|
526
|
553
|
display: flex;
|
|
527
|
554
|
flex-direction: column;
|
|
528
|
555
|
align-items: center;
|
|
529
|
|
- background: url("https://cdn.bjtdba.com/vod/image/2022-08-23/20220823132549341.png")
|
|
|
556
|
+ background: url("./assets/bg.png")
|
|
530
|
557
|
no-repeat;
|
|
531
|
558
|
background-size: 100%;
|
|
532
|
559
|
padding-bottom: 242rpx;
|
|
|
@@ -535,7 +562,7 @@ page {
|
|
535
|
562
|
width: 688rpx;
|
|
536
|
563
|
margin-top: 154rpx;
|
|
537
|
564
|
height: 1053rpx;
|
|
538
|
|
- background: url("https://cdn.bjtdba.com/vod/image/2022-08-23/20220823134038776.png")
|
|
|
565
|
+ background: url("./assets/bg2.png")
|
|
539
|
566
|
no-repeat;
|
|
540
|
567
|
background-size: 100%;
|
|
541
|
568
|
display: flex;
|
|
|
@@ -549,7 +576,8 @@ page {
|
|
549
|
576
|
position: absolute;
|
|
550
|
577
|
top: -52rpx;
|
|
551
|
578
|
left: 50%;
|
|
552
|
|
- transform: translate(-50%, 0);
|
|
|
579
|
+ /* transform: translate(-50%, 0); */
|
|
|
580
|
+ margin-left: -72rpx;
|
|
553
|
581
|
}
|
|
554
|
582
|
|
|
555
|
583
|
.activite-cardImg {
|