云迈博客

您现在的位置是:首页 > 前端技术 > 微信小程序 > 正文

微信小程序

微信小程序自定义分享按钮

彭静2022-02-28微信小程序248
将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;
    }
},

发表评论

评论列表

  • 这篇文章还没有收到评论,赶紧来抢沙发吧~