|
|
@ -2,41 +2,29 @@
|
|
|
|
<div class="reply-item">
|
|
|
|
<div class="reply-item">
|
|
|
|
<div class="header-wrap">
|
|
|
|
<div class="header-wrap">
|
|
|
|
<div class="username">
|
|
|
|
<div class="username">
|
|
|
|
<router-link
|
|
|
|
<router-link class="user-link" :to="{
|
|
|
|
class="user-link"
|
|
|
|
|
|
|
|
:to="{
|
|
|
|
|
|
|
|
name: 'user',
|
|
|
|
name: 'user',
|
|
|
|
query: { username: props.reply.user.username },
|
|
|
|
query: { username: props.reply.user.username },
|
|
|
|
}"
|
|
|
|
}">
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ props.reply.user.username }}
|
|
|
|
{{ props.reply.user.username }}
|
|
|
|
</router-link>
|
|
|
|
</router-link>
|
|
|
|
<span class="reply-name">
|
|
|
|
<span class="reply-name">
|
|
|
|
{{ props.reply.at_user_id > 0 ? '回复' : ':' }}
|
|
|
|
{{ props.reply.at_user_id > 0 ? '回复' : ':' }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
|
|
|
|
|
|
|
|
<router-link
|
|
|
|
<router-link class="user-link" :to="{
|
|
|
|
class="user-link"
|
|
|
|
|
|
|
|
:to="{
|
|
|
|
|
|
|
|
name: 'user',
|
|
|
|
name: 'user',
|
|
|
|
query: { username: props.reply.at_user.username },
|
|
|
|
query: { username: props.reply.at_user.username },
|
|
|
|
}"
|
|
|
|
}" v-if="props.reply.at_user_id > 0">
|
|
|
|
v-if="props.reply.at_user_id > 0"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
{{ props.reply.at_user.username }}
|
|
|
|
{{ props.reply.at_user.username }}
|
|
|
|
</router-link>
|
|
|
|
</router-link>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="timestamp">
|
|
|
|
<div class="timestamp">
|
|
|
|
{{ props.reply.ip_loc }}
|
|
|
|
{{ props.reply.ip_loc }}
|
|
|
|
<n-popconfirm
|
|
|
|
<n-popconfirm v-if="
|
|
|
|
v-if="
|
|
|
|
|
|
|
|
store.state.userInfo.is_admin ||
|
|
|
|
store.state.userInfo.is_admin ||
|
|
|
|
store.state.userInfo.id === props.reply.user.id
|
|
|
|
store.state.userInfo.id === props.reply.user.id
|
|
|
|
"
|
|
|
|
" negative-text="取消" positive-text="确认" @positive-click="execDelAction">
|
|
|
|
negative-text="取消"
|
|
|
|
|
|
|
|
positive-text="确认"
|
|
|
|
|
|
|
|
@positive-click="execDelAction"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<template #trigger>
|
|
|
|
<template #trigger>
|
|
|
|
<n-button quaternary circle size="tiny" class="del-btn">
|
|
|
|
<n-button quaternary circle size="tiny" class="del-btn">
|
|
|
|
<template #icon>
|
|
|
|
<template #icon>
|
|
|
@ -57,40 +45,27 @@
|
|
|
|
<span class="time-item">
|
|
|
|
<span class="time-item">
|
|
|
|
{{ formatPrettyTime(props.reply.created_on) }}
|
|
|
|
{{ formatPrettyTime(props.reply.created_on) }}
|
|
|
|
</span>
|
|
|
|
</span>
|
|
|
|
<div
|
|
|
|
|
|
|
|
v-if="!store.state.userLogined"
|
|
|
|
<div class="actions">
|
|
|
|
class="action-item"
|
|
|
|
<div v-if="!store.state.userLogined" class="action-item" @click.stop="">
|
|
|
|
@click.stop=""
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<n-icon size="medium">
|
|
|
|
<n-icon size="medium">
|
|
|
|
<thumb-up-outlined/>
|
|
|
|
<thumb-up-outlined />
|
|
|
|
</n-icon>
|
|
|
|
</n-icon>
|
|
|
|
<span class="upvote-count">{{ thumbsUpCount }}</span>
|
|
|
|
<span class="upvote-count">{{ thumbsUpCount }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div v-if="store.state.userLogined" class="action-item hover" @click.stop="handleThumbsUp">
|
|
|
|
v-if="store.state.userLogined"
|
|
|
|
|
|
|
|
class="action-item hover"
|
|
|
|
|
|
|
|
@click.stop="handleThumbsUp"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<n-icon size="medium">
|
|
|
|
<n-icon size="medium">
|
|
|
|
<thumb-up-outlined v-if="!hasThumbsUp" />
|
|
|
|
<thumb-up-outlined v-if="!hasThumbsUp" />
|
|
|
|
<thumb-up-twotone v-if="hasThumbsUp" class="show" />
|
|
|
|
<thumb-up-twotone v-if="hasThumbsUp" class="show" />
|
|
|
|
</n-icon>
|
|
|
|
</n-icon>
|
|
|
|
<span class="upvote-count">{{ thumbsUpCount }}</span>
|
|
|
|
<span class="upvote-count">{{ thumbsUpCount }}</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div v-if="!store.state.userLogined" class="action-item">
|
|
|
|
v-if="!store.state.userLogined"
|
|
|
|
|
|
|
|
class="action-item"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<n-icon size="medium">
|
|
|
|
<n-icon size="medium">
|
|
|
|
<thumb-down-outlined />
|
|
|
|
<thumb-down-outlined />
|
|
|
|
</n-icon>
|
|
|
|
</n-icon>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div
|
|
|
|
<div v-if="store.state.userLogined" class="action-item hover" @click.stop="handleThumbsDown">
|
|
|
|
v-if="store.state.userLogined"
|
|
|
|
|
|
|
|
class="action-item hover"
|
|
|
|
|
|
|
|
@click.stop="handleThumbsDown"
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<n-icon size="medium">
|
|
|
|
<n-icon size="medium">
|
|
|
|
<thumb-down-outlined v-if="!hasThumbsDown" />
|
|
|
|
<thumb-down-outlined v-if="!hasThumbsDown" />
|
|
|
|
<thumb-down-twotone v-if="hasThumbsDown" class="show" />
|
|
|
|
<thumb-down-twotone v-if="hasThumbsDown" class="show" />
|
|
|
@ -100,6 +75,7 @@
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
|
|
<script setup lang="ts">
|
|
|
|
<script setup lang="ts">
|
|
|
@ -140,7 +116,7 @@ const handleThumbsUp = () => {
|
|
|
|
hasThumbsUp.value = !hasThumbsUp.value
|
|
|
|
hasThumbsUp.value = !hasThumbsUp.value
|
|
|
|
if (hasThumbsUp.value) {
|
|
|
|
if (hasThumbsUp.value) {
|
|
|
|
thumbsUpCount.value++
|
|
|
|
thumbsUpCount.value++
|
|
|
|
hasThumbsDown.value= false
|
|
|
|
hasThumbsDown.value = false
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
thumbsUpCount.value--
|
|
|
|
thumbsUpCount.value--
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -201,16 +177,19 @@ const execDelAction = () => {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
justify-content: space-between;
|
|
|
|
justify-content: space-between;
|
|
|
|
|
|
|
|
|
|
|
|
.username {
|
|
|
|
.username {
|
|
|
|
max-width: 50%;
|
|
|
|
max-width: 50%;
|
|
|
|
overflow: hidden;
|
|
|
|
overflow: hidden;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
|
|
|
|
|
|
|
|
.reply-name {
|
|
|
|
.reply-name {
|
|
|
|
margin: 0 3px;
|
|
|
|
margin: 0 3px;
|
|
|
|
opacity: 0.75;
|
|
|
|
opacity: 0.75;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.timestamp {
|
|
|
|
.timestamp {
|
|
|
|
opacity: 0.75;
|
|
|
|
opacity: 0.75;
|
|
|
|
text-align: right;
|
|
|
|
text-align: right;
|
|
|
@ -220,8 +199,10 @@ const execDelAction = () => {
|
|
|
|
white-space: nowrap;
|
|
|
|
white-space: nowrap;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.base-wrap {
|
|
|
|
.base-wrap {
|
|
|
|
display: block;
|
|
|
|
display: block;
|
|
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
.content {
|
|
|
|
width: calc(100% - 40px);
|
|
|
|
width: calc(100% - 40px);
|
|
|
|
margin-top: 4px;
|
|
|
|
margin-top: 4px;
|
|
|
@ -229,36 +210,54 @@ const execDelAction = () => {
|
|
|
|
text-align: justify;
|
|
|
|
text-align: justify;
|
|
|
|
line-height: 2;
|
|
|
|
line-height: 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.reply-switch {
|
|
|
|
.reply-switch {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
justify-content: space-between;
|
|
|
|
font-size: 12px;
|
|
|
|
font-size: 12px;
|
|
|
|
margin: 10px 0 0;
|
|
|
|
margin: 10px 0 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
.actions {
|
|
|
|
|
|
|
|
display: flex;
|
|
|
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
text-align: right;
|
|
|
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
|
|
|
margin: 10px 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.time-item {
|
|
|
|
.time-item {
|
|
|
|
font-size: 12px;
|
|
|
|
font-size: 12px;
|
|
|
|
opacity: 0.75;
|
|
|
|
opacity: 0.75;
|
|
|
|
margin-right: 18px;
|
|
|
|
margin-right: 18px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.action-item {
|
|
|
|
.action-item {
|
|
|
|
display: flex;
|
|
|
|
display: flex;
|
|
|
|
align-items: center;
|
|
|
|
align-items: center;
|
|
|
|
margin-right: 18px;
|
|
|
|
margin-left: 18px;
|
|
|
|
opacity: 0.65;
|
|
|
|
opacity: 0.65;
|
|
|
|
|
|
|
|
|
|
|
|
.upvote-count {
|
|
|
|
.upvote-count {
|
|
|
|
margin-left: 4px;
|
|
|
|
margin-left: 4px;
|
|
|
|
font-size: 12px;
|
|
|
|
font-size: 12px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
&.hover {
|
|
|
|
&.hover {
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.opacity-item {
|
|
|
|
.opacity-item {
|
|
|
|
opacity: 0.75;
|
|
|
|
opacity: 0.75;
|
|
|
|
|
|
|
|
margin-left: 18px;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.show {
|
|
|
|
.show {
|
|
|
|
color: #18a058;
|
|
|
|
color: #18a058;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.hide {
|
|
|
|
.hide {
|
|
|
|
opacity: 0.75;
|
|
|
|
opacity: 0.75;
|
|
|
|
cursor: pointer;
|
|
|
|
cursor: pointer;
|
|
|
@ -266,6 +265,7 @@ const execDelAction = () => {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
.dark {
|
|
|
|
.dark {
|
|
|
|
.reply-item {
|
|
|
|
.reply-item {
|
|
|
|
border-bottom: 1px solid #262628;
|
|
|
|
border-bottom: 1px solid #262628;
|
|
|
|