|
|
@@ -1,9 +1,16 @@
|
|
|
<template>
|
|
|
<div class="discussion-area">
|
|
|
- <h1 class="title">本页留言板</h1>
|
|
|
+ <h1 class="sub-title vertical-center">
|
|
|
+ 本页留言板
|
|
|
+ <c-button theme="green" :left="12" :icon="showWriteTool ? 'unfold_less' : 'edit'" text @click="showWriteTool = !showWriteTool">
|
|
|
+ {{showWriteTool ? '隐藏编辑器' : '发帖'}}
|
|
|
+ </c-button>
|
|
|
+ </h1>
|
|
|
<div class="discussion-area-content">
|
|
|
- <write-new-comment ref="writeComment" class="mb-24" @comment-submit="handleCommentSubmit"
|
|
|
- :placeholder="writingAreaPlaceholder"></write-new-comment>
|
|
|
+ <show-transition>
|
|
|
+ <write-new-comment v-show="showWriteTool" class="mb-8" ref="writeComment" @comment-submit="handleCommentSubmit"
|
|
|
+ :placeholder="writingAreaPlaceholder"></write-new-comment>
|
|
|
+ </show-transition>
|
|
|
<div class="no-content-warning" v-if="comments === null">
|
|
|
<div class="no-content-warning-tip">加载中...</div>
|
|
|
</div>
|
|
|
@@ -33,14 +40,17 @@ import { mapState } from 'vuex'
|
|
|
import { createComment, getComments } from '@/server/comment'
|
|
|
import WebsocketPublisher from '@/server/websocket/ws'
|
|
|
import { useCommentWsServer } from '@/config/server-info'
|
|
|
+import CButton from '@/components/Basic/CButton'
|
|
|
+import ShowTransition from '@/animations/ShowTransition'
|
|
|
|
|
|
export default {
|
|
|
- components: { WriteNewComment, CComment },
|
|
|
+ components: { ShowTransition, CButton, WriteNewComment, CComment },
|
|
|
data () {
|
|
|
return {
|
|
|
comments: null,
|
|
|
wsComments: [],
|
|
|
- slideId: this.$route.params.slideId
|
|
|
+ slideId: this.$route.params.slideId,
|
|
|
+ showWriteTool: false
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
|
@@ -57,7 +67,7 @@ export default {
|
|
|
currentPage: state => state.pdf.currentPage
|
|
|
}),
|
|
|
writingAreaPlaceholder () {
|
|
|
- return '写下针对本页的讨论(标题)'
|
|
|
+ return '主题'
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
@@ -120,25 +130,39 @@ export default {
|
|
|
<style lang="scss" scoped>
|
|
|
.discussion-area {
|
|
|
max-width: 410px;
|
|
|
- padding: 24px 12px;
|
|
|
+ padding: 12px 12px 0 12px;
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
position: fixed;
|
|
|
-
|
|
|
+ min-width: 405px;
|
|
|
max-height: calc(100vh - 76px);
|
|
|
overflow: auto;
|
|
|
bottom: 0;
|
|
|
right: 0;
|
|
|
- background-color: #ffffff66;
|
|
|
+ background-color: rgba(250, 250, 250, 0.8);
|
|
|
+ /*background-color: rgba(255, 255, 255, 0.8);*/
|
|
|
backdrop-filter: saturate(150%) blur(20px);
|
|
|
}
|
|
|
|
|
|
+.no-content-warning {
|
|
|
+ height: 50px;
|
|
|
+}
|
|
|
+
|
|
|
+.c-comment:nth-child(2n) {
|
|
|
+ background-color: rgba(130, 130, 130, 0.05);
|
|
|
+}
|
|
|
+
|
|
|
+.c-comment:nth-child(2n-1) {
|
|
|
+ background-color: rgba(130, 130, 130, 0.1);
|
|
|
+}
|
|
|
+
|
|
|
@media (max-width: 500px) {
|
|
|
.discussion-area {
|
|
|
min-width: unset;
|
|
|
max-width: unset;
|
|
|
left: 0;
|
|
|
right: 0;
|
|
|
+ background-color: rgba(255, 255, 255, 0.8);
|
|
|
}
|
|
|
}
|
|
|
</style>
|