From 04a99df434763efe10eae8edb18b7ef00d74e3b5 Mon Sep 17 00:00:00 2001 From: Blizzard Date: Tue, 4 Aug 2026 10:14:15 +0800 Subject: [PATCH] =?UTF-8?q?feat(fe):=20=E9=9A=90=E7=A7=81=E6=94=BF?= =?UTF-8?q?=E7=AD=96=E6=94=B9=E4=B8=BA=E6=89=93=E5=BC=80=E5=BE=AE=E4=BF=A1?= =?UTF-8?q?=E5=90=8E=E5=8F=B0=E9=85=8D=E7=BD=AE=E7=9A=84=E3=80=8A=E7=94=A8?= =?UTF-8?q?=E6=88=B7=E9=9A=90=E7=A7=81=E4=BF=9D=E6=8A=A4=E6=8C=87=E5=BC=95?= =?UTF-8?q?=E3=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit settings 隐私政策入口改调 wx.openPrivacyContract;旧基础库或未配置时兜底 回内置 agreement 页。用户协议仍走内置页面。 Co-Authored-By: Claude Opus 5 --- pets-fe/pages/settings/settings.js | 13 ++++++++++++- pets-fe/pages/settings/settings.wxml | 2 +- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/pets-fe/pages/settings/settings.js b/pets-fe/pages/settings/settings.js index cd46f9d..0c207aa 100644 --- a/pets-fe/pages/settings/settings.js +++ b/pets-fe/pages/settings/settings.js @@ -40,10 +40,21 @@ Page({ openSheet(e) { this.setData({ sheetType: e.currentTarget.dataset.type, sheetShow: true }); }, - // 用户协议 / 隐私政策 + // 用户协议:走我们自己的页面 goAgreement(e) { wx.navigateTo({ url: '/pages/agreement/agreement?type=' + e.currentTarget.dataset.type }); }, + // 隐私政策:直接打开微信公众平台后台配置的《用户隐私保护指引》。 + // 旧基础库没有该接口时,兜底用内置页面 + openPrivacy() { + if (wx.openPrivacyContract) { + wx.openPrivacyContract({ + fail: () => wx.navigateTo({ url: '/pages/agreement/agreement?type=privacy' }), + }); + } else { + wx.navigateTo({ url: '/pages/agreement/agreement?type=privacy' }); + } + }, // 自己的关注/粉丝。之前只有帖子上的「+关注」按钮,关注完没有任何地方能看 goRelations(e) { const uid = (this.data.user && this.data.user.id) || ''; diff --git a/pets-fe/pages/settings/settings.wxml b/pets-fe/pages/settings/settings.wxml index 0d3292f..5a44311 100644 --- a/pets-fe/pages/settings/settings.wxml +++ b/pets-fe/pages/settings/settings.wxml @@ -15,7 +15,7 @@ 用户协议 - 隐私政策 + 隐私政策