From 4590b3b7873da88be1e827bf0c8469abdfb79fe5 Mon Sep 17 00:00:00 2001 From: Guarp Date: Mon, 17 Feb 2025 22:33:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/images/delete.svg | 11 + .../demoPages/messageBoard/Board_page.vue | 308 +++++++++++++++--- src/pages/demoPages/messageBoard/Message.vue | 98 +++++- src/store/index.js | 8 +- 4 files changed, 364 insertions(+), 61 deletions(-) create mode 100644 public/images/delete.svg diff --git a/public/images/delete.svg b/public/images/delete.svg new file mode 100644 index 0000000..9fa54d0 --- /dev/null +++ b/public/images/delete.svg @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/src/pages/demoPages/messageBoard/Board_page.vue b/src/pages/demoPages/messageBoard/Board_page.vue index 9e56826..ee69de8 100644 --- a/src/pages/demoPages/messageBoard/Board_page.vue +++ b/src/pages/demoPages/messageBoard/Board_page.vue @@ -1,64 +1,140 @@ @@ -69,11 +145,14 @@ const messages = ref([{ align-items: center; justify-items: flex-start; width: 100%; - height: calc(100vh - 100px); + height: calc(100vh - 130px); overflow: auto; } .board-body { + display: flex; + flex-direction: column; + gap: 20px; width: 90%; height: auto; padding: 20px; @@ -83,12 +162,137 @@ const messages = ref([{ border: cyan solid 1px; } +.theme-light .board-body { + border: #b2b2b2 solid 1px; +} + .message-container { display: flex; flex-direction: column; justify-content: center; gap: 15px; + transition: opacity 0.2s ease; } +.message-container.loading { + opacity: 0.4; +} +.paging-container { + display: flex; + flex-direction: row; + align-items: center; + justify-content: center; + gap: 10px; +} + +.page-btn { + cursor: pointer; + display: flex; + align-items: center; + justify-content: center; + background: black; + //width: 25px; + height: 25px; + padding: 0 5px; + border-radius: 4px; + border: cyan solid 1px; +} + +.page-btn.active { + background: cyan; + color: black; +} + +.sender-container { + margin: 20px; + background-color: #212121; + border: cyan solid 1px; + border-radius: 10px; + position: fixed; + bottom: 0; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; + width: 95%; + height: auto; + overflow: hidden; +} + +.sender-tips { + display: flex; + flex-direction: row; + justify-content: flex-start; + align-items: center; + width: 100%; +} + +.sender-tips img { + width: 50px; + margin: 15px 15px 0; + border-radius: 50%; +} + +.sender-tips .text { + display: flex; + flex-direction: column; +} + +.refresh-btn { + flex: 1; + margin-right: 15px; + display: flex; + flex-direction: row-reverse; +} + +.refresh-btn button { + background-color: #4f4f4f; + color: cyan; + padding: 5px; + border-radius: 5px; +} + +.sender-input { + display: flex; + flex-direction: row; + width: 97%; + gap: 10px; + margin: 15px; + transition: all 0.5s ease; +} + +/* 输入框样式 */ +.message-input { + flex: 1; + padding: 10px; + border: 1px solid #ccc; + border-radius: 5px; + font-size: 16px; + outline: none; +} + +/* 发送按钮样式 */ +.send-button { + background-color: #007bff; + color: white; + border: none; + padding: 10px 20px; + border-radius: 5px; + font-size: 16px; + cursor: pointer; + transition: all 0.3s ease; +} +/* 鼠标悬停时的按钮样式 */ +.send-button:hover { + background-color: #0056b3; +} + +.send-button:active { + transform: scale(0.95); +} + +.send-button:disabled { + background-color: #9d9d9d; +} \ No newline at end of file diff --git a/src/pages/demoPages/messageBoard/Message.vue b/src/pages/demoPages/messageBoard/Message.vue index f2b7c82..012baf7 100644 --- a/src/pages/demoPages/messageBoard/Message.vue +++ b/src/pages/demoPages/messageBoard/Message.vue @@ -1,17 +1,38 @@ @@ -46,6 +75,10 @@ defineProps({ gap: 15px; } +.theme-light .message { + background: #ffffff; +} + .message .avatar { width: 60px; height: 60px; @@ -71,23 +104,28 @@ defineProps({ display: flex; align-items: center; flex-direction: row; + color: #dadada; gap: 10px; } .userinfo .name { - color: #dadada; font-size: large; } -.userinfo .role { - color: #dadada; +.theme-light .userinfo { + color: #2a2a2a; } .details .content { word-break: break-word; color: white; } -.details .bottom { + +.theme-light .content { + color: black; +} + +.bottom { display: flex; flex-direction: row; align-items: center; @@ -100,7 +138,7 @@ defineProps({ } -.bottom .like { +.like { display: flex; align-items: center; overflow: hidden; @@ -113,4 +151,50 @@ defineProps({ padding: 2px 0 0; } +.right { + //display: flex; + //flex-direction: row; +} + +.delete-message { + display: flex; + flex-direction: row; + opacity: 0; + cursor: pointer; + color: #ffffff; + font-size: small; + width: 75px; + transition: opacity 0.2s ease; +} + +.message:hover .delete-message { + opacity: 0.4; +} + +.message:hover .delete-message:hover { + opacity: 0.6; +} + +.theme-light .delete-message { + color: #000000; +} + +.delete-message .delete-ico { + width: 20px; + height: 20px; + background: #ffffff; + -webkit-mask-image: url('/public/images/delete.svg'); + mask-image: url('/public/images/delete.svg'); + -webkit-mask-repeat: no-repeat; + mask-repeat: no-repeat; +} + +.theme-light .delete-ico { + background: #000000; +} + + +.theme-light .delete-message span { + +} \ No newline at end of file diff --git a/src/store/index.js b/src/store/index.js index 42fac0e..96e1a7a 100644 --- a/src/store/index.js +++ b/src/store/index.js @@ -8,7 +8,8 @@ const store = createStore({ theme: localStorage.getItem('theme') || 'dark', loading: {}, token: null, - userInfo: {} + userInfo: {}, + demos: {} }, mutations: { toggleTheme(state) { @@ -31,6 +32,9 @@ const store = createStore({ }, stopLoading(state) { state.loading.isLoading = false; + }, + setDemoValue(state, obj) { + state.demos[obj.demo] = {...state.demos[obj.demo], ...obj.value} } }, getters: { @@ -46,7 +50,7 @@ const store = createStore({ }, plugins: [createPersistedStatePlugin({ key: 'cyberStorage', - whitelist: ['theme', 'userInfo'], + whitelist: ['theme', 'userInfo', 'demos'], })] })