feat:下载分享检查

This commit is contained in:
R524809
2025-11-21 17:17:36 +08:00
parent ddab64bb20
commit ec773a650c
27 changed files with 267 additions and 181076 deletions
+1
View File
@@ -13,6 +13,7 @@
"word-card": "../../components/word-card/word-card",
"color-picker": "../../components/color-picker/color-picker",
"introduction-popup": "../../components/introduction-popup/introduction-popup",
"share-guide-popup": "../../components/share-guide-popup/share-guide-popup",
"toy-button": "../../ui/button/button",
"word-picker": "../../components/word-picker/word-picker",
"empty-state": "../../components/empty-state/empty-state"
+7 -37
View File
@@ -6,10 +6,7 @@ import {
TemplateType,
} from '../../service/drawServiceFactory';
import { checkAndSaveImage } from '../../utils/saveImage';
import {
shouldShowShareGuide,
recordShareSuccess,
} from '../../utils/shareGuide';
import { shouldShowShareGuide } from '../../utils/shareGuide';
Page({
canvas: null as Canvas | null,
@@ -304,36 +301,9 @@ Page({
this.setData({ showShareDialog: false });
},
/** 点击转发按钮 */
onShareToFriend() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
/** 分享成功回调(由组件触发) */
onShareSuccess() {
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.cardList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
/** 点击分享到朋友圈按钮 */
onShareToTimeline() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
this.setData({ showShareDialog: false });
// 允许继续下载
if (this.canvas && this.data.cardList.length > 0) {
checkAndSaveImage(this.canvas);
}
wx.showToast({
title: '分享后即可继续下载',
icon: 'success',
duration: 2000,
});
},
onColorTap(e: WechatMiniprogram.CustomEvent) {
@@ -374,19 +344,19 @@ Page({
},
onShareAppMessage() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
path: '/pages/index/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
onShareTimeline() {
// 记录分享成功(用户真正分享了)
recordShareSuccess();
return {
title: '涂鸦丫-涂色|识字|画画|打印',
query: '/pages/index/index',
imageUrl:
'https://cdn.joeyone.cn/doodle/share-img/index-share-v2.png',
};
},
+7 -13
View File
@@ -135,16 +135,10 @@
下载打印
</toy-button>
</view>
<introduction-popup
wx:if="{{showIntroductionPopup}}"
bind:onClose="onCloseIntroductionPopup" />
<van-dialog
show="{{showShareDialog}}"
title="分享解锁下载"
message="今日免费下载次数已用完,分享给好友或朋友圈后即可继续免费下载"
show-cancel-button
confirm-button-text="转发给好友"
cancel-button-text="分享到朋友圈"
bind:confirm="onShareToFriend"
bind:cancel="onShareToTimeline"
bind:close="onCloseShareDialog" />
<introduction-popup
wx:if="{{showIntroductionPopup}}"
bind:onClose="onCloseIntroductionPopup" />
<share-guide-popup
show="{{showShareDialog}}"
bind:onClose="onCloseShareDialog"
bind:onShareSuccess="onShareSuccess" />