优化海报保存逻辑,提升导出清晰度,兼容 iOS 设备。更新相关注释以反映画布尺寸和导出分辨率的变化。同时,调整小程序环境变量处理逻辑,确保生成的版本码正确,避免开发版过期问题。

This commit is contained in:
2026-02-13 11:30:10 +08:00
parent 0f9633b8f0
commit 5b182cc629
7 changed files with 41 additions and 8 deletions

View File

@@ -1210,14 +1210,15 @@ Page({
this.setData({ showPosterModal: false })
},
// 保存海报到相册(与海报绘制尺寸一致,必须传 destWidth/destHeight 否则部分机型导出失败
// 保存海报到相册:画布 300x450 兼容 iOS导出 2 倍 600x900 提升清晰度(宽高比 2:3 不变
savePoster() {
const width = 300
const height = 450
const exportScale = 2
wx.canvasToTempFilePath({
canvasId: 'posterCanvas',
destWidth: width,
destHeight: height,
destWidth: width * exportScale,
destHeight: height * exportScale,
fileType: 'png',
success: (res) => {
if (!res.tempFilePath) {

View File

@@ -256,7 +256,7 @@
<view class="modal-close" bindtap="closePosterModal">✕</view>
</view>
<!-- 海报预览 -->
<!-- 海报预览:画布 300x450 避免 iOS transform 裁切;保存时导出 2 倍分辨率 -->
<view class="poster-preview">
<canvas canvas-id="posterCanvas" class="poster-canvas" style="width: 300px; height: 450px;"></canvas>
</view>