feat: 接入管理后台订单列表
This commit is contained in:
1 parent
b9939fe173
commit
5fe750fbd4
4 files changed
+17
No files matched your search
@@ -0,0 +1 @@
|
||||
<!doctype html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>品牌后台</title></head><body><main id="app"></main><script type="module" src="./dist/main.js"></script></body></html>
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@personal-brand/admin",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"dependencies": { "@personal-brand/api-client": "workspace:*" },
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"dev": "tsc -p tsconfig.json --watch",
|
||||
|
||||
@@ -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";
|
||||
@@ -2,6 +2,7 @@
|
||||
"name": "@personal-brand/api-client",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"exports": { ".": { "types": "./dist/index.d.ts", "import": "./dist/index.js" } },
|
||||
"scripts": {
|
||||
"build": "tsc -p tsconfig.json",
|
||||
"lint": "eslint .",
|
||||
|
||||
Reference in new issue
Block a user