// 定义全局分享
export default {
	data() {
		return {
			// 默认的全局分享内容
			share: {
				title: '情绪共鸣',
				path: 'pages/init', // 全局分享的路径
				imageUrl: 'https://image.xnszz.com/hehuaguoji/2025/03/13/f3eaebd6b1e1a794c74f74cd991b875a_20250313180027A010.png', // 全局分享的图片(可本地可网络)
			}
		}
	},
	// 1.发送给朋友
	onShareAppMessage(res) {
		const userInfo = uni.getStorageSync('userInfo')
		return {
			title: this.share.title,
			path: this.share.path + '?userId=' + userInfo.userid,
			imageUrl: this.share.imageUrl,
		}
	},
	// 2.分享到朋友圈
	onShareTimeline(res) {
		const userInfo = uni.getStorageSync('userInfo')
		return {
			title: this.share.title,
			path: this.share.path + '?userId=' + userInfo.userid,
			imageUrl: this.share.imageUrl,
		}
	},
}