diff --git a/docs/product/ARKTS_PAGE_COMPOSITION_PROGRESS_V0.md b/docs/product/ARKTS_PAGE_COMPOSITION_PROGRESS_V0.md new file mode 100644 index 0000000..9ba86fa --- /dev/null +++ b/docs/product/ARKTS_PAGE_COMPOSITION_PROGRESS_V0.md @@ -0,0 +1,58 @@ +# ArkTS 页面组件树接线进展 v0 + +项目:MRP 模拟器鸿蒙化 +角色:RD Frontend + +## 本轮完成 + +### 1. AppListPage 已接线 +已接入: +- `PageHeader` +- `StatusBanner` +- `LoadingBlock` +- `EmptyState` +- `ImportEntryButton` +- `AppListView` + +当前页面状态流: +- loading -> `LoadingBlock` +- error -> `StatusBanner` +- empty -> `EmptyState + ImportEntryButton` +- data ready -> `AppListView` + +### 2. ImportPage 已接线 +已接入: +- `PageHeader` +- `StatusBanner` +- `ImportSourceSelector` +- `PackagePreviewCard` +- `ImportProgressPanel` +- `ImportResultPanel` + +当前页面状态流: +- preview ready -> `PackagePreviewCard` +- importing -> `ImportProgressPanel` +- success/failed -> `ImportResultPanel` + +### 3. RunPage 已接线 +已接入: +- `PageHeader` +- `StatusBanner` +- `RuntimeToolbar` +- `RuntimeContainer` +- `RuntimeStatusOverlay` +- `ConfirmDialog` + +当前页面状态流: +- 非 running -> `RuntimeStatusOverlay` +- stopped -> `ConfirmDialog` + +## 当前结论 +- 3 个页面已从纯占位推进为“组件树已挂接”的壳层页面 +- 仍为 POC 占位实现,尚未接入真实路由、真实用户事件和真实 native 数据流 + +## 下一步 +1. 为 Store 做可观察/可驱动 UI 的响应式改造 +2. 给页面补最小按钮事件 +3. 增加页面之间最小跳转闭环 +4. 预留 Adapter 到 NAPI façade 的接入点 diff --git a/entry/src/main/ets/pages/AppListPage.ets b/entry/src/main/ets/pages/AppListPage.ets index 716abcb..4f94a26 100644 --- a/entry/src/main/ets/pages/AppListPage.ets +++ b/entry/src/main/ets/pages/AppListPage.ets @@ -1,4 +1,10 @@ import { AppCatalogStore } from '../store/AppCatalogStore' +import { PageHeader } from '../components/common/PageHeader' +import { LoadingBlock } from '../components/common/LoadingBlock' +import { EmptyState } from '../components/common/EmptyState' +import { StatusBanner } from '../components/common/StatusBanner' +import { ImportEntryButton } from '../components/appList/ImportEntryButton' +import { AppListView } from '../components/appList/AppListView' @Entry @Component @@ -11,8 +17,18 @@ struct AppListPage { build() { Column() { - Text('AppListPage') - Text(`apps: ${this.store.items.length}`) + PageHeader({ title: '应用列表' }) + if (this.store.error) { + StatusBanner({ text: this.store.error.message }) + } + if (this.store.loading) { + LoadingBlock({ text: '正在加载应用列表' }) + } else if (this.store.items.length === 0) { + EmptyState({ text: '暂无已导入应用' }) + ImportEntryButton() + } else { + AppListView({ items: this.store.items }) + } } .width('100%') .height('100%') diff --git a/entry/src/main/ets/pages/ImportPage.ets b/entry/src/main/ets/pages/ImportPage.ets index 3beefc3..f386f8b 100644 --- a/entry/src/main/ets/pages/ImportPage.ets +++ b/entry/src/main/ets/pages/ImportPage.ets @@ -1,4 +1,10 @@ import { ImportStore } from '../store/ImportStore' +import { PageHeader } from '../components/common/PageHeader' +import { StatusBanner } from '../components/common/StatusBanner' +import { ImportSourceSelector } from '../components/import/ImportSourceSelector' +import { PackagePreviewCard } from '../components/import/PackagePreviewCard' +import { ImportProgressPanel } from '../components/import/ImportProgressPanel' +import { ImportResultPanel } from '../components/import/ImportResultPanel' @Component export struct ImportPage { @@ -6,8 +12,23 @@ export struct ImportPage { build() { Column() { - Text('ImportPage') - Text(`phase: ${this.store.phase}`) + PageHeader({ title: '导入应用' }) + if (this.store.error) { + StatusBanner({ text: this.store.error.message }) + } + ImportSourceSelector() + if (this.store.previewInfo) { + PackagePreviewCard({ name: this.store.previewInfo.name }) + } + if (this.store.phase === 'importing') { + ImportProgressPanel({ text: '导入中' }) + } + if (this.store.phase === 'success') { + ImportResultPanel({ text: '导入成功' }) + } + if (this.store.phase === 'failed') { + ImportResultPanel({ text: '导入失败' }) + } } .width('100%') .height('100%') diff --git a/entry/src/main/ets/pages/RunPage.ets b/entry/src/main/ets/pages/RunPage.ets index 188ad52..925ca0e 100644 --- a/entry/src/main/ets/pages/RunPage.ets +++ b/entry/src/main/ets/pages/RunPage.ets @@ -1,4 +1,10 @@ import { RuntimeSessionStore } from '../store/RuntimeSessionStore' +import { PageHeader } from '../components/common/PageHeader' +import { StatusBanner } from '../components/common/StatusBanner' +import { ConfirmDialog } from '../components/common/ConfirmDialog' +import { RuntimeContainer } from '../components/runtime/RuntimeContainer' +import { RuntimeToolbar } from '../components/runtime/RuntimeToolbar' +import { RuntimeStatusOverlay } from '../components/runtime/RuntimeStatusOverlay' @Component export struct RunPage { @@ -6,8 +12,18 @@ export struct RunPage { build() { Column() { - Text('RunPage') - Text(`phase: ${this.store.phase}`) + PageHeader({ title: '运行页' }) + if (this.store.error) { + StatusBanner({ text: this.store.error.message }) + } + RuntimeToolbar() + RuntimeContainer() + if (this.store.phase !== 'running') { + RuntimeStatusOverlay({ text: `当前状态:${this.store.phase}` }) + } + if (this.store.phase === 'stopped') { + ConfirmDialog({ title: '运行已结束', content: '当前会话已停止' }) + } } .width('100%') .height('100%')