介绍
这篇文章主要介绍了如何将小程序分享到朋友圈,具有一定借鉴价值,感兴趣的朋友可以参考下,希望大家阅读完这篇文章之后大有收获、下面让小编带着大家一起了解一下。
先看案例
微信开发文档:https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html
https://developers.weixin.qq.com/miniprogram/dev/reference/api/Page.html onShareTimeline https://developers.weixin.qq.com/miniprogram/dev/api/share/wx.showShareMenu.html
代码
//index.js//获取应用实例 const app =, getApp () , 页面({ ,,数据:{ ,,,, ,,}, ,, onLoad才能:function (), { ,, ,,,wx.showShareMenu ({ ,,,,,菜单:,(& # 39;shareAppMessage& # 39;,, & # 39; shareTimeline& # 39;], ,,,,,成功(res), { ,,,,,,,console.log (res) ,,,,,}, ,,,,,失败(e), { ,,,,,,,console.log (e) ,,,,,} ,,,}) ,,,, ,,}, ,, onShareAppMessage才能(){ ,,,, ,,}, onShareTimeline才能(){ ,,,, ,,} ,, })
感谢你能够认真阅读完这篇文章,希望小编分享的“如何将小程序分享到朋友圈”这篇文章对大家有帮助,同时也希望大家多多支持,关注行业资讯频道,更多相关知识等着你来学习!