From e71274142533a9ed5fa3c8cd9eeaa72ab022b4dc Mon Sep 17 00:00:00 2001 From: liucheng Date: Sat, 25 Jul 2026 11:03:02 +0800 Subject: [PATCH] =?UTF-8?q?feat(share):=20=E5=90=AF=E7=94=A8=E5=85=A8?= =?UTF-8?q?=E7=AB=99=E7=B3=BB=E7=BB=9F=E5=88=86=E4=BA=AB=20+=20=E5=AE=8C?= =?UTF-8?q?=E5=96=84=E5=88=86=E4=BA=AB=E6=96=87=E6=A1=88=E9=85=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 各 Page 补齐 onShareAppMessage/onShareTimeline,修复右上角转发/朋友圈按钮灰色 - ui-btn 透传 open-type,完成弹窗接入分享按钮 - config.share 集中维护文案,动态标题用 titleTemplate 占位符 - leaderboard 的 myEntry.rank 缺失时回退静态标题,避免出现"排第 undefined" - 完成弹窗分享按钮高度对齐 88rpx,与同排按钮等高 Co-Authored-By: Claude --- components/ui-btn/ui-btn.js | 8 ++++- components/ui-btn/ui-btn.wxml | 1 + config.js | 52 +++++++++++++++++++++++++++++++- pages/index/index.js | 25 +++++++++++++++ pages/leaderboard/leaderboard.js | 27 +++++++++++++++++ pages/records/records.js | 24 +++++++++++++++ pages/settings/settings.js | 21 +++++++++++++ pages/timer/timer.js | 25 ++++++++++++++- pages/timer/timer.wxml | 10 ++++++ 9 files changed, 190 insertions(+), 3 deletions(-) diff --git a/components/ui-btn/ui-btn.js b/components/ui-btn/ui-btn.js index c37580c..1ee0673 100644 --- a/components/ui-btn/ui-btn.js +++ b/components/ui-btn/ui-btn.js @@ -6,7 +6,13 @@ Component({ block: { type: Boolean, value: false }, disabled: { type: Boolean, value: false }, iconSrc: { type: String, value: '' }, - customStyle: { type: String, value: '' } + customStyle: { type: String, value: '' }, + // 透传微信原生 button 的 open-type: + // share — 触发 Page.onShareAppMessage(分享给朋友) + // contact / feedback / shareToPhone … 等 + // 设置后会在底层 button 上挂 open-type="{{openType}}",配合 Page 的 + // onShareAppMessage 即可让自定义按钮真正调起原生分享面板。 + openType: { type: String, value: '' } }, methods: { onTap() { diff --git a/components/ui-btn/ui-btn.wxml b/components/ui-btn/ui-btn.wxml index d15d430..f8c3950 100644 --- a/components/ui-btn/ui-btn.wxml +++ b/components/ui-btn/ui-btn.wxml @@ -3,6 +3,7 @@ style="{{customStyle}}" bindtap="onTap" disabled="{{disabled}}" + open-type="{{openType}}" hover-class="none" > ` / `