diff --git a/client/harmony/entry/src/main/ets/pages/SettingsPage.ets b/client/harmony/entry/src/main/ets/pages/SettingsPage.ets index 81bdd18..c110000 100644 --- a/client/harmony/entry/src/main/ets/pages/SettingsPage.ets +++ b/client/harmony/entry/src/main/ets/pages/SettingsPage.ets @@ -636,10 +636,11 @@ export struct SettingsPane { /* 基本资料 / 权限范围(对齐 WebUI 的前两个 section) */ this.ProfileSection() - /* - * ── 多账号(对齐 WebUI 的 AccountList section)── - */ - Column() { + /* 修改密码 */ + this.PasswordSection() + + /* 多账号(对齐 WebUI 的 AccountList section) */ + Column() { Text('多账号').fontSize(14).fontWeight(FontWeight.Bold).fontColor(Theme.textPrimary) .width('100%') if (this.accounts.length === 0) { @@ -676,17 +677,23 @@ export struct SettingsPane { .attributeModifier(GlassCardModifier.of(this.bgActive)) .borderRadius(Theme.radiusCard) - /* 外观(主题 / 壁纸) */ - this.AppearanceSection() - - /* 系统通知 */ - this.PushSection() - /* 客户端连接密钥(对齐 WebUI 的 KeyPanel section) */ this.KeySection() - /* 修改密码 + 退出登录(对齐 WebUI 的「修改密码」与「登录状态」两段) */ - this.SecuritySection() + /* 外观(主题 / 壁纸) */ + this.AppearanceSection() + + /* + * 系统通知 —— **鸿蒙独有**(WebUI 侧没有这一段的对应物)。 + * + * 理由:推送是**平台能力**(HarmonyOS Push Kit / 通知直达), + * WebUI 跑在浏览器里、没有等价物。这不是分叉,是平台差异。 + * 位置放在外观之后、登录状态之前 —— 与"账号自身"那几段分开。 + */ + this.PushSection() + + /* 登录状态(退出登录) */ + this.LoginSection() /* 管理入口(仅管理员) */ this.AdminSection() @@ -1110,8 +1117,15 @@ export struct SettingsPane { * 这里合并为一片连续区域,因为两者都是「账号自身」且都是低频动作 —— * 但**内容与顺序**与 WebUI 一致:先密码、后退出。 */ + /** + * 修改密码(对齐 WebUI `AccountPage` 的「修改密码」section)。 + * + * ★ 2026-09-21 从 `SecuritySection` 拆出来 —— WebUI 那边「修改密码」与 + * 「登录状态」是**两个独立的
**,中间还夹着多账号/密钥/外观。 + * 我们原来把两者焊成一个,于是顺序上就没法对齐了(这是顺序错位的根因)。 + */ @Builder - SecuritySection() { + PasswordSection() { Column() { Row() { AmIcon({ iconName: 'lock', iconSize: 16, iconColor: Theme.textMuted }) @@ -1156,15 +1170,29 @@ export struct SettingsPane { .enabled(!this.pwBusy) .onClick(() => { this.changePassword(); }) - Divider().color(Theme.border).margin({ top: 16, bottom: 14 }) + } + .width('100%').alignItems(HorizontalAlign.Start) + .padding(16).margin({ top: 8 }) + .attributeModifier(GlassCardModifier.of(this.bgActive)) + .borderRadius(Theme.radiusCard) + } - /* - * 退出登录。 - * - * WebUI 把它放在「我的」页底部(`AccountPage` 的「登录状态」section), - * 理由原话:「低频且不可逆的动作,与密码、密钥同属『账号自身』」; - * 「窄屏下这也是唯一的退出口」。 - */ + /** + * 登录状态(退出登录)—— 对齐 WebUI `AccountPage` 的「登录状态」section。 + * + * ★ 2026-09-21 从 `SecuritySection` 拆出来,并**挪到外观之后**: + * WebUI 的段顺序是 + * 基本资料 → 权限范围 → 修改密码 → 多账号 → 密钥 → 外观 → 登录状态 → 管理 + * 我们原来是「… 密钥 → (改密+退出) → 管理」—— 既少了多账号/外观的位置, + * 又把两个独立 section 焊在一起(见 `PasswordSection` 的注释)。 + * + * WebUI 把它放倒数第二的理由(原文):「低频且不可逆的动作,与密码、密钥 + * 同属『账号自身』」;「窄屏下这也是唯一的退出口」——所以必须**能滚到**, + * 靠的是外层 Scroll 的 `.align(Alignment.Top)` + `contentEndOffset`。 + */ + @Builder + LoginSection() { + Column() { Text('登录状态').fontSize(11).fontColor(Theme.textMuted).width('100%') Button() { Row() {