feat:下载分享检查
This commit is contained in:
@@ -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',
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user