feat: 优化字帖功能

This commit is contained in:
R524809
2026-02-11 16:03:39 +08:00
parent 943250b34a
commit cbf07faf27
11 changed files with 474 additions and 280 deletions
+6 -15
View File
@@ -1,9 +1,7 @@
import { SHAPES, ShapeCard } from '../../constants/shapes';
import { WATER_COLORS, PAPER_SIZE } from '../../constants/colors';
import ShapeDrawService from '../../service/shapeDrawService';
import { checkAndSaveImage } from '../../utils/saveImage';
import { shouldShowShareGuide } from '../../utils/shareGuide';
import tracker from '../../utils/tracker';
import { downloadPrint } from '../../utils/downloadPrint';
Page({
canvas: null as Canvas | null,
@@ -286,22 +284,15 @@ Page({
},
/** 下载打印 */
exportToPrint() {
async exportToPrint() {
if (!this.canvas || this.data.shapeList.length <= 0) {
return;
}
// 检查是否需要显示分享引导
if (shouldShowShareGuide()) {
this.setData({ showShareDialog: true });
return;
}
// 上报下载埋点
tracker.reportDownload('图形涂色');
// 直接下载
checkAndSaveImage(this.canvas);
await downloadPrint(this.canvas, {
errorToast: '请先生成图形',
trackerName: '图形涂色',
});
},
/** 关闭分享引导弹窗 */