fix(notice): 广播弹窗语音/文字切换不跳动,并加高文字输入框

- 遮罩统一 align-items:flex-start,移除按模式切换的 .ns-mask--top
  (原语音居中、文字顶部,切换时弹窗整体窜位)
- .ns-body 增加 min-height:2.5rem,消除语音区与文字区高度差
  导致的弹窗高度变化、优先级行与按钮上下位移
- .ns-textarea 高度 1.4rem -> 2.2rem,文字通知可一次看到更多内容
This commit is contained in:
zm2000 2026-10-29 18:17:20 +08:00
parent d75e4e8a74
commit cc12ce1c91

View File

@ -1,5 +1,6 @@
<template>
<view v-if="visible" :class="['ns-mask', mode === 'text' ? 'ns-mask--top' : '']" @click.self="handleMaskClick">
<!-- 遮罩始终顶部对齐:切换语音/文字时弹窗位置不变(文字模式需留出软键盘空间) -->
<view v-if="visible" class="ns-mask" @click.self="handleMaskClick">
<view class="ns-dialog">
<view class="ns-head">
<text class="ns-title">广播通知</text>
@ -395,13 +396,10 @@ export default {
z-index: 990;
background-color: rgba(0, 0, 0, 0.45);
display: flex;
align-items: center;
justify-content: center;
}
/* 文字模式需要软键盘:弹窗靠上,避免被键盘遮住(不用 adjust-position,老 WebView 会失焦) */
.ns-mask--top {
/* 两种模式统一顶部对齐(文字模式要留出软键盘空间,不用 adjust-position,
老 WebView 会失焦);若按模式切换对齐方式,语音→文字时弹窗会整体窜到顶部 */
align-items: flex-start;
justify-content: center;
}
.ns-dialog {
@ -495,6 +493,10 @@ export default {
.ns-body {
display: flex;
flex-direction: column;
/* 固定最小高度:语音区(提示+录音按钮+状态+副提示)与文字区(输入框+字数)
高度不同,不加会在切换模式时改变弹窗高度、下方优先级/按钮跟着上下移动。
取两种模式的内容最大高度(含录音完成后的试听行),保证切换后弹窗尺寸完全一致 */
min-height: 2.5rem;
margin-bottom: 0.1rem;
}
@ -583,7 +585,8 @@ export default {
.ns-textarea {
width: 100%;
height: 1.4rem;
/* 输入框加高(原 1.4rem),文字通知可一次看到更多内容 */
height: 2.2rem;
box-sizing: border-box;
padding: 0.1rem;
font-size: 0.2rem;