feat 在线客服
This commit is contained in:
@@ -29,9 +29,9 @@ const emojiMap: Record<MessageType, string> = {
|
||||
<div class="message-item__body">
|
||||
<div class="message-item__head">
|
||||
<span class="message-item__title">{{ message.title }}</span>
|
||||
<span class="message-item__time text-secondary">{{ message.publishTime }}</span>
|
||||
<span class="message-item__time">{{ message.publishTime }}</span>
|
||||
</div>
|
||||
<p class="message-item__summary text-secondary">
|
||||
<p class="message-item__summary">
|
||||
{{ message.summary }}
|
||||
</p>
|
||||
</div>
|
||||
@@ -42,11 +42,13 @@ const emojiMap: Record<MessageType, string> = {
|
||||
<style lang="less" scoped>
|
||||
.message-item {
|
||||
position: relative;
|
||||
.flex(row, flex-start);
|
||||
gap: @spacing-base;
|
||||
padding: 14px 17px;
|
||||
.flex(row, flex-start, flex-start);
|
||||
gap: 16px;
|
||||
min-height: 86px;
|
||||
padding: 19px 29px;
|
||||
background: @white;
|
||||
cursor: pointer;
|
||||
box-sizing: border-box;
|
||||
transition: background 0.2s;
|
||||
|
||||
&:hover {
|
||||
@@ -56,60 +58,63 @@ const emojiMap: Record<MessageType, string> = {
|
||||
&__emoji {
|
||||
flex-shrink: 0;
|
||||
.flex(row, center);
|
||||
width: 31px;
|
||||
height: 31px;
|
||||
width: 42px;
|
||||
height: 42px;
|
||||
border-radius: @radius-round;
|
||||
background: @message-icon-bg;
|
||||
font-size: 15px;
|
||||
background: @message-item-icon;
|
||||
font-size: 20px;
|
||||
line-height: 1;
|
||||
}
|
||||
|
||||
&__body {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 5px;
|
||||
gap: 8px;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
margin-top: 6px;
|
||||
}
|
||||
|
||||
&__head {
|
||||
.flex(row, space-between);
|
||||
.flex(row, space-between, flex-start);
|
||||
gap: @spacing-base;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
&__title {
|
||||
font-size: 11px;
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
color: @heading-color;
|
||||
line-height: 20px;
|
||||
color: @finance-ink;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__time {
|
||||
flex-shrink: 0;
|
||||
font-size: 11px;
|
||||
color: @text-color-disabled;
|
||||
font-size: 12px;
|
||||
line-height: 20px;
|
||||
color: @message-tabs-text;
|
||||
}
|
||||
|
||||
&__summary {
|
||||
font-size: 11px;
|
||||
font-size: 12px;
|
||||
line-height: 18px;
|
||||
color: @message-tabs-text;
|
||||
.ellipsis();
|
||||
}
|
||||
|
||||
&__dot {
|
||||
position: absolute;
|
||||
top: 12px;
|
||||
left: 42px;
|
||||
width: 15px;
|
||||
height: 15px;
|
||||
top: 21px;
|
||||
left: 60px;
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border: 2px solid @white;
|
||||
border-radius: @radius-round;
|
||||
background: @danger-color;
|
||||
background: @message-tabs-badge;
|
||||
box-sizing: content-box;
|
||||
}
|
||||
|
||||
&.is-unread {
|
||||
.message-item__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
&.is-unread .message-item__title {
|
||||
font-weight: 600;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -31,19 +31,20 @@ const emit = defineEmits<{ view: [id: string] }>()
|
||||
.message-list {
|
||||
.flex(column, flex-start, stretch);
|
||||
gap: 0;
|
||||
margin-top: 16px;
|
||||
padding: 0;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
overflow: hidden;
|
||||
|
||||
.message-item + .message-item {
|
||||
border-top: 1px solid @project-divider;
|
||||
border-top: 1px solid @finance-card-line;
|
||||
}
|
||||
|
||||
&__empty {
|
||||
padding: 40px 0;
|
||||
padding: 60px 0;
|
||||
text-align: center;
|
||||
font-size: 11px;
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,16 +1,10 @@
|
||||
<script setup lang="ts">
|
||||
import type { MessageTabCounts } from '@/stores/modules/message'
|
||||
import type { MessageType } from '@/types/business/message'
|
||||
|
||||
interface Counts {
|
||||
all: number
|
||||
在线客服: number
|
||||
状态通知: number
|
||||
系统通知: number
|
||||
}
|
||||
|
||||
interface Props {
|
||||
active: MessageType | 'all'
|
||||
counts: Counts
|
||||
counts: MessageTabCounts
|
||||
}
|
||||
|
||||
defineProps<Props>()
|
||||
@@ -24,7 +18,7 @@ const tabs: Array<{ label: string; value: MessageType | 'all' }> = [
|
||||
{ label: '系统通知', value: '系统通知' },
|
||||
]
|
||||
|
||||
function countOf(value: MessageType | 'all', counts: Counts): number {
|
||||
function countOf(value: MessageType | 'all', counts: MessageTabCounts): number {
|
||||
return counts[value]
|
||||
}
|
||||
</script>
|
||||
@@ -47,23 +41,25 @@ function countOf(value: MessageType | 'all', counts: Counts): number {
|
||||
<style lang="less" scoped>
|
||||
.message-tabs {
|
||||
.flex(column, flex-start, stretch);
|
||||
padding: 18px 0;
|
||||
min-height: 338px;
|
||||
gap: 0;
|
||||
height: 438px;
|
||||
padding: 14px 0;
|
||||
border-radius: @radius-base;
|
||||
background: @white;
|
||||
box-shadow: none;
|
||||
box-sizing: border-box;
|
||||
|
||||
&__tab {
|
||||
.flex(row, space-between);
|
||||
.flex(row, space-between, center);
|
||||
gap: @spacing-sm;
|
||||
height: 32px;
|
||||
padding: 0 18px 0 25px;
|
||||
height: 44px;
|
||||
padding: 0 25px;
|
||||
border-radius: 0;
|
||||
background: transparent;
|
||||
color: @text-color;
|
||||
font-size: 11px;
|
||||
color: @message-tabs-text;
|
||||
font-size: 13px;
|
||||
font-weight: 400;
|
||||
transition: all 0.2s;
|
||||
line-height: 18px;
|
||||
transition: color 0.2s;
|
||||
|
||||
&:hover {
|
||||
color: @primary-strong;
|
||||
@@ -77,21 +73,18 @@ function countOf(value: MessageType | 'all', counts: Counts): number {
|
||||
}
|
||||
|
||||
&__count {
|
||||
flex-shrink: 0;
|
||||
min-width: 15px;
|
||||
height: 15px;
|
||||
padding: 0 4px;
|
||||
border-radius: @radius-round;
|
||||
background: @danger-color;
|
||||
background: @message-tabs-badge;
|
||||
color: @white;
|
||||
font-size: 11px;
|
||||
font-size: 10px;
|
||||
font-weight: 400;
|
||||
line-height: 15px;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.is-active &__count {
|
||||
background: @danger-color;
|
||||
color: @white;
|
||||
font-weight: 600;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user