微信小程序分享朋友圈

        onMounted() {
            uni.showShareMenu({
                withShareTicket: true,
                menus: ["shareAppMessage", "shareTimeline"]
            })
        },
getShareData(type) {
				let title = "分享标题";
				let path = `/pages/index/index`;
				let imageUrl = '';
				let shareObj = {}
				if (type == "timeline") {
					shareObj = {
						title,
						imageUrl,
						query: path,
					}
				}else{
					shareObj = {
						title,
						imageUrl,
						path
					}
				}
				return shareObj
			},
		onShareTimeline() {
			let that = this;
			return that.getShareData('timeline');
		},
		onShareAppMessage() {
			let that = this;
			return that.getShareData();
		}


版权声明:本文为qq_35086913原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。