|
|
@@ -54,15 +54,16 @@
|
|
54
|
54
|
></image>
|
|
55
|
55
|
<view class="downLoad-text"> 保存图片 </view>
|
|
56
|
56
|
</view> -->
|
|
|
57
|
+
|
|
|
58
|
+ </view>
|
|
57
|
59
|
<view class="downLoadButton" @click="clickGeneratePicture2">
|
|
58
|
|
- <image
|
|
59
|
|
- class="downLoad-image"
|
|
60
|
|
- src="../../static/saveImage.png"
|
|
61
|
|
- mode=""
|
|
62
|
|
- ></image>
|
|
63
|
|
- <view class="downLoad-text"> 保存图片 </view>
|
|
64
|
|
- </view>
|
|
65
|
|
- </view>
|
|
|
60
|
+ <image
|
|
|
61
|
+ class="downLoad-image"
|
|
|
62
|
+ src="../../static/saveImage.png"
|
|
|
63
|
+ mode=""
|
|
|
64
|
+ ></image>
|
|
|
65
|
+ <view class="downLoad-text"> 保存图片 </view>
|
|
|
66
|
+ </view>
|
|
66
|
67
|
<!-- ************************* 海报画板 **********************-->
|
|
67
|
68
|
<view style="position: absolute; bottom: 10%; left: 0%" v-show="flag">
|
|
68
|
69
|
<l-painter
|
|
|
@@ -341,9 +342,16 @@ export default {
|
|
341
|
342
|
// 获取 DOM 元素
|
|
342
|
343
|
const element = document.getElementById('huoquId');
|
|
343
|
344
|
// 使用 html2canvas 将 DOM 转为 canvas
|
|
344
|
|
- const canvas = await html2canvas(element);
|
|
|
345
|
+ const canvas = await html2canvas(element, {
|
|
|
346
|
+ scale: 3, // 渲染缩放倍数(推荐 2-3 倍)
|
|
|
347
|
+ dpi: 300, // 输出DPI (打印级精度)
|
|
|
348
|
+ onclone: (clonedDoc) => {
|
|
|
349
|
+ // 克隆文档时注入高清样式
|
|
|
350
|
+ clonedDoc.body.style.zoom = '100%';
|
|
|
351
|
+ }
|
|
|
352
|
+ });
|
|
345
|
353
|
// 将 canvas 转为图片地址
|
|
346
|
|
- const imageUrl = canvas.toDataURL('image/png');
|
|
|
354
|
+ const imageUrl = canvas.toDataURL('image/png', 1); // 最高质量压缩
|
|
347
|
355
|
// 触发下载
|
|
348
|
356
|
this.downloadFile(imageUrl, 'image.png');
|
|
349
|
357
|
} catch (error) {
|
|
|
@@ -600,7 +608,7 @@ page {
|
|
600
|
608
|
.activite-cardBtn {
|
|
601
|
609
|
width: 546rpx;
|
|
602
|
610
|
height: 94rpx;
|
|
603
|
|
- background: url("https://cdn.bjtdba.com/vod/image/2022-08-23/20220823140132620.png")
|
|
|
611
|
+ background: url("./assets/btn-bg.png")
|
|
604
|
612
|
no-repeat;
|
|
605
|
613
|
background-size: 100%;
|
|
606
|
614
|
color: #ffffff;
|
|
|
@@ -664,27 +672,28 @@ page {
|
|
664
|
672
|
}
|
|
665
|
673
|
}
|
|
666
|
674
|
|
|
667
|
|
- .downLoadButton {
|
|
668
|
|
- width: 128rpx;
|
|
669
|
|
- height: 165rpx;
|
|
670
|
|
- margin-top: 9rpx;
|
|
671
|
|
- // background-color: red;
|
|
672
|
|
- display: flex;
|
|
673
|
|
- flex-direction: column;
|
|
674
|
|
- align-items: center;
|
|
|
675
|
+
|
|
|
676
|
+ }
|
|
|
677
|
+ .downLoadButton {
|
|
|
678
|
+ margin-top: -220rpx;
|
|
|
679
|
+ width: 128rpx;
|
|
|
680
|
+ height: 165rpx;
|
|
|
681
|
+ // background-color: red;
|
|
|
682
|
+ display: flex;
|
|
|
683
|
+ flex-direction: column;
|
|
|
684
|
+ align-items: center;
|
|
675
|
685
|
|
|
676
|
|
- .downLoad-image {
|
|
677
|
|
- width: 128rpx;
|
|
678
|
|
- height: 128rpx;
|
|
679
|
|
- position: absolute;
|
|
680
|
|
- }
|
|
|
686
|
+ .downLoad-image {
|
|
|
687
|
+ width: 128rpx;
|
|
|
688
|
+ height: 128rpx;
|
|
|
689
|
+ position: absolute;
|
|
|
690
|
+ }
|
|
681
|
691
|
|
|
682
|
|
- .downLoad-text {
|
|
683
|
|
- margin-top: 128rpx;
|
|
684
|
|
- color: #ffffff;
|
|
685
|
|
- font-size: 26rpx;
|
|
686
|
|
- text-align: center;
|
|
687
|
|
- }
|
|
|
692
|
+ .downLoad-text {
|
|
|
693
|
+ margin-top: 128rpx;
|
|
|
694
|
+ color: #ffffff;
|
|
|
695
|
+ font-size: 26rpx;
|
|
|
696
|
+ text-align: center;
|
|
688
|
697
|
}
|
|
689
|
698
|
}
|
|
690
|
699
|
}
|