feat: repley

This commit is contained in:
zzc
2026-06-15 08:56:18 +08:00
parent cd1595373b
commit 082cd011d2
4 changed files with 369 additions and 89 deletions

View File

@@ -15,13 +15,6 @@
<text class="action-name">{{ action.label }}</text>
</view>
</view>
<view v-if="replyTarget" class="reply-banner">
<view class="reply-banner-main">
<text class="reply-banner-label">正在回复</text>
<text class="reply-banner-user">@{{ replyTarget.replyToName || replyTarget.name }}</text>
</view>
<text class="reply-banner-cancel" @tap="handleCancelReply">取消</text>
</view>
<view class="quick-comment">
<input
class="comment-input"
@@ -49,14 +42,10 @@ const props = defineProps({
sending: {
type: Boolean,
default: false
},
replyTarget: {
type: Object,
default: null
}
});
const emit = defineEmits(['action-change', 'send-comment', 'cancel-reply']);
const emit = defineEmits(['action-change', 'send-comment']);
const currentAction = ref(props.initialAction);
@@ -66,12 +55,7 @@ watch(() => props.initialAction, (newVal) => {
});
const commentText = ref('');
const inputPlaceholder = computed(() => {
if (props.replyTarget?.replyToName || props.replyTarget?.name) {
return `回复 @${props.replyTarget.replyToName || props.replyTarget.name}...`;
}
return '说点什么吧...';
});
const inputPlaceholder = computed(() => '说点什么吧...');
const actions = [
{ label: '拉', value: 'terrible', emoji: '👎', score: 2, scoreType:1 },
@@ -101,10 +85,6 @@ const handleSend = () => {
});
};
const handleCancelReply = () => {
emit('cancel-reply');
};
const resetComment = () => {
commentText.value = '';
};
@@ -178,42 +158,6 @@ defineExpose({
padding: 8rpx 8rpx 8rpx 32rpx;
}
.reply-banner {
margin-bottom: 18rpx;
padding: 16rpx 20rpx;
border-radius: 18rpx;
background: linear-gradient(135deg, rgba(29, 78, 216, 0.08) 0%, rgba(124, 58, 237, 0.08) 100%);
display: flex;
align-items: center;
justify-content: space-between;
gap: 20rpx;
}
.reply-banner-main {
display: flex;
align-items: center;
flex-wrap: wrap;
gap: 10rpx;
}
.reply-banner-label {
font-size: 22rpx;
color: #6b7280;
}
.reply-banner-user {
font-size: 24rpx;
font-weight: 700;
color: #4338ca;
}
.reply-banner-cancel {
flex-shrink: 0;
font-size: 24rpx;
font-weight: 600;
color: #111827;
}
.comment-input {
flex: 1;
height: 72rpx;