From 87f5fa2478a36b5fdc9369c90e32090642bce62c Mon Sep 17 00:00:00 2001 From: gouki Date: Mon, 10 Aug 2026 11:52:15 +0000 Subject: [PATCH] =?UTF-8?q?refactor(mini):=20=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E6=94=B9=E4=B8=BA=E7=99=BB=E5=BD=95+=E4=BA=8C?= =?UTF-8?q?=E7=BA=A7=E8=8F=9C=E5=8D=95=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 个人中心仅保留登录管理、我的数据/功能菜单与关于信息 - 新增偏好设置二级页 preferences(原偏好设置统一收敛至此) - 新增我的收藏二级页 bookmarks,支持删除与跳转日详情 - 生辰管理拆分为二级页 birth-profiles,未登录时提示引导登录 - 八字页入口改为直达生辰管理页;修复 fortune 非 tabBar 页误用 switchTab --- mini/app.json | 3 + mini/pages/bazi/bazi.js | 6 +- mini/pages/birth-profiles/birth-profiles.js | 108 +++++++++++ mini/pages/birth-profiles/birth-profiles.json | 4 + mini/pages/birth-profiles/birth-profiles.wxml | 70 +++++++ mini/pages/birth-profiles/birth-profiles.wxss | 56 ++++++ mini/pages/bookmarks/bookmarks.js | 28 +++ mini/pages/bookmarks/bookmarks.json | 4 + mini/pages/bookmarks/bookmarks.wxml | 20 ++ mini/pages/bookmarks/bookmarks.wxss | 24 +++ mini/pages/preferences/preferences.js | 54 ++++++ mini/pages/preferences/preferences.json | 4 + mini/pages/preferences/preferences.wxml | 38 ++++ mini/pages/preferences/preferences.wxss | 32 ++++ mini/pages/settings/settings.js | 176 ++---------------- mini/pages/settings/settings.wxml | 144 +++----------- mini/pages/settings/settings.wxss | 84 ++------- 17 files changed, 508 insertions(+), 347 deletions(-) create mode 100644 mini/pages/birth-profiles/birth-profiles.js create mode 100644 mini/pages/birth-profiles/birth-profiles.json create mode 100644 mini/pages/birth-profiles/birth-profiles.wxml create mode 100644 mini/pages/birth-profiles/birth-profiles.wxss create mode 100644 mini/pages/bookmarks/bookmarks.js create mode 100644 mini/pages/bookmarks/bookmarks.json create mode 100644 mini/pages/bookmarks/bookmarks.wxml create mode 100644 mini/pages/bookmarks/bookmarks.wxss create mode 100644 mini/pages/preferences/preferences.js create mode 100644 mini/pages/preferences/preferences.json create mode 100644 mini/pages/preferences/preferences.wxml create mode 100644 mini/pages/preferences/preferences.wxss diff --git a/mini/app.json b/mini/app.json index 4300bf9..140d592 100644 --- a/mini/app.json +++ b/mini/app.json @@ -8,6 +8,9 @@ "pages/divination/divination", "pages/solar-terms/solar-terms", "pages/settings/settings", + "pages/preferences/preferences", + "pages/bookmarks/bookmarks", + "pages/birth-profiles/birth-profiles", "pages/wish-tree/wish-tree", "pages/wish-detail/wish-detail", "pages/wiki/wiki" diff --git a/mini/pages/bazi/bazi.js b/mini/pages/bazi/bazi.js index f6a76ea..4550d41 100644 --- a/mini/pages/bazi/bazi.js +++ b/mini/pages/bazi/bazi.js @@ -23,7 +23,7 @@ const GLOSSARY = [ { term: '空亡', desc: '六十甲子分为六旬,每旬十个干支配十二地支,余下两个地支无天干相配,称为该旬"空亡"。这是干支纪法本身的结构性概念,此处仅作历法知识展示。' }, { term: '大运', desc: '传统上以月柱为基础、按十年一换的节奏推演出的干支序列,用来描述人生不同阶段的节律。属于传统民俗推演方法,供文化了解。' }, { term: '流年', desc: '即每一年的干支(如 2026 年为丙午年)。传统做法将流年与本命干支对照,观察逐年的变化关系。' }, - { term: '子时流派', desc: '子时(23:00-01:00)横跨两天,晚子时(23:00-24:00)出生者的日柱按当天还是次日起算,历代流派说法不一。可在"我的-偏好设置"中选择。' } + { term: '子时流派', desc: '子时(23:00-01:00)横跨两天,晚子时(23:00-24:00)出生者的日柱按当天还是次日起算,历代流派说法不一。可在"我的-设置"中选择。' } ]; /** 根据出生信息构建排盘展示数据 */ @@ -144,10 +144,10 @@ Page({ }, goSettings() { - wx.switchTab({ url: '/pages/settings/settings' }); + wx.navigateTo({ url: '/pages/birth-profiles/birth-profiles' }); }, goFortune() { - wx.switchTab({ url: '/pages/fortune/fortune' }); + wx.navigateTo({ url: '/pages/fortune/fortune' }); } }); diff --git a/mini/pages/birth-profiles/birth-profiles.js b/mini/pages/birth-profiles/birth-profiles.js new file mode 100644 index 0000000..da78dfe --- /dev/null +++ b/mini/pages/birth-profiles/birth-profiles.js @@ -0,0 +1,108 @@ +const birthProfile = require('../../utils/birth-profile.js'); + +Page({ + data: { + loggedIn: false, + profiles: [], + activeProfileId: '', + maxFree: birthProfile.MAX_PROFILES, + canAdd: true, + showAddForm: false, + formName: '', + formGender: 'male', + formDate: '1990-01-01', + formTime: '12:00' + }, + + onShow() { + this.setData({ loggedIn: birthProfile.isLoggedIn() }); + this.loadProfiles(); + }, + + loadProfiles() { + const render = () => { + const profiles = birthProfile.getProfiles(); + const active = birthProfile.getActiveProfile(); + this.setData({ + profiles, + activeProfileId: active ? active.id : '', + canAdd: profiles.length < this.data.maxFree + }); + }; + // 已登录时先从服务端同步,失败静默回退本地 + if (birthProfile.isLoggedIn()) { + birthProfile.syncFromServer().then(render).catch(render); + } else { + render(); + } + }, + + toggleAddForm() { + if (!this.data.showAddForm && !this.data.canAdd) { + wx.showToast({ title: `最多可免费绑定 ${this.data.maxFree} 个生辰`, icon: 'none' }); + return; + } + this.setData({ showAddForm: !this.data.showAddForm }); + }, + + onFormName(e) { + this.setData({ formName: e.detail.value }); + }, + + setFormGender(e) { + this.setData({ formGender: e.currentTarget.dataset.g }); + }, + + onFormDate(e) { + this.setData({ formDate: e.detail.value }); + }, + + onFormTime(e) { + this.setData({ formTime: e.detail.value }); + }, + + submitProfile() { + const { formName, formGender, formDate, formTime } = this.data; + if (!formDate || !formTime) { + wx.showToast({ title: '请选择出生日期和时间', icon: 'none' }); + return; + } + const result = birthProfile.addProfile({ + name: formName.trim() || '未命名', + gender: formGender, + birthday: formDate, + birthTime: formTime + }); + if (!result.ok) { + wx.showToast({ title: result.msg, icon: 'none' }); + return; + } + // 已登录时推送到服务端(静默失败,不影响本地) + birthProfile.pushProfileToServer(result.profile); + this.setData({ showAddForm: false, formName: '' }); + wx.showToast({ title: '绑定成功', icon: 'success' }); + this.loadProfiles(); + }, + + removeProfile(e) { + const id = e.currentTarget.dataset.id; + const profile = this.data.profiles.find(p => p.id === id); + if (!profile) return; + wx.showModal({ + title: '删除生辰', + content: `确定删除「${profile.name}」的生辰信息吗?`, + success: (res) => { + if (!res.confirm) return; + birthProfile.removeProfile(id); + birthProfile.removeProfileFromServer(profile); + wx.showToast({ title: '已删除', icon: 'success' }); + this.loadProfiles(); + } + }); + }, + + // 未登录时引导回个人中心登录 + goLogin() { + wx.navigateBack(); + } +}); diff --git a/mini/pages/birth-profiles/birth-profiles.json b/mini/pages/birth-profiles/birth-profiles.json new file mode 100644 index 0000000..aff9604 --- /dev/null +++ b/mini/pages/birth-profiles/birth-profiles.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "生辰管理", + "enablePullDownRefresh": false +} diff --git a/mini/pages/birth-profiles/birth-profiles.wxml b/mini/pages/birth-profiles/birth-profiles.wxml new file mode 100644 index 0000000..b0b19df --- /dev/null +++ b/mini/pages/birth-profiles/birth-profiles.wxml @@ -0,0 +1,70 @@ + + + + + + + + 生辰管理 + {{profiles.length}}/{{maxFree}} + + 八字排盘基于生辰信息,每位用户可免费绑定 {{maxFree}} 个出生年月(如本人、家人)。 + + + + + + + {{item.name}} + 使用中 + + {{item.gender === 'female' ? '女' : '男'}} · {{item.birthday}} {{item.birthTime}} + + 删除 + + + + + 暂未绑定生辰,请到下方添加 + + + + {{showAddForm ? '收起' : '+ 添加生辰'}} + + + 免费名额已用完,可删除旧档案后添加 + + + + + + 备注名(如:本人、爸爸) + + + + 性别 + + + + + + + 出生日期(公历) + + {{formDate}} + + + + 出生时间 + + {{formTime}} + + + 保存生辰 + + + diff --git a/mini/pages/birth-profiles/birth-profiles.wxss b/mini/pages/birth-profiles/birth-profiles.wxss new file mode 100644 index 0000000..5c4844b --- /dev/null +++ b/mini/pages/birth-profiles/birth-profiles.wxss @@ -0,0 +1,56 @@ +.container { + padding: 20rpx; +} + +.section-title { + font-size: 28rpx; + font-weight: 600; + margin-bottom: 16rpx; + color: #C41E3A; +} + +.login-tip { + border: 1rpx dashed #C41E3A; +} + +/* 生辰档案 */ +.profile-item { + padding: 16rpx 0; + border-bottom: 1rpx solid #E8D5C4; +} + +.profile-item:last-child { + border-bottom: none; +} + +/* 添加生辰表单 */ +.form-item { + margin-bottom: 24rpx; +} + +.form-label { + font-size: 24rpx; + color: #6B5E53; + margin-bottom: 8rpx; + display: block; +} + +.form-input { + padding: 20rpx; + background: #FFFBF5; + border-radius: 12rpx; + border: 1rpx solid #E8D5C4; +} + +.picker-input { + padding: 20rpx; + background: #FFFBF5; + border-radius: 12rpx; + border: 1rpx solid #E8D5C4; +} + +.btn-outline.active { + background: #C41E3A; + color: #FFFFFF; + border-color: #C41E3A; +} diff --git a/mini/pages/bookmarks/bookmarks.js b/mini/pages/bookmarks/bookmarks.js new file mode 100644 index 0000000..0fb6116 --- /dev/null +++ b/mini/pages/bookmarks/bookmarks.js @@ -0,0 +1,28 @@ +Page({ + data: { + bookmarks: [] + }, + + onShow() { + this.loadBookmarks(); + }, + + loadBookmarks() { + const bookmarks = wx.getStorageSync('lunar-bookmarks') || []; + this.setData({ bookmarks }); + }, + + removeBookmark(e) { + const date = e.currentTarget.dataset.date; + const bookmarks = this.data.bookmarks.filter(b => b.date !== date); + wx.setStorageSync('lunar-bookmarks', bookmarks); + this.setData({ bookmarks }); + wx.showToast({ title: '已删除', icon: 'success' }); + }, + + // 点击收藏项跳转到当日详情 + openDetail(e) { + const date = e.currentTarget.dataset.date; + wx.navigateTo({ url: `/pages/day-detail/day-detail?date=${date}` }); + } +}); diff --git a/mini/pages/bookmarks/bookmarks.json b/mini/pages/bookmarks/bookmarks.json new file mode 100644 index 0000000..669231e --- /dev/null +++ b/mini/pages/bookmarks/bookmarks.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "我的收藏", + "enablePullDownRefresh": false +} diff --git a/mini/pages/bookmarks/bookmarks.wxml b/mini/pages/bookmarks/bookmarks.wxml new file mode 100644 index 0000000..7a2db9f --- /dev/null +++ b/mini/pages/bookmarks/bookmarks.wxml @@ -0,0 +1,20 @@ + + + 我的收藏 + + + + + {{item.date}} + {{item.lunarDate}} + + 删除 + + + + + 暂无收藏 + 在日期详情页点击「收藏」即可添加 + + + diff --git a/mini/pages/bookmarks/bookmarks.wxss b/mini/pages/bookmarks/bookmarks.wxss new file mode 100644 index 0000000..e71a545 --- /dev/null +++ b/mini/pages/bookmarks/bookmarks.wxss @@ -0,0 +1,24 @@ +.container { + padding: 20rpx; +} + +.section-title { + font-size: 28rpx; + font-weight: 600; + margin-bottom: 16rpx; + color: #C41E3A; +} + +.bookmark-item { + padding: 16rpx 0; + border-bottom: 1rpx solid #E8D5C4; +} + +.bookmark-item:last-child { + border-bottom: none; +} + +.empty-tip { + text-align: center; + padding: 40rpx 0; +} diff --git a/mini/pages/preferences/preferences.js b/mini/pages/preferences/preferences.js new file mode 100644 index 0000000..7bdc212 --- /dev/null +++ b/mini/pages/preferences/preferences.js @@ -0,0 +1,54 @@ +Page({ + data: { + weekStartDay: 0, + ziHourSect: 'lateZiNextDay', + solarTime: true, + showBuddhist: false, + highlightLunar: true + }, + + onShow() { + this.loadSettings(); + }, + + loadSettings() { + const settings = wx.getStorageSync('lunar-settings') || {}; + this.setData({ + weekStartDay: settings.weekStartDay || 0, + ziHourSect: settings.ziHourSect || 'lateZiNextDay', + solarTime: settings.solarTime !== false, + showBuddhist: settings.showBuddhist === true, + highlightLunar: settings.highlightLunar !== false + }); + }, + + saveSettings() { + const { weekStartDay, ziHourSect, solarTime, showBuddhist, highlightLunar } = this.data; + wx.setStorageSync('lunar-settings', { weekStartDay, ziHourSect, solarTime, showBuddhist, highlightLunar }); + }, + + setWeekStart(e) { + this.setData({ weekStartDay: Number(e.currentTarget.dataset.v) }); + this.saveSettings(); + }, + + setZiSect(e) { + this.setData({ ziHourSect: e.currentTarget.dataset.v }); + this.saveSettings(); + }, + + onSolarTimeChange(e) { + this.setData({ solarTime: e.detail.value }); + this.saveSettings(); + }, + + onBuddhistChange(e) { + this.setData({ showBuddhist: e.detail.value }); + this.saveSettings(); + }, + + onHighlightLunarChange(e) { + this.setData({ highlightLunar: e.detail.value }); + this.saveSettings(); + } +}); diff --git a/mini/pages/preferences/preferences.json b/mini/pages/preferences/preferences.json new file mode 100644 index 0000000..3682845 --- /dev/null +++ b/mini/pages/preferences/preferences.json @@ -0,0 +1,4 @@ +{ + "navigationBarTitleText": "偏好设置", + "enablePullDownRefresh": false +} diff --git a/mini/pages/preferences/preferences.wxml b/mini/pages/preferences/preferences.wxml new file mode 100644 index 0000000..e31b320 --- /dev/null +++ b/mini/pages/preferences/preferences.wxml @@ -0,0 +1,38 @@ + + + 偏好设置 + + + 周起始日 + + 周日 + 周一 + + + + + 子时流派 + + 晚子时算次日 + 晚子时算当日 + + + + + 真太阳时校正 + + + + + 显示佛历提醒 + + + + + 初一十五高亮 + + + + + 设置仅保存在本机,修改后立即生效 + diff --git a/mini/pages/preferences/preferences.wxss b/mini/pages/preferences/preferences.wxss new file mode 100644 index 0000000..c760cc5 --- /dev/null +++ b/mini/pages/preferences/preferences.wxss @@ -0,0 +1,32 @@ +.container { + padding: 20rpx; +} + +.section-title { + font-size: 28rpx; + font-weight: 600; + margin-bottom: 16rpx; + color: #C41E3A; +} + +.setting-item { + display: flex; + justify-content: space-between; + align-items: center; + padding: 20rpx 0; + border-bottom: 1rpx solid #E8D5C4; +} + +.setting-item:last-child { + border-bottom: none; +} + +.setting-label { + font-size: 28rpx; +} + +.btn-outline.active { + background: #C41E3A; + color: #FFFFFF; + border-color: #C41E3A; +} diff --git a/mini/pages/settings/settings.js b/mini/pages/settings/settings.js index 23be23a..34ccc94 100644 --- a/mini/pages/settings/settings.js +++ b/mini/pages/settings/settings.js @@ -7,140 +7,33 @@ Page({ userInfo: null, loggedIn: false, logging: false, - weekStartDay: 0, - ziHourSect: 'lateZiNextDay', - solarTime: true, - showBuddhist: false, - highlightLunar: true, - bookmarks: [], - // 生辰档案 - profiles: [], - activeProfileId: '', + // 菜单角标 + profileCount: 0, maxFree: birthProfile.MAX_PROFILES, - canAdd: true, - showAddForm: false, - formName: '', - formGender: 'male', - formDate: '1990-01-01', - formTime: '12:00', + bookmarkCount: 0, version: versionInfo.version, buildNumber: versionInfo.buildNumber, buildTime: versionInfo.buildTime, commitSha: versionInfo.commitSha }, - onLoad() { - this.loadSettings(); - this.loadBookmarks(); - }, - onShow() { - this.loadBookmarks(); - this.loadProfiles(); + this.refreshUser(); + this.refreshCounts(); }, - loadSettings() { - const settings = wx.getStorageSync('lunar-settings') || {}; - this.setData({ - weekStartDay: settings.weekStartDay || 0, - ziHourSect: settings.ziHourSect || 'lateZiNextDay', - solarTime: settings.solarTime !== false, - showBuddhist: settings.showBuddhist === true, - highlightLunar: settings.highlightLunar !== false - }); + refreshUser() { + const token = wx.getStorageSync('token'); + const userInfo = wx.getStorageSync('lunar-user-info'); + this.setData({ loggedIn: !!token, userInfo: userInfo || null }); }, - saveSettings() { - const { weekStartDay, ziHourSect, solarTime, showBuddhist, highlightLunar } = this.data; - wx.setStorageSync('lunar-settings', { weekStartDay, ziHourSect, solarTime, showBuddhist, highlightLunar }); - }, - - loadBookmarks() { + refreshCounts() { const bookmarks = wx.getStorageSync('lunar-bookmarks') || []; - this.setData({ bookmarks }); - }, - - // ==================== 生辰档案 ==================== - - loadProfiles() { - const render = () => { - const profiles = birthProfile.getProfiles(); - const active = birthProfile.getActiveProfile(); - this.setData({ - profiles, - activeProfileId: active ? active.id : '', - canAdd: profiles.length < this.data.maxFree - }); - }; - // 已登录时先从服务端同步,失败静默回退本地 - if (birthProfile.isLoggedIn()) { - birthProfile.syncFromServer().then(render).catch(render); - } else { - render(); - } - }, - - toggleAddForm() { - if (!this.data.showAddForm && !this.data.canAdd) { - wx.showToast({ title: `最多可免费绑定 ${this.data.maxFree} 个生辰`, icon: 'none' }); - return; - } - this.setData({ showAddForm: !this.data.showAddForm }); - }, - - onFormName(e) { - this.setData({ formName: e.detail.value }); - }, - - setFormGender(e) { - this.setData({ formGender: e.currentTarget.dataset.g }); - }, - - onFormDate(e) { - this.setData({ formDate: e.detail.value }); - }, - - onFormTime(e) { - this.setData({ formTime: e.detail.value }); - }, - - submitProfile() { - const { formName, formGender, formDate, formTime } = this.data; - if (!formDate || !formTime) { - wx.showToast({ title: '请选择出生日期和时间', icon: 'none' }); - return; - } - const result = birthProfile.addProfile({ - name: formName.trim() || '未命名', - gender: formGender, - birthday: formDate, - birthTime: formTime - }); - if (!result.ok) { - wx.showToast({ title: result.msg, icon: 'none' }); - return; - } - // 已登录时推送到服务端(静默失败,不影响本地) - birthProfile.pushProfileToServer(result.profile); - this.setData({ showAddForm: false, formName: '' }); - wx.showToast({ title: '绑定成功', icon: 'success' }); - this.loadProfiles(); - }, - - removeProfile(e) { - const id = e.currentTarget.dataset.id; - const profile = this.data.profiles.find(p => p.id === id); - if (!profile) return; - wx.showModal({ - title: '删除生辰', - content: `确定删除「${profile.name}」的生辰信息吗?`, - success: (res) => { - if (!res.confirm) return; - birthProfile.removeProfile(id); - birthProfile.removeProfileFromServer(profile); - wx.showToast({ title: '已删除', icon: 'success' }); - this.loadProfiles(); - } + const profiles = birthProfile.getProfiles(); + this.setData({ + bookmarkCount: bookmarks.length, + profileCount: profiles.length }); }, @@ -166,8 +59,8 @@ Page({ wx.setStorageSync('lunar-user-info', res.data.user); this.setData({ userInfo: res.data.user, loggedIn: true, logging: false }); wx.showToast({ title: '登录成功', icon: 'success' }); - // 登录后同步服务端生辰档案 - this.loadProfiles(); + // 登录后拉取云端生辰档案,保证菜单计数准确 + birthProfile.syncFromServer().then(() => this.refreshCounts()).catch(() => {}); } else { this.setData({ logging: false }); wx.showToast({ title: (res && res.msg) || '登录失败', icon: 'none' }); @@ -198,45 +91,10 @@ Page({ }); }, - // ==================== 偏好设置 ==================== - - setWeekStart(e) { - this.setData({ weekStartDay: Number(e.currentTarget.dataset.v) }); - this.saveSettings(); - }, - - setZiSect(e) { - this.setData({ ziHourSect: e.currentTarget.dataset.v }); - this.saveSettings(); - }, - - onSolarTimeChange(e) { - this.setData({ solarTime: e.detail.value }); - this.saveSettings(); - }, - - onBuddhistChange(e) { - this.setData({ showBuddhist: e.detail.value }); - this.saveSettings(); - }, - - onHighlightLunarChange(e) { - this.setData({ highlightLunar: e.detail.value }); - this.saveSettings(); - }, - - removeBookmark(e) { - const date = e.currentTarget.dataset.date; - let bookmarks = this.data.bookmarks.filter(b => b.date !== date); - wx.setStorageSync('lunar-bookmarks', bookmarks); - this.setData({ bookmarks }); - wx.showToast({ title: '已删除', icon: 'success' }); - }, - navTo(e) { const url = e.currentTarget.dataset.url; // tabBar 页面必须用 switchTab 打开 - const tabPages = ['/pages/home/home', '/pages/wish-tree/wish-tree', '/pages/bazi/bazi', '/pages/wiki/wiki', '/pages/settings/settings', '/pages/fortune/fortune']; + const tabPages = ['/pages/home/home', '/pages/wish-tree/wish-tree', '/pages/bazi/bazi', '/pages/wiki/wiki', '/pages/settings/settings']; if (tabPages.includes(url)) { wx.switchTab({ url }); } else { diff --git a/mini/pages/settings/settings.wxml b/mini/pages/settings/settings.wxml index 1ccc79b..ef0793e 100644 --- a/mini/pages/settings/settings.wxml +++ b/mini/pages/settings/settings.wxml @@ -1,8 +1,7 @@ - + - 用户信息 - + @@ -10,135 +9,50 @@ {{userInfo.nickname || '微信用户'}} - 已登录,档案云端同步 + 已登录,生辰档案云端同步 退出 - 登录后可将生辰档案同步到云端,换设备不丢失 + + + + + + 未登录 + 绑定的生辰仅保存在本机,登录后才生效 + + {{logging ? '登录中…' : '微信登录'}} + 登录后可将生辰档案同步到云端,换设备不丢失 - + - - 生辰管理 - {{profiles.length}}/{{maxFree}} - - 八字排盘基于生辰信息,每位用户可免费绑定 {{maxFree}} 个出生年月(如本人、家人)。 - - - - - - - {{item.name}} - 使用中 - - {{item.gender === 'female' ? '女' : '男'}} · {{item.birthday}} {{item.birthTime}} - - 删除 - + 我的数据 + + 生辰管理 + + {{profileCount}}/{{maxFree}} + - - 暂未绑定生辰,请到下方添加 - - - - {{showAddForm ? '收起' : '+ 添加生辰'}} - - - 免费名额已用完,可删除旧档案后添加 - - - - - - 备注名(如:本人、爸爸) - - - - 性别 - - - - - - - 出生日期(公历) - - {{formDate}} - - - - 出生时间 - - {{formTime}} - - - 保存生辰 - - - - - - 偏好设置 - - - 周起始日 - - 周日 - 周一 + + 我的收藏 + + {{bookmarkCount}} + - - - 子时流派 - - 晚子时算次日 - 晚子时算当日 - - - - - 真太阳时校正 - - - - - 显示佛历提醒 - - - - - 初一十五高亮 - + + 设置 + - - - 我的收藏 - - - - - {{item.date}} - {{item.lunarDate}} - - 删除 - - - - - 暂无收藏 - - - - + 功能 diff --git a/mini/pages/settings/settings.wxss b/mini/pages/settings/settings.wxss index 1daa7aa..bd7d6cc 100644 --- a/mini/pages/settings/settings.wxss +++ b/mini/pages/settings/settings.wxss @@ -10,8 +10,8 @@ } .avatar { - width: 80rpx; - height: 80rpx; + width: 96rpx; + height: 96rpx; border-radius: 50%; } @@ -21,74 +21,7 @@ justify-content: center; background: #C41E3A; color: #FFFFFF; - font-size: 36rpx; -} - -/* 生辰档案 */ -.profile-item { - padding: 16rpx 0; - border-bottom: 1rpx solid #E8D5C4; -} - -.profile-item:last-child { - border-bottom: none; -} - -/* 添加生辰表单 */ -.form-item { - margin-bottom: 24rpx; -} - -.form-label { - font-size: 24rpx; - color: #6B5E53; - margin-bottom: 8rpx; - display: block; -} - -.form-input { - padding: 20rpx; - background: #FFFBF5; - border-radius: 12rpx; - border: 1rpx solid #E8D5C4; -} - -.picker-input { - padding: 20rpx; - background: #FFFBF5; - border-radius: 12rpx; - border: 1rpx solid #E8D5C4; -} - -.setting-item { - display: flex; - justify-content: space-between; - align-items: center; - padding: 20rpx 0; - border-bottom: 1rpx solid #E8D5C4; -} - -.setting-item:last-child { - border-bottom: none; -} - -.setting-label { - font-size: 28rpx; -} - -.btn-outline.active { - background: #C41E3A; - color: #FFFFFF; - border-color: #C41E3A; -} - -.bookmark-item { - padding: 16rpx 0; - border-bottom: 1rpx solid #E8D5C4; -} - -.bookmark-item:last-child { - border-bottom: none; + font-size: 40rpx; } .menu-item { @@ -107,6 +40,17 @@ font-size: 28rpx; } +.menu-right { + display: flex; + align-items: center; + gap: 8rpx; +} + +.menu-count { + font-size: 24rpx; + color: #9E8E7E; +} + .menu-arrow { color: #C9B8A6; font-size: 36rpx;