From fc062e64801c693e18cbda81af0ea21f1f087735 Mon Sep 17 00:00:00 2001 From: lucas Date: Fri, 23 May 2025 10:56:00 +0800 Subject: [PATCH 01/18] =?UTF-8?q?feat:=20=E5=A2=9E=E5=8A=A0=E5=9B=BE?= =?UTF-8?q?=E7=89=87=E5=AF=BC=E5=85=A5=E8=B7=AF=E5=BE=84=E5=88=AB=E5=90=8D?= =?UTF-8?q?=E5=92=8C=E8=B7=AF=E5=BE=84=E6=8F=90=E7=A4=BA=EF=BC=8C=E5=90=8C?= =?UTF-8?q?=E6=AD=A5=E4=BF=AE=E6=94=B9vscode=E4=B8=AD=E6=8E=A8=E8=8D=90?= =?UTF-8?q?=E5=AE=89=E8=A3=85=E7=9A=84=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .vscode/extensions.json | 4 +++- tsconfig.json | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 522526e..178c449 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -13,6 +13,8 @@ "uni-helper.uni-ui-snippets-vscode", "uni-helper.uni-app-snippets-vscode", "mrmlnc.vscode-json5", - "streetsidesoftware.code-spell-checker" + "streetsidesoftware.code-spell-checker", + "foxundermoon.shell-format", + "christian-kohler.path-intellisense" ] } diff --git a/tsconfig.json b/tsconfig.json index 495932e..d096903 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -11,7 +11,8 @@ "sourceMap": true, "baseUrl": ".", "paths": { - "@/*": ["./src/*"] + "@/*": ["./src/*"], + "@img/*": ["./src/static/*"] }, "outDir": "dist", "lib": ["esnext", "dom"], From 720c7c7e3539321a02f4246f681d2c4040136f05 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 14:38:52 +0800 Subject: [PATCH 02/18] =?UTF-8?q?fix:=20=E6=9B=B4=E6=96=B0=E5=BA=94?= =?UTF-8?q?=E7=94=A8ID=E5=B9=B6=E7=A6=81=E7=94=A8app=E5=B9=B3=E5=8F=B0?= =?UTF-8?q?=E7=9A=84copyNativeRes=E6=8F=92=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 更新manifest.json和.env文件中的应用ID为'__UNI__D1E5001'以匹配新配置 注释掉vite.config.ts中app平台的copyNativeRes插件调用以优化构建流程 --- env/.env | 2 +- src/manifest.json | 2 +- vite.config.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/env/.env b/env/.env index 2ef4cdf..e638295 100644 --- a/env/.env +++ b/env/.env @@ -1,7 +1,7 @@ VITE_APP_TITLE = 'unibest' VITE_APP_PORT = 9000 -VITE_UNI_APPID = 'H57F2ACE4' +VITE_UNI_APPID = '__UNI__D1E5001' VITE_WX_APPID = 'wxa2abb91f64032a2b' # h5部署网站的base,配置到 manifest.config.ts 里的 h5.router.base diff --git a/src/manifest.json b/src/manifest.json index 30e9fa2..344cc1a 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -1,6 +1,6 @@ { "name": "unibest", - "appid": "H57F2ACE4", + "appid": "__UNI__D1E5001", "description": "", "versionName": "1.0.0", "versionCode": "100", diff --git a/vite.config.ts b/vite.config.ts index 8c7fe57..5c49091 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -121,7 +121,7 @@ export default async ({ command, mode }) => { brotliSize: true, }), // 只有在 app 平台时才启用 copyNativeRes 插件 - UNI_PLATFORM === 'app' && copyNativeRes(), + // UNI_PLATFORM === 'app' && copyNativeRes(), Components({ extensions: ['vue'], deep: true, // 是否递归扫描子目录, From 35bdf827d234d8a4368f3a920bc427b96f6ac197 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 14:48:50 +0800 Subject: [PATCH 03/18] =?UTF-8?q?build:=20=E7=A6=81=E7=94=A8sourcemap?= =?UTF-8?q?=E4=BB=A5=E4=BC=98=E5=8C=96=E6=9E=84=E5=BB=BA=E6=80=A7=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 默认情况下禁用sourcemap生成,减少构建输出体积并提高构建速度。移除原有通过环境变量控制的逻辑,因为大多数情况下不需要生成sourcemap --- vite.config.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vite.config.ts b/vite.config.ts index 5c49091..6111304 100644 --- a/vite.config.ts +++ b/vite.config.ts @@ -167,8 +167,9 @@ export default async ({ command, mode }) => { : undefined, }, build: { + sourcemap: false, // 方便非h5端调试 - sourcemap: VITE_SHOW_SOURCEMAP === 'true', // 默认是false + // sourcemap: VITE_SHOW_SOURCEMAP === 'true', // 默认是false target: 'es6', // 开发环境不用压缩 minify: mode === 'development' ? false : 'terser', From 9ad46fe088e3b4a0df33ea5920fc72c6f8610b3b Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 17:26:32 +0800 Subject: [PATCH 04/18] =?UTF-8?q?fix(=E5=AE=89=E5=85=A8=E5=8C=BA=E5=9F=9F)?= =?UTF-8?q?:=20=E4=BF=AE=E5=A4=8D=E5=BE=AE=E4=BF=A1=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E8=8E=B7=E5=8F=96=E5=AE=89=E5=85=A8=E5=8C=BA=E5=9F=9F?= =?UTF-8?q?=E8=B7=9D=E7=A6=BB=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 微信小程序需要使用 wx.getWindowInfo() API 获取安全区域距离,其他平台继续使用 uni.getSystemInfoSync() --- src/pages/index/index.vue | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 3757593..e36edcc 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -38,7 +38,25 @@ defineOptions({ }) // 获取屏幕边界到安全区域距离 -const { safeAreaInsets } = uni.getSystemInfoSync() +let safeAreaInsets +// #ifdef MP-WEIXIN +// 微信小程序使用新的API +const systemInfo = wx.getWindowInfo() +safeAreaInsets = systemInfo.safeArea + ? { + top: systemInfo.safeArea.top, + right: systemInfo.windowWidth - systemInfo.safeArea.right, + bottom: systemInfo.windowHeight - systemInfo.safeArea.bottom, + left: systemInfo.safeArea.left, + } + : null +// #endif + +// #ifndef MP-WEIXIN +// 其他平台继续使用uni API +const systemInfo = uni.getSystemInfoSync() +safeAreaInsets = systemInfo.safeAreaInsets +// #endif const author = ref('菲鸽') const description = ref( 'unibest 是一个集成了多种工具和技术的 uniapp 开发模板,由 uniapp + Vue3 + Ts + Vite6 + UnoCss + VSCode 构建,模板具有代码提示、自动格式化、统一配置、代码片段等功能,并内置了许多常用的基本组件和基本功能,让你编写 uniapp 拥有 best 体验。', From 91ee84cd4999feb1c5eab6fa06606c8967a20004 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 17:46:29 +0800 Subject: [PATCH 05/18] =?UTF-8?q?style(=E9=A1=B5=E9=9D=A2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE):=20=E6=9B=B4=E6=96=B0=E9=A1=B5=E9=9D=A2=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E9=85=8D=E7=BD=AE=E5=92=8C=E6=B3=A8=E9=87=8A=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在分包页面中添加 navigationStyle 配置 - 注释掉 about 页面中未使用的分包跳转按钮代码 ``` 这个提交消息: 1. 使用了 `style` 类型,因为修改主要是样式配置和代码注释 2. 添加了 `页面配置` 作为可选范围 3. 描述简洁说明了两个主要修改点 4. 符合中文提交规范,使用简体中文且简明扼要 5. 没有使用句号结尾 6. 保持在50个字符以内 --- src/pages-sub/demo/index.vue | 5 ++++- src/pages/about/about.vue | 6 ++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/pages-sub/demo/index.vue b/src/pages-sub/demo/index.vue index 6126ddc..d2033ad 100644 --- a/src/pages-sub/demo/index.vue +++ b/src/pages-sub/demo/index.vue @@ -1,6 +1,9 @@ { - style: { navigationBarTitleText: '分包页面 标题' }, + style: { + navigationStyle: 'default', + navigationBarTitleText: '分包页面 标题', + }, } diff --git a/src/pages/about/about.vue b/src/pages/about/about.vue index d234b89..351623d 100644 --- a/src/pages/about/about.vue +++ b/src/pages/about/about.vue @@ -18,6 +18,7 @@ 鸽友们好,我是 菲鸽 + 测试 scss 样式 @@ -31,6 +32,11 @@ import UploadComp from './components/upload.vue' // 获取屏幕边界到安全区域距离 const { safeAreaInsets } = uni.getSystemInfoSync() +const toSubPage = () => { + uni.navigateTo({ + url: '/pages-sub/demo/index', + }) +} +import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' import +'abortcontroller-polyfill/dist/abortcontroller-polyfill-only' onLaunch(() => { console.log('App +Launch') }) onShow(() => { console.log('App Show') }) onHide(() => { console.log('App Hide') }) From ad522ee570961a63c4e03ae123190c6d684aad5e Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 19:50:11 +0800 Subject: [PATCH 10/18] =?UTF-8?q?chore:=20=E6=9B=B4=E6=96=B0=E7=89=88?= =?UTF-8?q?=E6=9C=AC=E5=8F=B7=E8=87=B32.11.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 这是一个简单的版本号更新提交,属于杂项任务(chore),没有涉及功能修改或修复,因此不需要详细说明原因。根据提交消息指南,我们保持了简洁的描述,使用小写字母开头且没有句号。 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 6a7f982..5479264 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "unibest", "type": "commonjs", - "version": "2.10.3", + "version": "2.11.0", "description": "unibest - 最好的 uniapp 开发模板", "update-time": "2025-05-28", "author": { From 6bc115cd3664bdee9764d5526b34c39865515d5b Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 19:51:28 +0800 Subject: [PATCH 11/18] =?UTF-8?q?chore:=20=E5=9C=A8prepare=E8=84=9A?= =?UTF-8?q?=E6=9C=AC=E4=B8=AD=E6=B7=BB=E5=8A=A0git=E5=88=9D=E5=A7=8B?= =?UTF-8?q?=E5=8C=96=E6=AD=A5=E9=AA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 在prepare脚本中增加git init命令,确保husky安装前git仓库已初始化 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 5479264..c7046a7 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ "build:quickapp-webview-union": "uni build -p quickapp-webview-union", "type-check": "vue-tsc --noEmit", "openapi-ts-request": "openapi-ts", - "prepare": "husky" + "prepare": "git init && husky" }, "lint-staged": { "**/*.{html,cjs,json,md,scss,css,txt}": [ From 0f9431cf1ec5d070b42730435f369279f60a319f Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Tue, 3 Jun 2025 20:03:45 +0800 Subject: [PATCH 12/18] =?UTF-8?q?chore(husky):=20=E5=9C=A8pre-commit?= =?UTF-8?q?=E9=92=A9=E5=AD=90=E4=B8=AD=E6=B7=BB=E5=8A=A0--allow-empty?= =?UTF-8?q?=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 允许在git commit时即使没有变更也能执行lint-staged --- .husky/pre-commit | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.husky/pre-commit b/.husky/pre-commit index d0a7784..c3ec64b 100644 --- a/.husky/pre-commit +++ b/.husky/pre-commit @@ -1 +1 @@ -npx lint-staged \ No newline at end of file +npx lint-staged --allow-empty \ No newline at end of file From 13c166139dcc39f9faf5664e17c3abe8ed5683fa Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 4 Jun 2025 09:00:34 +0800 Subject: [PATCH 13/18] =?UTF-8?q?Revert=20"style:=20=E7=A7=BB=E9=99=A4?= =?UTF-8?q?=E6=97=A0=E7=94=A8=E6=A0=B7=E5=BC=8F=E5=B9=B6=E4=BF=AE=E5=A4=8D?= =?UTF-8?q?=E6=A0=B7=E5=BC=8F=E6=A3=80=E6=9F=A5=E8=AD=A6=E5=91=8A"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit a5a359528a4f2183bd3110dc288c140485345bbe. --- src/App.vue | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 59 insertions(+), 3 deletions(-) diff --git a/src/App.vue b/src/App.vue index b474aee..d32c900 100644 --- a/src/App.vue +++ b/src/App.vue @@ -1,3 +1,59 @@ -import { onLaunch, onShow, onHide } from '@dcloudio/uni-app' import -'abortcontroller-polyfill/dist/abortcontroller-polyfill-only' onLaunch(() => { console.log('App -Launch') }) onShow(() => { console.log('App Show') }) onHide(() => { console.log('App Hide') }) + + + From 0b4147a15e6c9e1111c48d31dfc74e6278dade46 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 4 Jun 2025 09:02:49 +0800 Subject: [PATCH 14/18] =?UTF-8?q?style:=20=E6=9B=B4=E6=96=B0lint-staged?= =?UTF-8?q?=E9=85=8D=E7=BD=AE=E4=BB=A5=E6=94=AF=E6=8C=81Vue=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index c7046a7..df0d08b 100644 --- a/package.json +++ b/package.json @@ -73,10 +73,10 @@ "prepare": "git init && husky" }, "lint-staged": { - "**/*.{html,cjs,json,md,scss,css,txt}": [ + "**/*.{vue,html,cjs,json,md,scss,css,txt}": [ "prettier --write --cache" ], - "**/*.{vue,js,ts}": [ + "**/*.{js,ts}": [ "oxlint --fix", "prettier --write --cache" ], From f23d8128f93c1167f337f0c46a1121fd49ec6ee0 Mon Sep 17 00:00:00 2001 From: feige996 <1020102647@qq.com> Date: Wed, 4 Jun 2025 09:03:13 +0800 Subject: [PATCH 15/18] =?UTF-8?q?test:=20=E6=B5=8B=E8=AF=95=20lint-staged?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/App.vue | 1 - 1 file changed, 1 deletion(-) diff --git a/src/App.vue b/src/App.vue index d32c900..8cec5a2 100644 --- a/src/App.vue +++ b/src/App.vue @@ -14,7 +14,6 @@ onHide(() => {