From 2a2895802f4cf6e758ba8d56a3a2cebb28dcb34c Mon Sep 17 00:00:00 2001 From: Megghy Date: Mon, 1 Apr 2024 15:07:09 +0800 Subject: [PATCH] improve question tag and card display --- src/App.vue | 21 +++ src/views/manage/QuestionBoxManageView.vue | 27 ++- src/views/manage/QuestionDisplayCard.vue | 198 ++++++++++++++++++--- src/views/single/QuestionDisplay.vue | 12 +- src/views/view/QuestionBoxView.vue | 28 ++- 5 files changed, 253 insertions(+), 33 deletions(-) diff --git a/src/App.vue b/src/App.vue index ec1738c..529b238 100644 --- a/src/App.vue +++ b/src/App.vue @@ -178,4 +178,25 @@ const themeOverrides = { position: absolute; left: 0; } + +.slide-up-enter-active, +.slide-up-leave-active { + transition: all 0.5s ease-out; +} +.slide-up-enter-to { + position: absolute; + top: 0; +} +.slide-up-enter-from { + position: absolute; + top: -100%; +} +.slide-up-leave-to { + position: absolute; + bottom : -100%; +} +.slide-up-leave-from { + position: absolute; + bottom : 0; +} diff --git a/src/views/manage/QuestionBoxManageView.vue b/src/views/manage/QuestionBoxManageView.vue index b0e2497..5fa14bd 100644 --- a/src/views/manage/QuestionBoxManageView.vue +++ b/src/views/manage/QuestionBoxManageView.vue @@ -173,6 +173,13 @@ onMounted(() => { 刷新 分享 + + 前往提问页 + @@ -188,7 +195,9 @@ onMounted(() => { clearable :options="useQB.tags.map((s) => ({ label: s.name, value: s.name }))" style="width: 200px" - /> + > + + 只显示收藏 只显示公开 只显示未读 @@ -285,14 +294,16 @@ onMounted(() => { 类似于话题, 可以在投稿时选择 - - 标签名称 - - 添加 - - + + + 标签名称 + + 添加 + + +
- + diff --git a/src/views/manage/QuestionDisplayCard.vue b/src/views/manage/QuestionDisplayCard.vue index b9eca2b..5b21ea2 100644 --- a/src/views/manage/QuestionDisplayCard.vue +++ b/src/views/manage/QuestionDisplayCard.vue @@ -56,18 +56,20 @@ onUnmounted(() => { }" :display="question ? 1 : 0" > -
- {{ question?.sender?.name ?? '匿名用户' }} -
+ +
+ {{ question?.sender?.name ?? '匿名用户' }} +
+
-
- {{ question?.question.message }} -
- + + +
+
+
+
+
+
+
@@ -99,9 +114,9 @@ onUnmounted(() => { border: 2 solid rgb(255, 255, 255); display: flex; flex-direction: column; - transition: all 0.3s ease; border-style: solid; box-sizing: border-box; + transition: all 0.3s ease; } .question-display-content { border-radius: 10px; @@ -110,19 +125,156 @@ onUnmounted(() => { height: 100%; justify-content: space-evenly; padding: 24px; + overflow: auto; } .question-display-user-name { text-align: center; margin: 5px; - transition: all 0.3s ease; + height: 32px; + text-overflow: ellipsis; + white-space: nowrap; } .question-display-text { min-height: 50px; - transition: all 0.3s ease; } .question-display-image { max-width: 40%; max-height: 40%; margin: 0 auto; } + +::-webkit-scrollbar { + width: 10px; + + height: 10px; +} + +::-webkit-scrollbar-thumb { + background: hsla(0, 0%, 51%, 0.377); + + -webkit-box-shadow: none; + + border-radius: 10px; + + -webkit-box-shadow: none; +} + +::-webkit-scrollbar-track { + border-radius: 10px; + + background: #cccccc4b; + + -webkit-box-shadow: none; + + -webkit-box-shadow: none; +} + + + diff --git a/src/views/single/QuestionDisplay.vue b/src/views/single/QuestionDisplay.vue index 592e672..95c345a 100644 --- a/src/views/single/QuestionDisplay.vue +++ b/src/views/single/QuestionDisplay.vue @@ -72,7 +72,7 @@ watch([cardSize.width, cardSize.height], () => { const setting = computed({ get: () => { - if (accountInfo.value) { + if (accountInfo.value && accountInfo.value.settings) { return accountInfo.value.settings.questionDisplay } return defaultSettings @@ -161,6 +161,16 @@ onMounted(() => {