首页 > 编程知识 正文

uniapp 小程序分享功能,小程序分享功能

时间:2023-05-05 11:38:15 阅读:267256 作者:3845

uni-app与小程序分享朋友圈功能实操

1、首先明白,uni-app 与 小程序的工作原理,熟知API文档,在开发中有很大的必要性。[文档:uni-app官方文档]
2、微信朋友圈分享,废话不多说,直接上代码?[小程序API:官方文档]

调用API分享朋友圈: onShareTimeline onShareTimeline: function(res) {const data = this.bannerdata.find(item => {this.titlea = item.name;this.pisa = item.pic;}) return { title: this.titlea, //字符串 自定义标题 // query: `id=${this.$yroute.query.id}`, //页面携带参数 path: `/pages/home/index`, imageUrl: this.pica //图片地址 }}, 调用API分享给好友:onShareAppMessage onShareAppMessage: function(res) {const data = this.bannerdata.find(item => {this.titlea = item.name})return {title: this.titlea,path: `/pages/home/index`,}}, 调用成功截图

平API要与methods平齐,方可执行。

百尺竿头、日进一步问题讨论:请留言! 本期配图主题:百变女神陈钰琪小姐姐。

喜欢的点个赞吧~~~

版权声明:该文观点仅代表作者本人。处理文章:请发送邮件至 三1五14八八95#扣扣.com 举报,一经查实,本站将立刻删除。