小程序转发成功无退回值onShareAppMessage
发布于 5 年前 作者 jing49 3719 次浏览 来自 问答

onShareAppMessage: function (fenxiangtuihui) {

console.log(fenxiangtuihui);

var shipindi = fenxiangtuihui.target.dataset.id;

var that = this;

var userid =wx.getStorageSync(‘userid’)

that.setData({

shareid: fenxiangtuihui.target.dataset.id

});

return {

title: ‘转发标题’,

path: ‘pages/b/a?userid=’ + fenxiangtuihui.target.dataset.id,

imageUrl:’/image/1123.jpg’,

success: function(zhuanfachenggong) {  

console.log(zhuanfachenggong);

//转发成功,无法添加Php数据库,体验版好用,正式上线就不好用。

wx.request({

url: url + ‘php/zhuanfa’,

method: ‘get’,

header: {‘content-type’: ‘application/x-www-form-urlencoded’},

data: { userid: userid, videoid: shipindi},

success: function() {

wx.redirectTo({

url: “/pages/yijingzhuanfa/yijingzhuanfa

});

},

});

},

}

},

回到顶部