feat: 接入管理后台订单列表
This commit is contained in:
1 parent
b9939fe173
commit
5fe750fbd4
4 files changed
+17
No files matched your search
@@ -1 +1,15 @@
|
||||
import type { ApiClient } from "@personal-brand/api-client";
|
||||
|
||||
export interface AdminDashboardOptions { client: ApiClient; root: HTMLElement }
|
||||
|
||||
export class AdminDashboard {
|
||||
constructor(private readonly options: AdminDashboardOptions) {}
|
||||
|
||||
async load(): Promise<void> {
|
||||
const { root, client } = this.options;
|
||||
const [bookings, unread] = await Promise.all([client.listAdminBookings(), client.getAdminUnreadCount()]);
|
||||
root.innerHTML = `<h1>品牌后台</h1><p>未读订单:${unread.count}</p><ul>${bookings.map((item) => `<li data-id="${item.id}">${item.bookingNo} · ${item.customerName} · ${item.status}</li>`).join("") || "<li>暂无订单</li>"}</ul>`;
|
||||
}
|
||||
}
|
||||
|
||||
export const adminAppName = "personal-brand-admin";
|
||||
Reference in new issue
Block a user