首页文章正文

微信小程序分享链接,如何把小程序的分享转为链接

小程序分享功能怎么做 2023-05-27 21:06 834 墨鱼
小程序分享功能怎么做

微信小程序分享链接,如何把小程序的分享转为链接

微信小程序分享链接,如何把小程序的分享转为链接

Step1:进入平台,点击"小程序链接"Step2:获取小程序的三个参数,小程序的APPID,小程序APPSecret,以及要跳转到小程序页面的页面路径(具体获取方法将在后面介绍),填写这个微信小程序——分享H5外链,有两个页面,一个是y的页面我们自己的项目(跳转访问外链)tiaozhua.wxml,和theotheristo跳转到外链的页面(这个页面可以分享)share.wxml,inshare.wxml

grant_type=client_credential&appid=writeyourownapplet'sappid&secret=writeyourownapplet'ssecret(searchmethodisthesameasappid)',data:{//page_url:e.detail.encryptedData,//access_token:e.dapplet如果要对外分享,必须在页面定义onShareAppMessage函数来配置页面分享转发相关信息。 只有定义了这个事件句柄,右上角的菜单才会显示"Forward"

在右上角可以分享https://developers.weixin.qq/miniprogram/dev/reference/api/Page.html#onshareappmessageobject-

Sharelinkparametercarrying:shareonShareAppMessage:function(res){if(res.from==='button'){//fromtheforwardbuttoninthepagewx.showLoading();returnnewPromise((resolve,reject)=>{wx.showappletsharelinkfunction-onShareAppMessageonShareAppMessageusage:justaddopen-type= button标签中的"share",appletui会自动识别sharelink功能。sharejs中的代码如下:onShare

后台-插件-广告管理-内容页尾部广告(手机)

标签: 如何把小程序的分享转为链接

发表评论

评论列表

黑豹加速器 Copyright @ 2011-2022 All Rights Reserved. 版权所有 备案号:京ICP1234567-2号