diff --git a/app/src/pages/calculator/calculator.vue b/app/src/pages/calculator/calculator.vue
index 6786b41..9517ef0 100644
--- a/app/src/pages/calculator/calculator.vue
+++ b/app/src/pages/calculator/calculator.vue
@@ -1,14 +1,223 @@
-
- 🚧
- 测算器
- 阶段 2 开发中
+
+
+ FIRE 测算
+
+
+
+
+
+ 按当前定投速度,预计再过
+
+
+
+ 已达成!🎉
+
+
+ {{ yearsLeft }} 年 {{ monthsLeft }} 个月
+
+
+ 请调整参数
+
+
+
+ 达到 Barista FIRE
+
+
+ 预计时间:{{ fireDate }}
+
+
+
+
+
+
+
+ FIRE 目标本金
+
+
+ ¥{{ (settings.target / 10000).toFixed(0) }} 万
+
+
+ 按参数计算 {{ (computedTarget / 10000).toFixed(1) }} 万
+
+
+
+
+ 当前净资产
+
+
+ ¥{{ (currentAssets / 10000).toFixed(2) }} 万
+
+
+ {{ progress.netAssets > 0 ? '进度页最新记录' : '使用初始资本' }}
+
+
+
+
+ 每月定投
+
+
+ ¥{{ settings.monthlyInvest.toLocaleString() }}
+
+
+
+
+ 年化收益假设
+
+
+ {{ (settings.annualReturn * 100).toFixed(1) }}%
+
+
+
+
+
+
+
+ Barista FIRE 逻辑
+
+
+
+ 年支出
+ ¥{{ settings.annualExpense.toLocaleString() }}
+
+
+ 兼职年收入
+ − ¥{{ settings.partTimeIncome.toLocaleString() }}
+
+
+
+ 投资需覆盖
+ ¥{{ netAnnualExpense.toLocaleString() }}/年
+
+
+ ÷ 提取率 {{ (settings.withdrawRate * 100).toFixed(1) }}%
+ = ¥{{ (computedTarget / 10000).toFixed(1) }} 万
+
+
+
+
+
+
+
+ 调整参数
+ {{ showParams ? '收起 ▲' : '展开 ▼' }}
+
+
+
+ {{ item.label }}({{ item.unit }})
+ item.setValue(e.detail.value)"
+ />
+
+
+ 修改后自动保存,数据实时更新
+
+
+
diff --git a/app/src/pages/holdings/holdings.vue b/app/src/pages/holdings/holdings.vue
index 15a96ee..0283632 100644
--- a/app/src/pages/holdings/holdings.vue
+++ b/app/src/pages/holdings/holdings.vue
@@ -1,14 +1,221 @@
-
- 🚧
- 持仓跟踪
- 阶段 2 开发中
+
+
+ 持仓
+
+
+
+
+
+ 投资组合总览
+
+
+
+
+ 总市值
+
+
+ ¥{{ store.totalValue.toLocaleString() }}
+
+
+
+
+ 总浮盈
+
+
+ {{ pnlSign(store.totalPnl) }}¥{{ Math.abs(store.totalPnl).toLocaleString() }}
+
+
+
+
+
+ 总成本 ¥{{ store.totalCost.toLocaleString() }}
+
+
+ {{ pnlSign(store.totalPnlPct) }}{{ store.totalPnlPct.toFixed(2) }}%
+
+
+
+
+
+
+
+ 持仓明细
+
+
+
+
+ 📈
+
+
+ 暂无持仓记录
+
+
+ 点击右下角 + 按钮添加持仓
+
+
+
+
+
+ {{ h.name }}
+
+
+ ¥{{ h.currentValue.toLocaleString() }}
+
+
+ {{ pnlSign(h.currentValue - h.costBasis) }}{{ ((h.currentValue - h.costBasis) / h.costBasis * 100).toFixed(2) }}%
+
+
+
+
+ 成本 ¥{{ h.costBasis.toLocaleString() }}
+
+ 编辑
+ 删除
+
+
+
+
+
+
+
+ +
+
+
+
+
+
+
+ {{ editingId ? '编辑持仓' : '添加持仓' }}
+
+
+
+
+ 名称(如:沪深300ETF)
+
+
+
+
+
+ 当前市值(元)
+
+
+
+
+
+ 成本(元)
+
+
+
+
+
+
+ 取消
+
+
+ 保存
+
+
+
+
diff --git a/app/src/pages/progress/progress.vue b/app/src/pages/progress/progress.vue
index 31757e7..afded2a 100644
--- a/app/src/pages/progress/progress.vue
+++ b/app/src/pages/progress/progress.vue
@@ -83,8 +83,19 @@ function saveSnapshot() {
历史记录
-
- 暂无记录,点击下方按钮录入
+
+
+ 📊
+
+
+ 记录你的第一笔净资产
+
+
+ 净资产 = 所有存款 + 投资账户 − 负债
点击右下角 + 按钮录入当前总资产,开始追踪 FIRE 进度。
+
+
+ 建议每月或每季度更新一次
+
{
+ const holdings = ref([])
+
+ const totalValue = computed(() => holdings.value.reduce((s, h) => s + h.currentValue, 0))
+ const totalCost = computed(() => holdings.value.reduce((s, h) => s + h.costBasis, 0))
+ const totalPnl = computed(() => totalValue.value - totalCost.value)
+ const totalPnlPct = computed(() =>
+ totalCost.value > 0 ? (totalPnl.value / totalCost.value) * 100 : 0,
+ )
+
+ function add(name: string, currentValue: number, costBasis: number) {
+ holdings.value.push({
+ id: Date.now().toString(),
+ name,
+ currentValue,
+ costBasis,
+ })
+ }
+
+ function update(id: string, currentValue: number, costBasis: number) {
+ const h = holdings.value.find(h => h.id === id)
+ if (h) {
+ h.currentValue = currentValue
+ h.costBasis = costBasis
+ }
+ }
+
+ function remove(id: string) {
+ holdings.value = holdings.value.filter(h => h.id !== id)
+ }
+
+ return { holdings, totalValue, totalCost, totalPnl, totalPnlPct, add, update, remove }
+}, { persist: true })
diff --git a/app/src/store/settings.ts b/app/src/store/settings.ts
index 4c639fa..735535e 100644
--- a/app/src/store/settings.ts
+++ b/app/src/store/settings.ts
@@ -1,12 +1,13 @@
import { defineStore } from 'pinia'
export const useSettingsStore = defineStore('settings', () => {
- const target = ref(710000) // 目標本金(元)
+ const target = ref(710000) // 目标本金(元)
const withdrawRate = ref(0.035) // 安全提取率 3.5%
const monthlyInvest = ref(1500) // 每月定投(元)
- const partTimeIncome = ref(40000) // 兼職年收入(元)
- const annualExpense = ref(65000) // 年開支(元)
- const initialCapital = ref(70000) // 起始本金(元)
+ const partTimeIncome = ref(40000) // 兼职年收入(元)
+ const annualExpense = ref(65000) // 年支出(元)
+ const initialCapital = ref(70000) // 起始本金(元),无进度记录时的回退值
+ const annualReturn = ref(0.06) // 投资年化收益率 6%
return {
target,
@@ -15,6 +16,7 @@ export const useSettingsStore = defineStore('settings', () => {
partTimeIncome,
annualExpense,
initialCapital,
+ annualReturn,
}
}, {
persist: true,