From 263adfb759fbe210a7452baa82e6be687f28350e Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Fri, 30 Oct 2026 18:16:28 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=9B=B4=E6=96=B0=E5=BC=B9=E7=AA=97+?= =?UTF-8?q?=E8=B0=83=E8=AF=95=E8=84=9A=E6=9C=AC):=20=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E6=97=A7=E7=9C=9F=E6=9C=BA=20flex=20gap=20=E4=B8=8E=20dev=20?= =?UTF-8?q?=E6=89=93=E5=8C=85=E5=8F=82=E6=95=B0=E8=A2=AB=E5=90=9E?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新弹窗/登录页/关于页统一移除 flex gap,改用兄弟选择器 margin 控制间距, 修复旧机型 WebView 不支持 gap 导致版本号、信息行、提示、按钮之间无间距 - :deep(.u-button) 改为 ::v-deep,兼容旧真机样式穿透;关于页补上按钮 flex:1 - dev-adb 打包由 npm run android:pack:raw -- -Dev -NoUpload 改为直接执行 android-offline/pack.ps1 -Dev -NoUpload,避免 PowerShell 吞掉 -- 使参数失效, 打包成发行包并覆盖正式 APK、dev 目录无产物导致装回旧包 --- scripts/dev-adb.cjs | 13 ++++++++- .../AppUpdateDialog/AppUpdateDialog.vue | 27 ++++++++++++----- src/pages/login/index.vue | 27 ++++++++++++----- src/pages/settings/about.vue | 29 ++++++++++++++----- 4 files changed, 72 insertions(+), 24 deletions(-) diff --git a/scripts/dev-adb.cjs b/scripts/dev-adb.cjs index 5b3703a..25f3291 100644 --- a/scripts/dev-adb.cjs +++ b/scripts/dev-adb.cjs @@ -312,7 +312,18 @@ async function buildAndInstall(device, trigger) { } // 3. 离线打包(-Dev:产物进 release/android/dev 且带 _dev 后缀,不触发发布上传) - if (!run('npm', ['run', 'android:pack:raw', '--', '-Dev', '-NoUpload'])) { + // 注意:不要用 `npm run android:pack:raw -- -Dev -NoUpload`。 + // PowerShell 会把 `--` 吞掉,`-Dev/-NoUpload` 随即被 npm 当作未知选项丢弃, + // 结果是打出「发行包」(覆盖 release/android/ 下的正式 APK),而 dev 目录没有新文件, + // 后面 findDevApk() 就会装回旧包,真机上看到的永远是老界面。 + // 这里直接调 pack.ps1,参数一定生效。 + if (!run('powershell', [ + '-NoProfile', + '-ExecutionPolicy', 'Bypass', + '-File', path.join(ROOT, 'android-offline', 'pack.ps1'), + '-Dev', + '-NoUpload', + ])) { log('✗ 打包失败,跳过安装') return false } diff --git a/src/components/AppUpdateDialog/AppUpdateDialog.vue b/src/components/AppUpdateDialog/AppUpdateDialog.vue index 1f98cbd..f4f39c0 100644 --- a/src/components/AppUpdateDialog/AppUpdateDialog.vue +++ b/src/components/AppUpdateDialog/AppUpdateDialog.vue @@ -460,7 +460,6 @@ export default { .update-header { display: flex; flex-direction: column; - gap: 10rpx; margin-bottom: 28rpx; } @@ -470,7 +469,9 @@ export default { color: #222; } +/* 旧真机 WebView 不支持 flex gap,改用 margin 控制间距 */ .update-version { + margin-top: 10rpx; font-size: 24rpx; color: #5c6b77; } @@ -478,17 +479,16 @@ export default { .update-body { display: flex; flex-direction: column; - gap: 20rpx; } .update-row { display: flex; justify-content: space-between; align-items: flex-start; - gap: 20rpx; } .update-label { + margin-right: 20rpx; font-size: 26rpx; color: #86909c; flex-shrink: 0; @@ -507,7 +507,6 @@ export default { padding: 24rpx; display: flex; flex-direction: column; - gap: 12rpx; } .update-tip { @@ -516,8 +515,16 @@ export default { color: #4e5969; } -.update-progress-section { - margin-top: 8rpx; +.update-tip + .update-tip { + margin-top: 12rpx; +} + +/* 主体内各区块间距:不用 flex gap,兼容旧真机 */ +.update-row + .update-row, +.update-tip-box, +.update-progress-section, +.update-error { + margin-top: 20rpx; } .update-progress-head { @@ -554,11 +561,15 @@ export default { .update-actions { display: flex; - gap: 20rpx; margin-top: 32rpx; } -.update-actions :deep(.u-button) { +.update-actions ::v-deep .u-button { flex: 1; } + +/* 旧真机不支持 flex gap,按钮间距用兄弟选择器 margin 兜底 */ +.update-actions ::v-deep .u-button + .u-button { + margin-left: 20rpx; +} diff --git a/src/pages/login/index.vue b/src/pages/login/index.vue index 463221c..f892107 100644 --- a/src/pages/login/index.vue +++ b/src/pages/login/index.vue @@ -1066,7 +1066,6 @@ export default { .update-header { display: flex; flex-direction: column; - gap: 10rpx; margin-bottom: 28rpx; } @@ -1076,7 +1075,9 @@ export default { color: #222; } +/* 旧真机 WebView 不支持 flex gap,改用 margin 控制间距 */ .update-version { + margin-top: 10rpx; font-size: 24rpx; color: #5c6b77; } @@ -1084,17 +1085,16 @@ export default { .update-body { display: flex; flex-direction: column; - gap: 20rpx; } .update-row { display: flex; justify-content: space-between; align-items: flex-start; - gap: 20rpx; } .update-label { + margin-right: 20rpx; font-size: 26rpx; color: #86909c; flex-shrink: 0; @@ -1113,7 +1113,6 @@ export default { padding: 24rpx; display: flex; flex-direction: column; - gap: 12rpx; } .update-tip { @@ -1122,8 +1121,16 @@ export default { color: #4e5969; } -.update-progress-section { - margin-top: 8rpx; +.update-tip + .update-tip { + margin-top: 12rpx; +} + +/* 主体内各区块间距:不用 flex gap,兼容旧真机 */ +.update-row + .update-row, +.update-tip-box, +.update-progress-section, +.update-error { + margin-top: 20rpx; } .update-progress-head { @@ -1160,14 +1167,18 @@ export default { .update-actions { display: flex; - gap: 20rpx; margin-top: 32rpx; } -.update-actions :deep(.u-button) { +.update-actions ::v-deep .u-button { flex: 1; } +/* 旧真机不支持 flex gap,按钮间距用兄弟选择器 margin 兜底 */ +.update-actions ::v-deep .u-button + .u-button { + margin-left: 20rpx; +} + .header-section { text-align: left; margin-bottom: 60rpx; diff --git a/src/pages/settings/about.vue b/src/pages/settings/about.vue index 101a8de..bb8bfd5 100644 --- a/src/pages/settings/about.vue +++ b/src/pages/settings/about.vue @@ -622,7 +622,6 @@ export default { .update-header { display: flex; flex-direction: column; - gap: 10rpx; margin-bottom: 28rpx; } @@ -632,7 +631,9 @@ export default { color: #222; } +/* 旧真机 WebView 不支持 flex gap,改用 margin 控制间距 */ .update-version { + margin-top: 10rpx; font-size: 24rpx; color: #5c6b77; } @@ -640,17 +641,16 @@ export default { .update-body { display: flex; flex-direction: column; - gap: 20rpx; } .update-row { display: flex; justify-content: space-between; align-items: flex-start; - gap: 20rpx; } .update-label { + margin-right: 20rpx; font-size: 26rpx; color: #86909c; flex-shrink: 0; @@ -669,7 +669,6 @@ export default { padding: 24rpx; display: flex; flex-direction: column; - gap: 12rpx; } .update-tip { @@ -678,8 +677,16 @@ export default { color: #4e5969; } -.update-progress-section { - margin-top: 8rpx; +.update-tip + .update-tip { + margin-top: 12rpx; +} + +/* 主体内各区块间距:不用 flex gap,兼容旧真机 */ +.update-row + .update-row, +.update-tip-box, +.update-progress-section, +.update-error { + margin-top: 20rpx; } .update-progress-head { @@ -716,7 +723,15 @@ export default { .update-actions { display: flex; - gap: 20rpx; margin-top: 32rpx; } + +.update-actions ::v-deep .u-button { + flex: 1; +} + +/* 旧真机不支持 flex gap,按钮间距用兄弟选择器 margin 兜底 */ +.update-actions ::v-deep .u-button + .u-button { + margin-left: 20rpx; +}