微信小程序自定义分享按钮
将open-type改成share赠送onShareAppMessage(e){return{title:'您有一张票券待接收',
将open-type改成share
<button open-type="share" class="views3_right_btn col_blue2">赠送</button>
onShareAppMessage(e) {
return {
title: '您有一张票券待接收',
path: '/pages/index/index?sign='+this.sign,//传参
success: (res)=> {
// 转发成功
},
fail: function(res) {
// 转发失败
}
};
},
接收参数
onLoad(options) {
if (options.sign) {
this.sign = options.sign;
}
},
相关文章
发表评论
评论列表
- 这篇文章还没有收到评论,赶紧来抢沙发吧~