>} title="工作台" />}
footer={}
>
diff --git a/nkebao/src/router/module/component-test.tsx b/nkebao/src/router/module/component-test.tsx
deleted file mode 100644
index c2ccd384..00000000
--- a/nkebao/src/router/module/component-test.tsx
+++ /dev/null
@@ -1,11 +0,0 @@
-import ComponentTest from "@/pages/mobile/component-test";
-
-const componentTestRoutes = [
- {
- path: "/component-test",
- element: ,
- auth: true,
- },
-];
-
-export default componentTestRoutes;
diff --git a/nkebao/src/router/module/iframe.tsx b/nkebao/src/router/module/iframe.tsx
new file mode 100644
index 00000000..32af69e2
--- /dev/null
+++ b/nkebao/src/router/module/iframe.tsx
@@ -0,0 +1,12 @@
+import IframeDebugPage from "@/pages/iframe";
+
+// iframe 调试路由
+const iframeRoutes = [
+ {
+ path: "/iframe",
+ element: ,
+ auth: false, // 不需要认证,方便调试
+ },
+];
+
+export default iframeRoutes;
diff --git a/nkebao/src/router/module/test.tsx b/nkebao/src/router/module/test.tsx
new file mode 100644
index 00000000..becad3a3
--- /dev/null
+++ b/nkebao/src/router/module/test.tsx
@@ -0,0 +1,22 @@
+import SelectTest from "@/pages/mobile/test/select";
+import PostMessageTest from "@/pages/mobile/test/postMessage";
+import TestIndex from "@/pages/mobile/test/index";
+import { DEV_FEATURES } from "@/utils/env";
+
+// 只在开发环境启用测试路由
+const componentTestRoutes = DEV_FEATURES.SHOW_TEST_PAGES
+ ? [
+ {
+ path: "/test",
+ element: ,
+ auth: true,
+ },
+ {
+ path: "/test/select",
+ element: ,
+ auth: true,
+ },
+ ]
+ : [];
+
+export default componentTestRoutes;
diff --git a/nkebao/src/styles/global.scss b/nkebao/src/styles/global.scss
index 261aaf87..ca4e01d0 100644
--- a/nkebao/src/styles/global.scss
+++ b/nkebao/src/styles/global.scss
@@ -160,6 +160,17 @@ textarea {
}
/* 6. 移动端/PC端兼容基础样式 */
+
+// 安全区域CSS变量定义
+:root {
+ --safe-area-top: 0px;
+ --safe-area-bottom: 0px;
+ --safe-area-left: 0px;
+ --safe-area-right: 0px;
+ --status-bar-height: 0px;
+ --nav-bar-height: 44px;
+}
+
html,
body {
height: 100%;
diff --git a/nkebao/src/utils/env.ts b/nkebao/src/utils/env.ts
new file mode 100644
index 00000000..d80a41f2
--- /dev/null
+++ b/nkebao/src/utils/env.ts
@@ -0,0 +1,46 @@
+// 环境配置
+export const isDevelopment = import.meta.env.DEV;
+export const isProduction = import.meta.env.PROD;
+export const isTest = import.meta.env.MODE === "test";
+
+// 开发环境特性开关
+export const DEV_FEATURES = {
+ // 是否显示测试页面
+ SHOW_TEST_PAGES: isDevelopment,
+
+ // 是否启用调试日志
+ ENABLE_DEBUG_LOGS: isDevelopment,
+
+ // 是否显示开发工具
+ SHOW_DEV_TOOLS: isDevelopment,
+
+ // 是否启用Mock数据
+ ENABLE_MOCK_DATA: isDevelopment,
+};
+
+// 获取环境变量
+export const getEnvVar = (key: string, defaultValue?: string): string => {
+ return import.meta.env[key] || defaultValue || "";
+};
+
+// 环境信息
+export const ENV_INFO = {
+ MODE: import.meta.env.MODE,
+ DEV: import.meta.env.DEV,
+ PROD: import.meta.env.PROD,
+ VITE_APP_TITLE: getEnvVar("VITE_APP_TITLE", "存客宝"),
+ VITE_API_BASE_URL: getEnvVar("VITE_API_BASE_URL", ""),
+ VITE_APP_VERSION: getEnvVar("VITE_APP_VERSION", "1.0.0"),
+};
+
+// 开发环境检查
+export const checkDevEnvironment = () => {
+ if (isDevelopment) {
+ // console.log("🚀 开发环境已启用");
+ // console.log("📋 环境信息:", ENV_INFO);
+ // console.log("⚙️ 开发特性:", DEV_FEATURES);
+ }
+};
+
+// 初始化环境检查
+checkDevEnvironment();
diff --git a/nkebao/vite-pwa.config.ts b/nkebao/vite-pwa.config.ts
new file mode 100644
index 00000000..4c544f8a
--- /dev/null
+++ b/nkebao/vite-pwa.config.ts
@@ -0,0 +1,58 @@
+import { defineConfig } from "vite";
+import react from "@vitejs/plugin-react";
+import { VitePWA } from "vite-plugin-pwa";
+
+export default defineConfig({
+ plugins: [
+ react(),
+ VitePWA({
+ registerType: "autoUpdate",
+ workbox: {
+ globPatterns: ["**/*.{js,css,html,ico,png,svg}"],
+ runtimeCaching: [
+ {
+ urlPattern: /^https:\/\/api\./,
+ handler: "NetworkFirst",
+ options: {
+ cacheName: "api-cache",
+ expiration: {
+ maxEntries: 100,
+ maxAgeSeconds: 60 * 60 * 24 * 7, // 7 days
+ },
+ },
+ },
+ ],
+ },
+ manifest: {
+ name: "Cunkebao",
+ short_name: "Cunkebao",
+ description: "Cunkebao Mobile App",
+ theme_color: "#ffffff",
+ background_color: "#ffffff",
+ display: "standalone",
+ orientation: "portrait",
+ scope: "/",
+ start_url: "/",
+ icons: [
+ {
+ src: "favicon.ico",
+ sizes: "64x64 32x32 24x24 16x16",
+ type: "image/x-icon",
+ },
+ {
+ src: "logo.png",
+ sizes: "192x192",
+ type: "image/png",
+ purpose: "any maskable",
+ },
+ {
+ src: "logo.png",
+ sizes: "512x512",
+ type: "image/png",
+ purpose: "any maskable",
+ },
+ ],
+ },
+ }),
+ ],
+});