1、需求:用户在邀请页面获取一定参数向好友分享,好友点击后跳转申请页面
2、思路:利用小程序自带button组件的open-type="share",触发在js里面的onShareAppMessage方法去设置跳转的页面
3、实现:
wxml
<button open-type="share" class="btn_apply">邀请好友</button>
js
/** * 用户点击右上角分享 */ onShareAppMessage: function () { return { title: '访客申请', path: `/pages/user/cusApply/cusApply?applyType=2` } }