export default{//微信小程序分享功能
    data(){
        return {//设置默认的分享参数
            share:{
                title:'vlog',
                path:'/pages/index/index',
                imageUrl:'',
                desc:'',
                content:''
            }
        }
    },
    onLoad(){
    	wx.showShareMenu({
    		withShareTicket:true,
    		menus:["shareAppMessage","shareTimeline"]
    	})
    },
    onShareAppMessage(res) {//发送给朋友
    	// 此处的openid为分享者的部分信息，需要传递给其他人
    	let openid = uni.getStorageSync('openid');
    	if (openid) {
    		return {
    			title: '胖丁旅游',
    			type: 0,
    			path: '/pages/index/index?id=' + openid,
    			summary: "",
    			imageUrl: "https://58d.oss-cn-hangzhou.aliyuncs.com/goods/ttg_1596073788000.png"
    		}
    	}
    },
    onShareTimeline(res) {//分享到朋友圈
    	let openid = uni.getStorageSync('openid');
    	if (openid) {
    		return {
    			title: '胖丁旅游',
    			type: 0,
    			query: 'id=' + openid,
    			summary: "",
    			imageUrl: "https://58d.oss-cn-hangzhou.aliyuncs.com/goods/ttg_1596073788000.png"
    		}
    	}
    },
}