<button open-type="share">分享</button>
js
onShareAppMessage(res) {
if (res.from === 'button') {
console.log(res.target)
}
return {
title: '自定义分享标题',
path: '/pages/test/test?id=123',
imgUrl:''
}
}
onShareTimeline(res) {
if (res.from === 'button') {
console.log(res.target)
}
return {
title: '自定义分享标题',
path: '/pages/test/test?id=123',
imgUrl:''
}
}
分享三步走:
- (分享者)分享的时候 ,把邀请者的ID带上 inviteID
- (受邀请者) 进入首页 onload(options){options.inviteID }获取邀请者的ID 并且uni.setstor....存入缓存、
- (受邀请者)进入登录页,在调登录接口的时候把inviteID 坐蓐参数传入即可