v68:财务补齐(改一笔/删一笔/账本改名/共享给谁)
用户 2026-10-20:「还有这个财务的显示也有问题」——v65 修的是**显示口径**
(端上按正负号重加 vs 服务端负债取绝对值);这一批补的是**动作**:
设置里「共享给谁」「账本名字」一直是灰条,账目也改不了删不掉。
## 根因:不是端上没写,是服务端没有路由
`Ledger::rename / setShare / unshare / shares / updateEntry / removeEntry`
**一直都有**,`ApiHandler::ledger()` 却只开了「建账本 / 记一笔 / 删账本」
⇒ 端上只能把这两条画成"暂未开放"。
## 端上做了什么
- 点一行账目 → 同一个浮层进**编辑态**(类别 / 金额 / 名称 / 备注 +
删除二次确认)。`aboutToAppear` 里把 @Param 拷进 @Local,
点第二行才不会还是上一笔的内容。
- 设置「账本名字」→ 改名浮层;「共享给谁」→ 共享浮层(列表 + 选人 +
逐个人取消)。列表解析走 `{items:[…]}`(`FbApiResult.data` 是原始 JSON)。
- 三个浮层共用 `recountSheets()` 让悬浮栏让位(原来只有"记一笔"有)。
## 顺手修的两处「对着服务端抄错」
1. `FbLedgerBook.myPerm` 的注释写 `owner / read / write`,
而服务端**从来不给 `owner`**(主人也是 `write`)⇒ 端上"是不是我建的"永远 false。
现在用服务端新补的 `isOwner` 布尔。
2. `FbLedgerEntry` 没有 `note` 字段 ⇒ 编辑时备注框永远是空的。补上类型与解析。
## 顺带
- 撤掉名册家谱那颗「补关系」按钮:从来没有 `onTap`,服务端 `relations`
只有读接口、网页版也没这个功能 ⇒ 留个永远点不动的按钮只会被当成"坏了"。
## 验证
- `hvigorw assembleHap` → BUILD SUCCESSFUL
- `_fb_arkts_guard.js` → 827 / 0(新增 groupV68 29 条)
- `_fb_v59d_falsify.py` → 139 / 0(v68 新增 9 条注入全部变红)
- ⚠️ 设备仍断连(`hdc list targets` → `[Empty]`),真机未验收
This commit is contained in:
@@ -246,21 +246,21 @@ export const FB_DEMO_TASK_BOARDS: string[] = ['家务', '家人健康', '孩子'
|
||||
// ============================================================
|
||||
|
||||
export const FB_DEMO_LEDGER_BOOKS: FbLedgerBook[] = [
|
||||
{ id: 1, name: '家庭总账', netCent: 86420000, myPerm: 'owner', entryCount: 9 },
|
||||
{ id: 2, name: '我的私房账', netCent: 1260000, myPerm: 'owner', entryCount: 3 },
|
||||
{ id: 3, name: '爸妈的养老账', netCent: 4580000, myPerm: 'write', entryCount: 5 }
|
||||
{ id: 1, name: '家庭总账', netCent: 86420000, myPerm: 'write', isOwner: true, entryCount: 9 },
|
||||
{ id: 2, name: '我的私房账', netCent: 1260000, myPerm: 'write', isOwner: true, entryCount: 3 },
|
||||
{ id: 3, name: '爸妈的养老账', netCent: 4580000, myPerm: 'write', isOwner: false, entryCount: 5 }
|
||||
];
|
||||
|
||||
export const FB_DEMO_LEDGER_ENTRIES: FbLedgerEntry[] = [
|
||||
{ id: 1, name: '工资卡', kind: 'deposit', amountCent: 18600000, ownerName: '我', updatedAt: '2026-10-01' },
|
||||
{ id: 2, name: '公积金', kind: 'deposit', amountCent: 24300000, ownerName: '我', updatedAt: '2026-10-01' },
|
||||
{ id: 3, name: '指数基金', kind: 'fund', amountCent: 34800000, ownerName: '我', updatedAt: '2026-09-30' },
|
||||
{ id: 4, name: '重疾险', kind: 'insurance', amountCent: 500000, ownerName: '爱人', updatedAt: '2026-08-12' },
|
||||
{ id: 5, name: '自住房', kind: 'house', amountCent: 180000000, ownerName: '我们', updatedAt: '2026-06-20' },
|
||||
{ id: 6, name: '代步车', kind: 'car', amountCent: 8200000, ownerName: '我', updatedAt: '2026-06-20' },
|
||||
{ id: 7, name: '房贷余额', kind: 'debt', amountCent: -142600000, ownerName: '我们', updatedAt: '2026-10-01' },
|
||||
{ id: 8, name: '信用卡待还', kind: 'debt', amountCent: -3860000, ownerName: '爱人', updatedAt: '2026-10-08' },
|
||||
{ id: 9, name: '车位', kind: 'house', amountCent: 12000000, ownerName: '我们', updatedAt: '2026-06-20' }
|
||||
{ id: 1, name: '工资卡', kind: 'deposit', amountCent: 18600000, note: '', ownerName: '我', updatedAt: '2026-10-01' },
|
||||
{ id: 2, name: '公积金', kind: 'deposit', amountCent: 24300000, note: '', ownerName: '我', updatedAt: '2026-10-01' },
|
||||
{ id: 3, name: '指数基金', kind: 'fund', amountCent: 34800000, note: '', ownerName: '我', updatedAt: '2026-09-30' },
|
||||
{ id: 4, name: '重疾险', kind: 'insurance', amountCent: 500000, note: '', ownerName: '爱人', updatedAt: '2026-08-12' },
|
||||
{ id: 5, name: '自住房', kind: 'house', amountCent: 180000000, note: '', ownerName: '我们', updatedAt: '2026-06-20' },
|
||||
{ id: 6, name: '代步车', kind: 'car', amountCent: 8200000, note: '', ownerName: '我', updatedAt: '2026-06-20' },
|
||||
{ id: 7, name: '房贷余额', kind: 'debt', amountCent: -142600000, note: '', ownerName: '我们', updatedAt: '2026-10-01' },
|
||||
{ id: 8, name: '信用卡待还', kind: 'debt', amountCent: -3860000, note: '', ownerName: '爱人', updatedAt: '2026-10-08' },
|
||||
{ id: 9, name: '车位', kind: 'house', amountCent: 12000000, note: '', ownerName: '我们', updatedAt: '2026-06-20' }
|
||||
];
|
||||
|
||||
// ============================================================
|
||||
|
||||
@@ -61,8 +61,8 @@ export const FB_SET_DAYS: FbSettingItem[] = [
|
||||
|
||||
/** 账本(templates/ledger/_settings_menu.php) */
|
||||
export const FB_SET_LEDGER: FbSettingItem[] = [
|
||||
{ icon: 'share', label: '共享给谁', hint: '对方就能记能看', action: '' },
|
||||
{ icon: 'edit', label: '账本名字', hint: '改这本账本的名字', action: '' }
|
||||
{ icon: 'share', label: '共享给谁', hint: '对方就能看这本账', action: 'ledgershare' },
|
||||
{ icon: 'edit', label: '账本名字', hint: '改这本账本的名字', action: 'ledgername' }
|
||||
];
|
||||
|
||||
/** 任务(templates/tasks/_settings_menu.php)
|
||||
|
||||
@@ -686,8 +686,16 @@ export interface FbLedgerBook {
|
||||
name: string;
|
||||
/** 净资产(分) */
|
||||
netCent: number;
|
||||
/** 我的权限:owner / read / write */
|
||||
/**
|
||||
* 我的权限:**只有 `read` / `write` 两档**(服务端 `Ledger::find` 就是这么给的)。
|
||||
*
|
||||
* 🔴 v68:这里原来写的是 `owner / read / write` —— 服务端**从来不会**给 `owner`,
|
||||
* 于是端上"是不是我建的账本"永远判成 false(共享浮层会一直说"只有主人能改")。
|
||||
* 现在用服务端补的 `isOwner` 布尔。
|
||||
*/
|
||||
myPerm: string;
|
||||
/** 这本账是不是我建的(只有主人能改共享关系) */
|
||||
isOwner: boolean;
|
||||
/** 账目条数 */
|
||||
entryCount: number;
|
||||
}
|
||||
@@ -703,6 +711,8 @@ export interface FbLedgerEntry {
|
||||
amountCent: number;
|
||||
/** 挂名的人 */
|
||||
ownerName: string;
|
||||
/** 备注(v68:改一笔时要回填,原来类型里没有 ⇒ 编辑框永远是空的) */
|
||||
note: string;
|
||||
/** 记录/盘点时间 */
|
||||
updatedAt: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user