From ab11feb42d65ca8e99907b3216fbec304ac0779a Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Thu, 3 Sep 2020 12:21:34 +0800 Subject: [PATCH 1/2] feat: add onShareTimeline --- types/wx/lib.wx.page.d.ts | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/types/wx/lib.wx.page.d.ts b/types/wx/lib.wx.page.d.ts index 74cb46f..d9f4a6f 100644 --- a/types/wx/lib.wx.page.d.ts +++ b/types/wx/lib.wx.page.d.ts @@ -100,6 +100,14 @@ declare namespace WechatMiniprogram { /** 分享发起来源参数 */ options: IShareAppMessageOption ): ICustomShareContent | void + /** + * 监听右上角菜单“分享到朋友圈”按钮的行为,并自定义分享内容 + * + * 本接口为 Beta 版本,暂只在 Android 平台支持,详见 [分享到朋友圈 (Beta)](https://developers.weixin.qq.com/miniprogram/dev/framework/open-ability/share-timeline.html) + * + * 基础库 2.11.3 开始支持,低版本需做兼容处理。 + */ + onShareTimeline(): ICustomTimelineContent | void /** 页面滚动触发事件的处理函数 * * 监听用户滑动页面事件。 @@ -168,6 +176,15 @@ declare namespace WechatMiniprogram { imageUrl?: string } + interface ICustomTimelineContent { + /** 自定义标题,即朋友圈列表页上显示的标题。默认值:当前小程序名称 */ + title?: string + /** 自定义页面路径中携带的参数,如 `path?a=1&b=2` 的 “?” 后面部分 默认值:当前页面路径携带的参数 */ + query?: string + /** 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持 PNG 及 JPG。显示图片长宽比是 1:1。默认值:默认使用小程序 Logo*/ + imageUrl?: string + } + interface IPageScrollOption { /** 页面在垂直方向已滚动的距离(单位px) */ scrollTop: number From b70f3bd958b875fed75913bd9a21a582b4dce82d Mon Sep 17 00:00:00 2001 From: "Mr.Hope" Date: Thu, 3 Sep 2020 14:49:27 +0800 Subject: [PATCH 2/2] fix: query is an Object --- types/wx/lib.wx.page.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/wx/lib.wx.page.d.ts b/types/wx/lib.wx.page.d.ts index d9f4a6f..934e30d 100644 --- a/types/wx/lib.wx.page.d.ts +++ b/types/wx/lib.wx.page.d.ts @@ -180,7 +180,7 @@ declare namespace WechatMiniprogram { /** 自定义标题,即朋友圈列表页上显示的标题。默认值:当前小程序名称 */ title?: string /** 自定义页面路径中携带的参数,如 `path?a=1&b=2` 的 “?” 后面部分 默认值:当前页面路径携带的参数 */ - query?: string + query?: Record /** 自定义图片路径,可以是本地文件路径、代码包文件路径或者网络图片路径。支持 PNG 及 JPG。显示图片长宽比是 1:1。默认值:默认使用小程序 Logo*/ imageUrl?: string }