feat: 优化字帖功能
This commit is contained in:
@@ -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: '图形涂色',
|
||||
});
|
||||
},
|
||||
|
||||
/** 关闭分享引导弹窗 */
|
||||
|
||||
Reference in New Issue
Block a user