feat ui设计稿
This commit is contained in:
@@ -31,49 +31,55 @@ const emit = defineEmits<{ download: [] }>()
|
||||
<style lang="less" scoped>
|
||||
.chat-file-card {
|
||||
.flex(row, center);
|
||||
gap: @spacing-sm;
|
||||
min-width: 220px;
|
||||
gap: 8px; // 图标→文件名 11 × 0.77
|
||||
min-width: 181px; // 设计 38 文件卡宽 235 × 0.77
|
||||
max-width: 320px;
|
||||
padding: @spacing-sm @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
padding: 10px 12px; // 卡内边距 13/15 × 0.77
|
||||
border: 1px solid @project-divider; // 设计 38 卡描边 ≈ @project-divider
|
||||
border-radius: 6px;
|
||||
background: @white;
|
||||
|
||||
&__icon {
|
||||
font-size: @font-size-xl;
|
||||
flex-shrink: 0;
|
||||
font-size: 14px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&__info {
|
||||
.flex(column, flex-start);
|
||||
gap: 2px;
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 4px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
// 设计 38:文件名 12 → 11 / 700 / #1F2937
|
||||
&__name {
|
||||
font-size: @font-size-base;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
// 设计 38:大小 12 → 11 / #9CA3AF
|
||||
&__size {
|
||||
font-size: @font-size-sm;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&__download {
|
||||
flex-shrink: 0;
|
||||
height: 26px;
|
||||
padding: 0 @spacing-sm;
|
||||
border: 1px solid @primary-color;
|
||||
border-radius: @radius-sm;
|
||||
height: 22px;
|
||||
padding: 0 8px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: 4px;
|
||||
background: @white;
|
||||
color: @primary-color;
|
||||
font-size: @font-size-sm;
|
||||
color: @text-color-secondary;
|
||||
font-size: 11px;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
background: @primary-light;
|
||||
border-color: @primary-strong;
|
||||
color: @primary-strong;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,42 +86,49 @@ function onFileChange(event: Event): void {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.chat-input {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-sm;
|
||||
padding: @spacing-base;
|
||||
border-top: 1px solid @border-color;
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 16px; // 输入框→提示行 23 × 0.77
|
||||
padding: 12px 16px 24px; // 上 13 / 左右 21 / 下 36 × 0.77
|
||||
border-top: 1px solid @project-divider; // 设计 38 分割线 @project-divider
|
||||
background: @white;
|
||||
|
||||
// 设计 38:文本域灰底无描边,占位文案 #1F2937(13 → 11)
|
||||
&__textarea {
|
||||
width: 100%;
|
||||
padding: @spacing-sm @spacing-base;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @bg-color-light;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
height: 57px; // 文本域高 74 × 0.77(覆盖 rows 固有高)
|
||||
padding: 11px 10px;
|
||||
border: none;
|
||||
border-radius: 6px;
|
||||
background: @finance-row-bg; // 设计 38 实取 @finance-row-bg
|
||||
color: @heading-color;
|
||||
font-size: 11px;
|
||||
line-height: 1.6;
|
||||
resize: none;
|
||||
outline: none;
|
||||
transition: border-color 0.2s;
|
||||
transition: background 0.2s;
|
||||
box-sizing: border-box;
|
||||
|
||||
&:focus {
|
||||
border-color: @primary-color;
|
||||
border: none;
|
||||
background: @finance-row-bg;
|
||||
}
|
||||
|
||||
&::placeholder {
|
||||
color: @text-color-disabled;
|
||||
color: @heading-color; // 设计 38 占位即标注 @heading-color
|
||||
}
|
||||
}
|
||||
|
||||
&__bar {
|
||||
.flex(row, space-between);
|
||||
gap: @spacing-base;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
// 设计 38:提示 11 / #9CA3AF(覆盖 text-secondary)
|
||||
&__hint {
|
||||
font-size: @font-size-sm;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
&__actions {
|
||||
@@ -131,22 +138,38 @@ function onFileChange(event: Event): void {
|
||||
|
||||
&__attach {
|
||||
.flex(row, center);
|
||||
width: 32px;
|
||||
height: 32px;
|
||||
border: 1px solid @border-color;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
font-size: @font-size-lg;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border: none;
|
||||
border-radius: @radius-sm;
|
||||
background: transparent;
|
||||
font-size: 14px;
|
||||
cursor: pointer;
|
||||
transition: all 0.2s;
|
||||
|
||||
&:hover {
|
||||
border-color: @primary-color;
|
||||
background: @bg-color-light;
|
||||
}
|
||||
}
|
||||
|
||||
&__file {
|
||||
display: none;
|
||||
}
|
||||
|
||||
// 「发送」:设计 38 #024FFF 小按钮(12 → 11 / 500)
|
||||
.app-button {
|
||||
height: 24px; // 31 × 0.77
|
||||
padding: 0 14px;
|
||||
border-radius: 6px;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-weight: 500;
|
||||
|
||||
&:hover {
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -38,70 +38,84 @@ const emit = defineEmits<{ download: [] }>()
|
||||
|
||||
<style lang="less" scoped>
|
||||
.chat-message-item {
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-sm;
|
||||
.flex(row, flex-start, flex-start); // 头像与气泡顶对齐(设计 38)
|
||||
gap: 9px; // 头像→气泡 12 × 0.77
|
||||
|
||||
// 设计 38:头像直径 36 × 0.77;客服 #024FFF,用户 #8D99AE
|
||||
&__avatar {
|
||||
flex-shrink: 0;
|
||||
.flex(row, center);
|
||||
width: 36px;
|
||||
height: 36px;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-light;
|
||||
color: @primary-color;
|
||||
font-size: @font-size-base;
|
||||
font-weight: 600;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
font-size: 12px; // 16 → 12
|
||||
font-weight: 400;
|
||||
|
||||
&--user {
|
||||
background: fade(@success-color, 15%);
|
||||
color: @success-color;
|
||||
background: @service-user-avatar;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
&__main {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-xs;
|
||||
max-width: 70%;
|
||||
.flex(column, flex-start, flex-start);
|
||||
gap: 4px;
|
||||
max-width: 320px; // 气泡最宽 ≈ 设计 410 × 0.77
|
||||
}
|
||||
|
||||
// 设计 38:客服气泡白底轻影;13 → 11 / #1F2937
|
||||
&__bubble {
|
||||
position: relative;
|
||||
padding: @spacing-sm @spacing-base;
|
||||
border-radius: @radius-base;
|
||||
padding: 9px 12px; // 内边距 12/15 × 0.77
|
||||
border-radius: 8px;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
color: @text-color;
|
||||
font-size: @font-size-base;
|
||||
line-height: 1.7;
|
||||
color: @heading-color;
|
||||
font-size: 11px;
|
||||
line-height: 1.75;
|
||||
white-space: pre-wrap;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
&__time {
|
||||
font-size: @font-size-sm;
|
||||
// 文件消息:文件卡自身成卡,气泡去内边距/底色/影(设计 38 单层卡)
|
||||
&__bubble:has(.chat-file-card) {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
box-shadow: none;
|
||||
}
|
||||
|
||||
// 设计 38:消息时间 11 / #9CA3AF
|
||||
&__time {
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
}
|
||||
|
||||
// 设计 38:「未读」挂在文件卡左下外侧,10 → 11 / #9CA3AF,无底色
|
||||
&__unread {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -6px;
|
||||
padding: 0 6px;
|
||||
border-radius: @radius-round;
|
||||
background: @danger-color;
|
||||
color: @white;
|
||||
font-size: @font-size-sm;
|
||||
line-height: 16px;
|
||||
top: 100%;
|
||||
left: 0;
|
||||
margin-top: 6px;
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
color: @text-color-disabled;
|
||||
font-size: 11px;
|
||||
font-weight: 400;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
&--user {
|
||||
.flex(row, flex-end);
|
||||
.flex(row, flex-end, flex-start);
|
||||
|
||||
.chat-message-item__main {
|
||||
align-items: flex-end;
|
||||
}
|
||||
|
||||
// 设计 38:我方气泡 #024FFF 白字
|
||||
.chat-message-item__bubble {
|
||||
background: @primary-color;
|
||||
background: @primary-strong;
|
||||
color: @white;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,16 +42,21 @@ watch(
|
||||
|
||||
<template>
|
||||
<div class="chat-window">
|
||||
<div class="chat-window__header">
|
||||
<span class="chat-window__header-avatar" />
|
||||
<span class="chat-window__header-name">专属客服</span>
|
||||
</div>
|
||||
|
||||
<div ref="scrollRef" class="chat-window__scroll">
|
||||
<template v-for="(item, index) in messages" :key="item.id">
|
||||
<div v-if="index === 0" class="chat-window__divider text-secondary">
|
||||
—— 历史消息 ——
|
||||
</div>
|
||||
<ChatMessageItem
|
||||
:message="item"
|
||||
:unread="isUnread(index)"
|
||||
@download="onDownload"
|
||||
/>
|
||||
<div v-if="index === 0" class="chat-window__divider text-secondary">
|
||||
—— 历史消息 ——
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
|
||||
@@ -61,35 +66,57 @@ watch(
|
||||
|
||||
<style lang="less" scoped>
|
||||
.chat-window {
|
||||
.flex(column, flex-start);
|
||||
.flex(column, flex-start, stretch);
|
||||
border-radius: @radius-lg;
|
||||
background: @bg-color;
|
||||
background: @white;
|
||||
box-shadow: @shadow-base;
|
||||
overflow: hidden;
|
||||
|
||||
// 设计 38:顶栏白底,高 60 × 0.77,下缘 #F0F1F3 分割线
|
||||
&__header {
|
||||
.flex(row, flex-start);
|
||||
gap: 11px; // 头像→文字 14 × 0.77
|
||||
height: 46px;
|
||||
padding: 0 16px; // 21 × 0.77
|
||||
border-bottom: 1px solid @project-divider;
|
||||
background: @white;
|
||||
}
|
||||
|
||||
// 设计 38:头像直径 36 × 0.77,实取 #024FFF
|
||||
&__header-avatar {
|
||||
flex-shrink: 0;
|
||||
width: 28px;
|
||||
height: 28px;
|
||||
border-radius: @radius-round;
|
||||
background: @primary-strong;
|
||||
}
|
||||
|
||||
// 设计 38:「专属客服」14 → 11 / 700 / #1F2937
|
||||
&__header-name {
|
||||
align-self: center;
|
||||
font-size: 11px;
|
||||
font-weight: 700;
|
||||
color: @heading-color;
|
||||
}
|
||||
|
||||
&__scroll {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 56px; // 消息组纵向间距(设计 38 组间 69~82 × 0.77)
|
||||
max-height: 60vh;
|
||||
min-height: 320px;
|
||||
padding: @spacing-lg;
|
||||
min-height: 347px; // 消息区高 451 × 0.77
|
||||
padding: 22px 16px; // 上 29 / 左右 21 × 0.77
|
||||
background: @bg-color-light; // 设计 38 消息区实取 #FAFBFC
|
||||
overflow-y: auto;
|
||||
.scrollbar();
|
||||
}
|
||||
|
||||
// 设计 38:时间分割文字 11 / #9CA3AF,短横已含在文案内,无两侧线
|
||||
&__divider {
|
||||
.flex(row, center);
|
||||
gap: @spacing-base;
|
||||
font-size: @font-size-sm;
|
||||
flex-shrink: 0;
|
||||
margin-bottom: -42px; // 分割线→首条 14(抵消组间距 56)
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
text-align: center;
|
||||
|
||||
&::before,
|
||||
&::after {
|
||||
content: '';
|
||||
flex: 1;
|
||||
height: 1px;
|
||||
background: @border-color;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -42,20 +42,33 @@ onMounted(() => {
|
||||
|
||||
<style lang="less" scoped>
|
||||
.service {
|
||||
.flex(column, flex-start);
|
||||
gap: @spacing-base;
|
||||
padding-top: @spacing-xl;
|
||||
padding-bottom: @spacing-xxl;
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: @spacing-base; // 头部→聊天卡 19 × 0.77
|
||||
max-width: @container-width;
|
||||
min-height: calc(100vh - @header-height);
|
||||
margin: 0 auto;
|
||||
padding: 25px @spacing-base @spacing-xxl; // 标题上留白 32 × 0.77
|
||||
background: @white; // 设计 38 页面底色为纯白
|
||||
|
||||
&__title {
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
// 设计 38:头部文案左缩进 42 × 0.77(标题 x112 相对内容边 x70)
|
||||
&__head {
|
||||
padding-left: 32px;
|
||||
}
|
||||
|
||||
// 设计 38:大标题 36 → 28 / 700 / #121212
|
||||
&__title {
|
||||
font-size: @font-size-xxl;
|
||||
font-weight: 700;
|
||||
color: @home-ink;
|
||||
}
|
||||
|
||||
// 设计 38:副标题 24 → 18 / 500 / #666666
|
||||
&__subtitle {
|
||||
margin-top: @spacing-xs;
|
||||
font-size: @font-size-base;
|
||||
margin-top: 12px; // 标题→副标题 15 × 0.77
|
||||
font-size: 18px;
|
||||
font-weight: 500;
|
||||
line-height: 1.5;
|
||||
color: @contract-muted;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user