|
|
@@ -1,31 +1,15 @@
|
|
|
<template>
|
|
|
<div class="comment-tool-bar">
|
|
|
- <div class="actions">
|
|
|
- <div v-if="isTeacher && !topNumber" class="action-button-wrapper green" @click="handleToTop">
|
|
|
- <icon-button title="置顶本条消息" theme="green" :size="30" ripple="green">publish</icon-button>
|
|
|
- <span>置顶</span>
|
|
|
- </div>
|
|
|
- <div v-if="isTeacher && topNumber" class="action-button-wrapper green" @click="handleCancelToTop">
|
|
|
- <icon-button title="置顶本条消息" theme="green" :size="30" ripple="green">close</icon-button>
|
|
|
- <span>取消置顶</span>
|
|
|
- </div>
|
|
|
- <div v-if="isTeacher && !hasReply" class="action-button-wrapper blue"
|
|
|
- @click="handleShowHideReplyInput">
|
|
|
- <icon-button title="回复本条讨论" theme="blue" :size="30" ripple="blue">reply</icon-button>
|
|
|
- <span>回复</span>
|
|
|
- </div>
|
|
|
- <div v-if="isTeacher && hasReply" class="action-button-wrapper red" @click="handleDeleteReply">
|
|
|
- <icon-button title="删除本条讨论" theme="red" :size="30" ripple="red">cancel</icon-button>
|
|
|
- <span>删除回复</span>
|
|
|
- </div>
|
|
|
- <div v-if="canDelete" class="action-button-wrapper red" @click="handleDeleteComment">
|
|
|
- <icon-button title="删除本条讨论" theme="red" :size="30" ripple="red">delete</icon-button>
|
|
|
- <span>删除讨论</span>
|
|
|
- </div>
|
|
|
+ <div>
|
|
|
+ <c-button v-if="isTeacher && !topNumber" @click="handleToTop" theme="green" text icon="publish">置顶</c-button>
|
|
|
+ <c-button v-if="isTeacher && topNumber" @click="handleCancelToTop" theme="green" text icon="close">取消置顶</c-button>
|
|
|
+ <c-button v-if="isTeacher && !hasReply" @click="handleShowHideReplyInput" theme="blue" text icon="reply">回复</c-button>
|
|
|
+ <c-button v-if="isTeacher && hasReply" @click="handleDeleteReply" theme="red" text icon="cancel">删除回复</c-button>
|
|
|
+ <c-button v-if="canDelete" @click="handleDeleteComment" theme="red" text icon="delete">删除回复</c-button>
|
|
|
</div>
|
|
|
<div v-show="replyInputShow && !hasReply" class="reply-input-wrapper">
|
|
|
<c-input placeholder="在此输入回复内容" v-model="replyContent"></c-input>
|
|
|
- <icon-button @click="handleReply" theme="green">send</icon-button>
|
|
|
+ <icon-button :size="44" @click="handleReply" theme="green">send</icon-button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
@@ -34,10 +18,11 @@
|
|
|
import IconButton from '@/components/Basic/IconButton'
|
|
|
import { mapState } from 'vuex'
|
|
|
import CInput from '@/components/Basic/CInput'
|
|
|
+import CButton from '@/components/Basic/CButton'
|
|
|
|
|
|
export default {
|
|
|
props: ['userId', 'hasReply', 'topNumber'],
|
|
|
- components: { CInput, IconButton },
|
|
|
+ components: { CButton, CInput, IconButton },
|
|
|
data () {
|
|
|
return {
|
|
|
replyInputShow: false,
|
|
|
@@ -83,42 +68,20 @@ export default {
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
@import '~@/style/theme.scss';
|
|
|
-
|
|
|
.comment-tool-bar {
|
|
|
- margin: 0 -8px 0 -8px;
|
|
|
-}
|
|
|
-
|
|
|
-.actions {
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
-}
|
|
|
-
|
|
|
-.action-button-wrapper {
|
|
|
- margin-right: 12px;
|
|
|
- display: flex;
|
|
|
- align-items: center;
|
|
|
- cursor: pointer;
|
|
|
- transition: .2s;
|
|
|
-
|
|
|
- span {
|
|
|
- font-size: 14px;
|
|
|
- color: #7a8a9a;
|
|
|
- }
|
|
|
-
|
|
|
- &:hover {
|
|
|
- opacity: .8;
|
|
|
- }
|
|
|
+ margin: 0 -16px;
|
|
|
}
|
|
|
|
|
|
.reply-input-wrapper {
|
|
|
- padding: 0 12px;
|
|
|
- box-sizing: border-box;
|
|
|
- width: 100%;
|
|
|
display: flex;
|
|
|
-
|
|
|
+ align-items: center;
|
|
|
.c-input {
|
|
|
- margin-right: 8px;
|
|
|
- width: 100%;
|
|
|
+ height: 36px;
|
|
|
+ font-size: 14px ;
|
|
|
+ margin-left: 12px;
|
|
|
+ }
|
|
|
+ .icon-button {
|
|
|
+ margin: 0 12px;
|
|
|
}
|
|
|
}
|
|
|
</style>
|