Skip to content

Commit 708c211

Browse files
committed
feat: add share feature to the homepage and topic detail page
1 parent 2c72470 commit 708c211

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/pages/index/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,12 @@ Page({
5555
// 追加主题列表数据
5656
this.fnNetRTopicList(1);
5757
},
58+
onShareAppMessage() {
59+
return {
60+
title: 'CNode 社区第三方版',
61+
path: '/pages/index/index'
62+
};
63+
},
5864
// 切换tab选项卡
5965
fnTapSwitchTab(e) {
6066
let oDataSet = e.currentTarget.dataset;

src/pages/topic/topic.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Page({
2424
this.fnFetchTopicDetail(this.data.sTopicId);
2525
},
2626
onReachBottom() {},
27+
onShareAppMessage() {
28+
return {
29+
title: this.data.oTopicDetail.title,
30+
path: `/pages/topic/topic?id=${this.data.sTopicId}`
31+
};
32+
},
2733
// 切换主题收藏状态
2834
fnTapSwitchTopicCollectStatus() {
2935
// 先检查用户登录状态

0 commit comments

Comments
 (0)