feat(share): 启用全站系统分享 + 完善分享文案配置
- 各 Page 补齐 onShareAppMessage/onShareTimeline,修复右上角转发/朋友圈按钮灰色 - ui-btn 透传 open-type,完成弹窗接入分享按钮 - config.share 集中维护文案,动态标题用 titleTemplate 占位符 - leaderboard 的 myEntry.rank 缺失时回退静态标题,避免出现"排第 undefined" - 完成弹窗分享按钮高度对齐 88rpx,与同排按钮等高 Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
+24
-1
@@ -470,5 +470,28 @@ Page({
|
||||
// No-op handler for catchtouchmove. Swallows move events that would
|
||||
// otherwise bubble to underlying timer page controls (causing missed
|
||||
// taps on the completion modal).
|
||||
onNoop() { /* swallow */ }
|
||||
onNoop() { /* swallow */ },
|
||||
|
||||
/**
|
||||
* 分享给朋友。训练完成弹窗里的分享按钮会走到这里,标题里拼上用户
|
||||
* 刚才撑了多久,转化率更高;右上角"···"菜单也共用同一份文案。
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
const elapsed = this.data.completionElapsed || this.data.duration
|
||||
const s = config.share.timer
|
||||
return {
|
||||
title: s.titleTemplate.replace('{elapsed}', elapsed),
|
||||
path: s.path
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* 分享到朋友圈,同样带上刚完成的时长晒成绩。
|
||||
*/
|
||||
onShareTimeline() {
|
||||
const elapsed = this.data.completionElapsed || this.data.duration
|
||||
return {
|
||||
title: config.share.timer.timelineTitleTemplate.replace('{elapsed}', elapsed)
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user