微信小程序> 小程序如何分享给好友-微信小程序点击分享功能-小程序分享

小程序如何分享给好友-微信小程序点击分享功能-小程序分享

浏览量:1553 时间: 来源:darkZXB

1.[html部分]

viewclass="usermottocarDesccarDesc1"!--buttonclass="user-mottoshare"{{motto}}/button--buttonclass='shareuser-motto'id="shareBtn"open-type="share"hover-class="other-button-hover"{{motto}}/button/view

2.[js部分]

3.pages({

data:{tempFilePaths:'',motto:'分享给朋友',userInfo:{},hasUserInfo:false,canIUse:wx.canIUse('button.open-type.getUserInfo')},//分享按钮函数onShareAppMessage:function(ops){if(ops.from==='button'){//来自页面内转发按钮console.log(ops.target)}return{title:'XXX小程序',path:'pages/index/index',success:function(res){//转发成功console.log("转发成功:"+JSON.stringify(res));},fail:function(res){//转发失败console.log("转发失败:"+JSON.stringify(res));}}},

4.})

版权声明

即速应用倡导尊重与保护知识产权。如发现本站文章存在版权问题,烦请提供版权疑问、身份证明、版权证明、联系方式等发邮件至197452366@qq.com ,我们将及时处理。本站文章仅作分享交流用途,作者观点不等同于即速应用观点。用户与作者的任何交易与本站无关,请知悉。

  • 头条
  • 搜狐
  • 微博
  • 百家
  • 一点资讯
  • 知乎