Skip to content

Add onShareTimeline life time callback #6

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions types/uni-app/lib/page.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,21 @@ declare namespace Page {
*/
imageUrl?: string;
}

interface CustomTimelineContent {
/**
* 自定义标题,即朋友圈列表页上显示的标题。默认值:当前小程序名称
*/
title?: string
/**
* 自定义页面路径中携带的参数,如 `path?a=1&b=2` 的 “?” 后面部分 默认值:当前页面路径携带的参数
*/
query?: string
/**
* 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持 PNG 及 JPG。显示图片长宽比是 1:1。默认值:默认使用小程序 Logo
*/
imageUrl?: string
}

interface PageScrollOption {
/**
Expand Down Expand Up @@ -136,6 +151,14 @@ declare namespace Page {
* @return 转发内容
*/
onShareAppMessage?(options: ShareAppMessageOption): CustomShareContent;
/**
* 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义分享内容
*
* 本接口为 Beta 版本,暂只在 Android 平台支持,详见 [分享到朋友圈 (Beta)](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html)
*
* 基础库 2.11.3 开始支持,低版本需做兼容处理。
*/
onShareTimeline?(): CustomTimelineContent;
/**
* 页面滚动触发事件的处理函数
*
Expand Down