当前位置: 移动技术网 > IT编程>开发语言>Java > 微信小程序分享的朋友圈

微信小程序分享的朋友圈

2020年07月15日  | 移动技术网IT编程  | 我要评论

上图在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
注意事项、
1、onLoad中声明:

 wx.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage', 'shareTimeline']
    });   

2、要有onShareAppMessage,并return。
3、不是web-view页面。
4、要有onShareTimeline,并return。
5、把小程序工具基础库调到2.11.3以上。
6、内测阶段仅部分机型的bate版本微信可以真机测试。

具体实现代码

onLoad: function (options) {
 wx.showShareMenu({
      withShareTicket: true,
      menus: ['shareAppMessage', 'shareTimeline']
    });  
    }
var that = this
if (res.from === 'button') {}
return {
  title: '注册自己的服装定制小程序吧~~',
  path: '/pages/mall/xxxxx/xxxxx?id=' + that.data.goodId,
  success: function (res) {
    console.log('转发成功', res)
  }
}
onShareTimeline: function () {
var that = this
	return {
      title: '定制属于自己的服装',
      query: 'id=' + that.data.goodId,
      imageUrl: 'https://www.xxxxxx.cn/xxx/xxx/202004/004152026453oux.jpg'
    }
},

本文地址:https://blog.csdn.net/u010481239/article/details/107324992

如对本文有疑问, 点击进行留言回复!!

相关文章:

验证码:
移动技术网