Skip to content

Commit 81aa5c1

Browse files
committed
feat: 聊天页面基本布局结构
1 parent 37b2d64 commit 81aa5c1

File tree

11 files changed

+111
-115
lines changed

11 files changed

+111
-115
lines changed

components.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ export {}
88
/* prettier-ignore */
99
declare module 'vue' {
1010
export interface GlobalComponents {
11+
ChatContent: typeof import('./src/components/mainwindow/ChatView/ChatContent.vue')['default']
12+
ChatInput: typeof import('./src/components/mainwindow/ChatView/ChatInput.vue')['default']
13+
ChatTitle: typeof import('./src/components/mainwindow/ChatView/ChatTitle.vue')['default']
1114
ElBadge: typeof import('element-plus/es')['ElBadge']
1215
ElIcon: typeof import('element-plus/es')['ElIcon']
1316
ElLink: typeof import('element-plus/es')['ElLink']

public/assets/svg/more_16.svg

Lines changed: 1 addition & 0 deletions
Loading

public/assets/svg/more_24.svg

Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<template>
2+
<div class="chat-content">
3+
<div class="chat-inner-content">
4+
5+
</div>
6+
</div>
7+
</template>
8+
9+
<script setup lang="ts">
10+
11+
</script>
12+
13+
<style scoped lang="scss">
14+
.chat-content {
15+
width: 100%;
16+
height: 100%;
17+
overflow: hidden;
18+
display: flex;
19+
flex-direction: column;
20+
background-color: transparent;
21+
border-bottom: 1px solid var(--border-bottom-color);
22+
.chat-inner-content {
23+
width: 100%;
24+
height: calc(100vh - 220px);
25+
overflow-y: auto;
26+
}
27+
}
28+
29+
</style>
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<template>
2+
<div class="chat-input">
3+
22222222
4+
</div>
5+
</template>
6+
<script setup lang="ts">
7+
8+
</script>
9+
<style scoped lang="scss">
10+
.chat-input{
11+
min-height: 150px;
12+
height: 100%;
13+
background: var(--bar-gradient-color);
14+
display: flex;
15+
justify-content: center;
16+
align-items: center;
17+
}
18+
</style>

src/components/mainwindow/MessageList/MessageListItem.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
</div>
1010
<div class="message-list-item-right flex-column-justify-center">
1111
<span id="date">{{ props.data.dateTime }}</span>
12-
<el-badge :value="props.data.unreadCount??0" :is-dot="props.data.notDisturb" badge-style="height:15px;font-size:10px;display:flex;align-items:center"/>
12+
<el-badge :value="props.data.unreadCount??0" :v-if="props.data.unreadCount??0!=0" :is-dot="props.data.notDisturb" :badge-style="props.data.notDisturb?'':'height:15px;font-size:10px;display:flex;align-items:center'"/>
1313
</div>
1414
</div>
1515
</template>
@@ -79,6 +79,7 @@ const props = defineProps<{
7979
8080
.message-list-item-right{
8181
gap: 8px;
82+
align-items: flex-end;
8283
#date{
8384
font-size: 10px;
8485
color: var(--tip-grey-fore-color);

src/components/mainwindow/SideBar.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ date: 2025-04-07
66
<template>
77
<div class="sidebar" style="width: 60px;">
88
<div class="sidebar-content flex-column-space-between">
9-
<div class="left flex-column">
9+
<div class="left flex-column-justify-center">
1010
<h3 style="color: white;">FM</h3>
11-
<img src="../../assets/png/avatar.png.jpg" alt="logo" class="logo" width="35" />
11+
<img src="../../assets/png/avatar.png.jpg" alt="logo" class="logo" :width="35" />
1212
<NavBar :items="navData" />
1313
</div>
1414
<div class="right flex-column">
@@ -107,6 +107,8 @@ onMounted(() => {
107107
};
108108
}
109109
});
110+
111+
110112
</script>
111113
<style lang="scss" scoped>
112114
.sidebar {
@@ -121,8 +123,8 @@ onMounted(() => {
121123
.sidebar-content {
122124
width: 100%;
123125
height: 100%;
124-
padding: 0 10px;
125-
126+
padding: 0 15px;
127+
align-items: center;
126128
.left,
127129
.right {
128130
gap: 10px;

src/style.css

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ html.dark {
5757

5858
--grey-button-background-color: #393939;
5959
--grey-button-background-color-hover: #222222;
60+
61+
--topbar-icon-color: var(--main-fore-color);
62+
--topbar-icon-color-hover: #0066CC ;
63+
64+
--border-bottom-color: #393B40;
6065
}
6166

6267
html {
@@ -108,6 +113,11 @@ html {
108113
color: var(--main-fore-color);
109114

110115
--pop-menu-border-color:none;
116+
117+
--topbar-icon-color: var(--main-fore-color);
118+
--topbar-icon-color-hover:var(--sidebar-background-color) ;
119+
120+
--border-bottom-color: #d9d9d9;
111121
}
112122

113123

@@ -208,8 +218,8 @@ body {
208218

209219
/* 为滚动条整体设置样式 */
210220
::-webkit-scrollbar {
211-
width: 10px;
212-
height: 10px;
221+
width: 6px;
222+
height: 6px;
213223
}
214224

215225
/* 为滚动条的轨道设置样式 */
@@ -220,12 +230,12 @@ body {
220230

221231
/* 为滚动条的滑块设置样式 */
222232
::-webkit-scrollbar-thumb {
223-
background-color: rgba(144, 147, 153, .5);
233+
background-color: rgba(144, 147, 153, .3);
224234
border-radius: 2em;
225235
transition: background-color .3s;
226236
}
227237

228238
/* 当鼠标悬停在滑块上时改变滑块的颜色 */
229239
::-webkit-scrollbar-thumb:hover {
230-
background-color: rgba(144, 147, 153, .3);
240+
background-color: rgba(144, 147, 153, .1);
231241
}

src/util/icon/iconMap.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import Max from '/assets/svg/max_24.svg';
2424
import Brush from '/assets/svg/brush_24.svg';
2525
import Search from '/assets/svg/search.svg';
2626
import Add from '/assets/svg/add_24.svg';
27+
import More from '/assets/svg/more_24.svg';
2728
// 图标 key 类型
2829
export type IconKey =
2930
| 'message'
@@ -45,7 +46,8 @@ export type IconKey =
4546
| 'max'
4647
| 'brush'
4748
| 'search'
48-
| 'add';
49+
| 'add'
50+
| 'more';
4951

5052
// 图标映射表
5153
export const iconMap: Record<IconKey, string> = {
@@ -69,5 +71,6 @@ export const iconMap: Record<IconKey, string> = {
6971
brush: Brush,
7072
search: Search,
7173
add: Add,
74+
more: More,
7275
};
7376

src/view/mainwindow/ChatView.vue

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,26 @@
11
<template>
2-
<div class="chat-view">
3-
2+
<div class="chat-view" v-if="!isBlank">
3+
<ChatTitle title="Chat Title" type="personal"/>
4+
<ChatContent/>
5+
<ChatInput/>
46
</div>
7+
<div class="chat-body" v-else></div>
58
</template>
69
<script setup lang="ts">
10+
import { ref} from 'vue';
11+
import ChatTitle from "@/components/mainwindow/ChatView/ChatTitle.vue";
12+
import ChatContent from "@/components/mainwindow/ChatView/ChatContent.vue";
13+
import ChatInput from "@/components/mainwindow/ChatView/ChatInput.vue";
14+
const isBlank = ref<boolean>(false);
715
</script>
816
<style lang="scss" scoped>
917
.chat-view{
1018
min-height: 100vh;
1119
width: 100%;
1220
height: 100%;
13-
padding: 0;
1421
background: var(--bar-gradient-color);
15-
22+
display: flex;
23+
flex-direction: column;
24+
1625
}
1726
</style>

0 commit comments

Comments
 (0)