fix(更新弹窗+调试脚本): 兼容旧真机 flex gap 与 dev 打包参数被吞

- 更新弹窗/登录页/关于页统一移除 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 目录无产物导致装回旧包
This commit is contained in:
zm2000 2026-10-30 18:16:28 +08:00
parent 106162d43f
commit 263adfb759
4 changed files with 72 additions and 24 deletions

View File

@ -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
}

View File

@ -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;
}
</style>

View File

@ -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;

View File

@ -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;
}
</style>