zhaohuanhuan 1 жил өмнө
parent
commit
d3b676eeb3

+ 53 - 0
index.html

@@ -12,5 +12,58 @@
   <body>
     <div id="app"></div>
     <script type="module" src="/src/main.ts"></script>
+    <script>
+      function getBrowserInfo() {
+        const userAgent = navigator.userAgent;
+        let browserName = "Unknown";
+        let browserVersion = "Unknown";
+
+        // 检查浏览器类型及版本
+        if (userAgent.includes("Chrome")) {
+          browserName = "Chrome";
+          // 提取 Chrome 版本
+          const match = userAgent.match(/Chrome\/([0-9]+)/);
+          if (match) {
+            browserVersion = match[1];
+          }
+        } else if (userAgent.includes("Firefox")) {
+          browserName = "Firefox";
+          // 提取 Firefox 版本
+          const match = userAgent.match(/Firefox\/([0-9]+)/);
+          if (match) {
+            browserVersion = match[1];
+          }
+        } else if (userAgent.includes("MSIE") || userAgent.includes("Trident")) {
+          browserName = "Internet Explorer";
+          // 提取 IE 版本
+          const match = userAgent.match(/(?:MSIE |rv:)([0-9]+)/);
+          if (match) {
+            browserVersion = match[1];
+          }
+        } else if (userAgent.includes("Edge")) {
+          browserName = "Edge";
+          // 提取 Edge 版本
+          const match = userAgent.match(/Edge\/([0-9]+)/);
+          if (match) {
+            browserVersion = match[1];
+          }
+        } else if (userAgent.includes("Safari")) {
+          browserName = "Safari";
+          // 提取 Safari 版本
+          const match = userAgent.match(/Version\/([0-9]+)/);
+          if (match) {
+            browserVersion = match[1];
+          }
+        }
+
+        return {
+          browserName,
+          browserVersion,
+        };
+      }
+
+      // const browserInfo = getBrowserInfo();
+      // console.log(`Browser: ${browserInfo.browserName}, Version: ${browserInfo.browserVersion}`);
+    </script>
   </body>
 </html>

+ 7 - 0
package.json

@@ -23,13 +23,19 @@
     "vue-router": "^4.5.0"
   },
   "devDependencies": {
+    "@babel/core": "^7.26.0",
+    "@babel/plugin-proposal-optional-chaining": "^7.21.0",
+    "@babel/preset-env": "^7.26.0",
     "@types/node": "^22.10.2",
     "@types/vue": "^2.0.0",
     "@typescript-eslint/eslint-plugin": "^8.18.1",
     "@typescript-eslint/parser": "^8.18.1",
+    "@vitejs/plugin-legacy": "^5.3.2",
     "@vitejs/plugin-vue": "^5.2.1",
     "@vue/compiler-sfc": "^3.5.13",
     "@vue/runtime-dom": "^3.5.13",
+    "core-js": "^3.40.0",
+    "eruda": "^3.4.1",
     "eslint": "^9.17.0",
     "eslint-config-prettier": "^9.1.0",
     "eslint-plugin-prettier": "^5.2.1",
@@ -37,6 +43,7 @@
     "postcss-px-to-viewport": "^1.1.1",
     "prettier": "^3.4.2",
     "sass-embedded": "^1.83.0",
+    "terser": "^5.37.0",
     "typescript": "^5.7.2",
     "vite": "^6.0.1",
     "vue-tsc": "^2.2.0"

+ 1 - 27
src/App.vue

@@ -1,7 +1,5 @@
 <template>
-  <div id="app">
-    <router-view />
-  </div>
+  <router-view />
 </template>
 
 <script lang="ts" setup>
@@ -26,30 +24,6 @@ router.afterEach(() => {
 })
 </script>
 <style >
-:root:root {
-  --van-nav-bar-background:#1989fa;
-}
-:root:root {
-  --van-nav-bar-text-color:#ffffff;
-}
-:root:root {
-  --van-nav-bar-title-text-color:#ffffff;
-}
-:root:root {
-  --van-nav-bar-icon-color:#ffffff
-}
-:root:root {
-  --van-nav-bar-arrow-size:18px
-}
-:root:root{
-  --van-notice-bar-height: 24px
-}
-:root:root {
-  --van-dialog-header-padding-top:10px
-}
-:root:root{
-  --van-notice-bar-padding:0 8px
-}
 
 
 

+ 8 - 0
src/main.ts

@@ -5,10 +5,18 @@ import piniaPersist from 'pinia-plugin-persistedstate';
 
 import router from './router';
 import App from './App.vue'
+import 'core-js/stable';
+import 'regenerator-runtime/runtime';
 // 引入 Vant 组件库
 import Vant from 'vant'
 import { Loading } from 'vant'
 import 'vant/lib/index.css'
+if (process.env.NODE_ENV === 'development' || process.env.NODE_ENV === 'sit') {
+  import('eruda').then(eruda => {
+    // @ts-ignore
+    eruda.init();
+  });
+}
 const app = createApp(App)
 // 使用 Vant UI 组件库
 app.use(Vant)

+ 31 - 0
src/style.css

@@ -28,6 +28,8 @@ body {
   place-items: center;
   min-width: 320px;
   min-height: 100vh;
+  background: #f2f8fe;
+  color: #000;
 }
 
 h1 {
@@ -64,6 +66,10 @@ button:focus-visible {
   width: 100%;
   text-align: center;
 }
+table{
+  background: #fff;
+  color: #000;
+}
 .container{
   height: 100vh;
   width: 100%;
@@ -81,3 +87,28 @@ button:focus-visible {
     background-color: #f9f9f9;
   }
 }
+
+:root:root {
+  --van-nav-bar-background:#1989fa;
+}
+:root:root {
+  --van-nav-bar-text-color:#ffffff;
+}
+:root:root {
+  --van-nav-bar-title-text-color:#ffffff;
+}
+:root:root {
+  --van-nav-bar-icon-color:#ffffff
+}
+:root:root {
+  --van-nav-bar-arrow-size:18px
+}
+:root:root{
+  --van-notice-bar-height: 24px
+}
+:root:root {
+  --van-dialog-header-padding-top:10px
+}
+:root:root{
+  --van-notice-bar-padding:0 8px
+}

+ 1 - 1
src/views/outbound/components/BigPicking.vue

@@ -229,7 +229,7 @@ defineExpose({show})
   overflow: scroll
   .sub-task-checkbox
     padding: 4px 0
-    ::v-deep .van-checkbox__label
+    :deep(.van-checkbox__label)
       display: flex
       flex: 1
     .sub-task-item

+ 10 - 1
vite.config.ts

@@ -1,7 +1,16 @@
 import { defineConfig } from 'vite'
 import vue from '@vitejs/plugin-vue'
+import legacy from '@vitejs/plugin-legacy';
 export default defineConfig({
-  plugins: [vue()],
+  plugins: [vue(),
+    legacy({
+      targets: ['> 0.1%', 'not dead','chrome <= 66'],
+      additionalLegacyPolyfills: [
+        'core-js/stable',
+        'regenerator-runtime/runtime',
+      ],
+    })
+  ],
   server: {
     host: '0.0.0.0', // 允许通过局域网访问
     port: 5173,  // 修改为你需要的端口号