feat: 页面分享设置
This commit is contained in:
@@ -151,17 +151,26 @@ this.initPageInfo({ title: string, desc?: string, functionId: string })
|
||||
|
||||
导出并保存图片(用于打印)。
|
||||
|
||||
### getShareOptions()
|
||||
### getShareOptions() / getAppShareAppMessage() / getAppShareTimeline()
|
||||
|
||||
获取分享配置。
|
||||
全站统一使用 `config/config.ts` 中的 `defaultShareConfig`(标题、分享图);**分享 path 为当前页面**(含 `?id=` 等参数)。`createPage` 页面已内置 `onShareAppMessage` / `onShareTimeline`。
|
||||
|
||||
### onShareAppMessage()
|
||||
收藏、我的、设置页在 `*.json` 中关闭分享,并在 `onLoad` 调用 `disablePageShareMenu()`。
|
||||
|
||||
微信小程序分享处理函数。
|
||||
普通 `Page({})` 可展开:
|
||||
|
||||
### onShareTimeline()
|
||||
```typescript
|
||||
import { appSharePageMethods } from '../../base/pageMixin';
|
||||
|
||||
微信朋友圈分享处理函数。
|
||||
Page({
|
||||
// ...
|
||||
...appSharePageMethods,
|
||||
});
|
||||
```
|
||||
|
||||
### onShareAppMessage() / onShareTimeline()
|
||||
|
||||
由 `pageMixin` 提供,分享内容固定为首页入口,埋点仍上报当前页 `pageTitle`(canvas 页)或不带标签(Tab 页)。
|
||||
|
||||
## 专注力模块使用示例
|
||||
|
||||
@@ -203,7 +212,7 @@ function focusPageInfoLookup(functionId: string) {
|
||||
const focusConfig: PageCommonMethodsConfig = {
|
||||
shareConfig: {
|
||||
title: '涂鸦丫-专注力训练',
|
||||
imageUrl: 'https://cdn.joeyone.cn/doodle/share-img/focus-share.png',
|
||||
imageUrl: 'https://cdn.joeyone.cn/doodle/share-img/share-v3-800.png',
|
||||
},
|
||||
pageInfoLookup: focusPageInfoLookup,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user