微信小程序分享好友列表

不说谎话,因为总有被拆穿的一天。

<button class="btn sendFriends shareTips" open-type="share">发送给朋友</button>
// 小程序 发送给朋友
    onShareAppMessage: function(res) {
        wx.showToast({ title: res, icon: 'success', duration: 2000 })
        var that = this;
        var courseId = that.data.courseId; //获取产品id
        var title = that.data.title; //获取产品标题
        var cover = that.data.cover; //产品图片
        that.hideModal();
        if (res.from === 'button') {
            // 来自页面内转发按钮
            return {
                title: title,
                path: '/page/index?courseId=' + courseId,
                imageUrl: cover, //不设置则默认为当前页面的截图
                success: (res) => {
                    wx.showToast({ title: res, icon: 'success', duration: 2000 })
                },
                fail: (res) => {
                    wx.showToast({ title: res, icon: 'success', duration: 2000 })
                }
            }
        }
    },

在最后附上我的QQ: 2489757828 有问题的话可以找我一同探讨

我的私人博客: 李大玄
我的CSDN: 李大玄

©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容