This commit is contained in:
张成
2025-10-01 15:48:33 +08:00
parent ffc8995fc8
commit b5f99dbcad
2 changed files with 80 additions and 37 deletions

View File

@@ -3,10 +3,15 @@
.comment-reply-container { .comment-reply-container {
width: 100%; width: 100%;
height: 100vh; height: 100vh;
max-height: 100vh;
position: fixed;
top: 0;
left: 0;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
background: #FFFFFF; background: #FFFFFF;
overflow: hidden;
// 顶部导航栏 // 顶部导航栏
.navbar { .navbar {
@@ -67,11 +72,17 @@
// 评论列表滚动区域 // 评论列表滚动区域
.comment-scroll { .comment-scroll {
flex: 1; height: calc(100vh - 100px);
height: 0;
padding: 0 15px; padding: 0 15px;
box-sizing: border-box; box-sizing: border-box;
overflow-y: auto;
// 隐藏滚动条
&::-webkit-scrollbar {
display: none;
width: 0;
height: 0;
background: transparent;
}
} }
// 评论列表 // 评论列表
@@ -240,6 +251,27 @@
} }
} }
// 回复遮罩层
.reply-mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
z-index: 199;
opacity: 0;
visibility: hidden;
pointer-events: none;
transition: opacity 0.2s ease, visibility 0.2s ease;
&.show {
opacity: 1;
visibility: visible;
pointer-events: auto;
}
}
// 回复输入框 // 回复输入框
.reply-input-container { .reply-input-container {
position: fixed; position: fixed;
@@ -251,6 +283,16 @@
padding: 8px 12px; padding: 8px 12px;
padding-bottom: calc(20px + env(safe-area-inset-bottom)); padding-bottom: calc(20px + env(safe-area-inset-bottom));
z-index: 200; z-index: 200;
transform: translateY(100%);
opacity: 0;
visibility: hidden;
transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
&.show {
transform: translateY(0);
opacity: 1;
visibility: visible;
}
.reply-input-wrapper { .reply-input-wrapper {
display: flex; display: flex;

View File

@@ -344,18 +344,20 @@ const CommentReply = () => {
</ScrollView> </ScrollView>
{/* 回复输入框 */} {/* 回复输入框 */}
{showReplyInput && replyTarget && (
<> <>
{/* 遮罩层 */} {/* 遮罩层 */}
<View className="reply-mask" onClick={handleCancelReply}></View> <View
className={`reply-mask ${showReplyInput ? 'show' : ''}`}
onClick={handleCancelReply}
></View>
<View className="reply-input-container"> <View className={`reply-input-container ${showReplyInput ? 'show' : ''}`}>
<View className="reply-input-wrapper"> <View className="reply-input-wrapper">
<View className="input-row"> <View className="input-row">
<Input <Input
className="reply-input" className="reply-input"
type="text" type="text"
placeholder={`回复 ${replyTarget.user_nickname}`} placeholder={`回复 ${replyTarget?.user_nickname || ''}`}
value={replyContent} value={replyContent}
focus={inputFocus} focus={inputFocus}
adjustPosition={true} adjustPosition={true}
@@ -381,7 +383,6 @@ const CommentReply = () => {
</View> </View>
</View> </View>
</> </>
)}
</View> </View>
); );
}; };