fix(order): 解决移动端弹窗因 CSS display !important 导致 Vue v-show 隐藏失效无法关闭问题

- 根因定位:.mobile-popup-form 设置了 display: flex !important,该样式在 CSS 特异性中强于 Vue v-show 生成的行内 style="display: none;";当弹窗点击关闭后,Vue 将变量置为 false 并完成退场动画,但由于样式强制 flex,弹窗退场后立刻以 flex 状态重新暴露在屏幕上(即“又弹出一个”),且由于此时 Vue 响应式状态已是 false,再次点击关闭按钮不会触发状态改变(即“第二次无法关闭”)
- 解耦容器与弹窗:移除 .mobile-popup-form 根节点上的 display: flex !important 与 overflow 强覆盖,弹窗内部增加 .popup-inner 容器承载垂直 flex 列布局与吸顶/吸底/滚动分区
- 严格验证:运行全量检查 ./scripts/check.sh,Go测试、MySQL测试、TypeScript检查及Vite生产构建 100% 通过
This commit is contained in:
yml2213
2026-10-10 18:18:25 +08:00
parent e36bdd28c5
commit 6a99c1121b
2 changed files with 206 additions and 192 deletions
@@ -216,11 +216,19 @@
/* ========== Popups ========== */
.mobile-popup-form {
display: flex !important;
flex-direction: column !important;
max-height: 85vh;
max-height: 85dvh;
overflow: hidden !important;
overflow: hidden;
box-sizing: border-box;
}
.popup-inner {
display: flex;
flex-direction: column;
height: 100%;
max-height: 85vh;
max-height: 85dvh;
overflow: hidden;
box-sizing: border-box;
}
@@ -594,6 +594,7 @@ async function copyListingCode() {
class="mobile-popup-form"
@close="markPopupClosed"
>
<div class="popup-inner">
<header class="popup-header">
<h3>修改结账方案</h3>
<button
@@ -692,6 +693,7 @@ async function copyListingCode() {
提交给对方确认
</van-button>
</footer>
</div>
</van-popup>
<!-- POPUP: Renter Reject Counter Proposal Reason -->
@@ -702,6 +704,7 @@ async function copyListingCode() {
class="mobile-popup-form"
@close="markPopupClosed"
>
<div class="popup-inner">
<header class="popup-header">
<h3>拒绝修正扣款说明</h3>
<button
@@ -740,6 +743,7 @@ async function copyListingCode() {
提交原因并提起争议
</van-button>
</footer>
</div>
</van-popup>
<!-- POPUP: Create Generic Order Dispute -->
@@ -750,6 +754,7 @@ async function copyListingCode() {
class="mobile-popup-form"
@close="markPopupClosed"
>
<div class="popup-inner">
<header class="popup-header">
<h3>发起申诉争议</h3>
<button
@@ -811,6 +816,7 @@ async function copyListingCode() {
提交申诉客服仲裁
</van-button>
</footer>
</div>
</van-popup>
</main>
</template>