小程序不能分享和转发?求index.ts和app.ts中相关代码

小程序 文章 2022-04-22 17:40 367 0 全屏看文

AI助手支持GPT4.0

小程序不能分享和转发?求index.ts和app.ts中相关代码Can't share and forward mini programs? Find the relevant code in index.ts and app.ts

小程序不能分享和转发?求index.ts和app.ts中相关代码

如图:本人想把wap网站封装成微信小程序,封装之后发现分享到朋友圈和转发给朋友的相关功能不能使用。求index.ts 和 app.ts中相关转发与分享代码。(注意不是index.js 和 app.js代码,这个网上有,但是新建的小程序里面是 index.ts 和 app.ts 文件)

As shown in the figure: I want to package the WAP website into a wechat applet. After packaging, I find that the related functions of sharing to the circle of friends and forwarding to friends cannot be used. Find index Ts and app TS related forwarding and sharing code. (note that it is not the code of index.js and app.js, which are available on the Internet, but the new applet contains the files of index.ts and app.ts)

回答:

less:

js VS ts

跨商通:

1、新建一个page,不要改任何代码,然后点击分享。

鲤子:

index.ts里面加个转发的方法onShareAppMessage

习令奋:谢谢你  刚刚看了一下文档 


Page({
  onShareAppMessage() {
    const promise = new Promise(resolve => {
      setTimeout(() => {
        resolve({
          title: '自定义转发标题'
        })
      }, 2000)
    })
    return {
      title: '自定义转发标题',
      path: '/page/user?id=123',
      promise
    }
  }
})


请问 title 和 path 怎么设置。默认好像是小程序名称和首页。我希望是当前页面的标题和地址。怎么设置呢?
拾忆:如果希望是默认的,里面的代码就都不要,只保留下面的就行。
嘿嘿:

onShareAppMessage

习令奋:谢谢  请问 title 和 path 怎么设置。默认好像是小程序名称和首页。我希望是当前页面的标题和地址。怎么设置呢?   
    title: '自定义转发标题',
      path: '/page/user?id=123',
微喵网络:

要在页面代码中配置onShareAppMessage

-EOF-

AI助手支持GPT4.0


国内超级便宜服务器

摸鱼人热门新闻聚合

钻级赞助商 我要加入

开发者在线工具

第三方支付技术请加QQ群

相关文章
急!急!急!明天要做一场会议直播,现在视频号认证还没过?
分享到朋友圈、分享给朋友不正常,分享到QQ好友正常
图片不能直接拉到文章里吗?都要上传一下,麻烦
PC端用公众号扫码登录时提示,此公众号没有这些scope权限扫码登录?
视频号昵称被占用,多次投诉均不成功,官方能不能帮忙介入处理?
随便看看
企业微信通讯录账号被管理员误/恶意删除,怎么办? 8127
问题? 7452
如何快速搭建抽奖助手小程序(无需代码知识) 5130
许涛 大哥在吗, 要解冻小程序的时候提示信息主体不一致, 能帮忙看下吗? 6086
小程序搜一搜全称搜索不显示 麻烦解决一下!谢谢 5696
我的小程序广告收款主体是个体工商户,每个月邮寄两次发票很是麻烦,我年底的时候打包邮寄一次可以么? 5279
如何解决渲染层网络错误Failed to load media? 16625
小程序找号找回 释放昵称? 2472
我的小程序广告主收入5301,实际进账4406,是怎么回事呀? 2550
删除部分微信用户个人数据的通知,怎么删除? 5601