Files
doodle-mini/miniprogram/components/share-guide-popup/share-guide-popup.ts
T
2025-11-21 17:17:36 +08:00

41 lines
928 B
TypeScript

import { recordShareSuccess } from '../../utils/shareGuide';
Component({
options: {},
/**
* 组件的属性列表
*/
properties: {
show: {
type: Boolean,
value: false,
},
},
/**
* 组件的初始数据
*/
data: {},
/**
* 组件的方法列表
*/
methods: {
/** 关闭弹窗 */
onClose() {
this.triggerEvent('onClose');
},
/** 点击遮罩层关闭 */
onOverlayClick() {
this.onClose();
},
/** 点击分享按钮 */
onShare() {
// 记录分享成功(用户点击了分享按钮,视为已分享)
recordShareSuccess();
// 关闭弹窗并通知父组件分享成功(不触发下载,用户需要重新点击下载按钮)
this.triggerEvent('onShareSuccess');
},
},
});