微信小程序转发 您所在的位置:网站首页 秒传脚本代码怎么写 微信小程序转发

微信小程序转发

2023-05-03 06:27| 来源: 网络整理| 查看: 265

微信小程序的转发分两张情况

1.自定义的转发按钮

2.小程序自带的右上角的转发按钮

小程序  API  https://developers.weixin.qq.com/miniprogram/dev/api/share.html

下图是自定义的转发按钮

 

xml

js

onShareAppMessage: function (res) { var that = this; console.log("openid" + wx.getStorageSync("openid")) if (res.from === "button") { console.log("来自页面内转发按钮"); console.log(res.target); } else { console.log("来自右上角转发菜单") } return { title: '嘿,装修', path: '/pages/activity/userDetail / userDetail?articleid=' + that.data.articleid + '&shareid=' + wx.getStorageSync("openid"), success: (res) => { console.log("转发成功", res); }, fail: (res) => { console.log("转发失败", res); } } },

 js中做了两种转发的判断,仅供参考,以后有机会会补上更全面的代码段

 



【本文地址】

公司简介

联系我们

今日新闻

    推荐新闻

    专题文章
      CopyRight 2018-2019 实验室设备网 版权所有