import config from '../config.js';
export default {
	data() {
		return {
			share: {}
		}
	},
	onShareAppMessage(res) { //发送给朋友
		//禁止二次转发--
		uni.showShareMenu({
			withShareTicket: true
		});
		wx.updateShareMenu({
			isPrivateMessage: true,
			withShareTicket: true,
			success(res) {
				console.log('updateShareMenu: ', res);
			},
			fail() {}
		});
		return {
			title: config.share.title,
			path: config.share.path,
			imageUrl: config.share.imageUrl,
			success(res) {
				uni.showToast({
					title: '分享成功'
				})
			},
			fail(res) {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		}
	},
	onShareTimeline(res) { //分享到朋友圈
		return {
			title: config.share.title,
			path: config.share.path,
			imageUrl: config.share.imageUrl,
			success(res) {
				uni.showToast({
					title: '分享成功'
				})
			},
			fail(res) {
				uni.showToast({
					title: '分享失败',
					icon: 'none'
				})
			}
		}
	},
}