Skip to content

Commit

Permalink
perf: 消息已完成图标布局优化
Browse files Browse the repository at this point in the history
  • Loading branch information
kuaifan committed Apr 2, 2022
1 parent 08c46fd commit f846382
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 32 deletions.
4 changes: 2 additions & 2 deletions resources/assets/js/pages/manage/components/DialogWrapper.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
@dragover.prevent="chatDragOver(true, $event)"
@dragleave.prevent="chatDragOver(false, $event)">
<slot name="head">
<div class="dialog-nav">
<div class="dialog-nav" :class="{completed:$A.dialogCompleted(dialogData)}">
<div class="dialog-avatar">
<template v-if="dialogData.type=='group'">
<i v-if="dialogData.group_type=='project'" class="taskfont icon-avatar project">&#xe6f9;</i>
<i v-else-if="dialogData.group_type=='task'" class="taskfont icon-avatar task" :class="{completed:$A.dialogCompleted(dialogData)}">&#xe6f4;</i>
<i v-else-if="dialogData.group_type=='task'" class="taskfont icon-avatar task">&#xe6f4;</i>
<Icon v-else class="icon-avatar" type="ios-people" />
</template>
<div v-else-if="dialogData.dialog_user" class="user-avatar"><UserAvatar :userid="dialogData.dialog_user.userid" :size="42"/></div>
Expand Down
3 changes: 2 additions & 1 deletion resources/assets/js/pages/manage/messenger.vue
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,13 @@
top: dialog.top_at,
active: dialog.id == dialogId,
operate: dialog.id == topOperateItem.id && topOperateVisible,
completed: $A.dialogCompleted(dialog)
}"
@click="openDialog(dialog, true)"
@contextmenu.prevent.stop="handleRightClick($event, dialog)">
<template v-if="dialog.type=='group'">
<i v-if="dialog.group_type=='project'" class="taskfont icon-avatar project">&#xe6f9;</i>
<i v-else-if="dialog.group_type=='task'" class="taskfont icon-avatar task" :class="{completed:$A.dialogCompleted(dialog)}">&#xe6f4;</i>
<i v-else-if="dialog.group_type=='task'" class="taskfont icon-avatar task">&#xe6f4;</i>
<Icon v-else class="icon-avatar" type="ios-people" />
</template>
<div v-else-if="dialog.dialog_user" class="user-avatar"><UserAvatar :userid="dialog.dialog_user.userid" :size="42"/></div>
Expand Down
34 changes: 19 additions & 15 deletions resources/assets/sass/pages/components/dialog-wrapper.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,25 @@
background-color: #f4f5f5;
}

&.completed {
&:after {
content: "\f373";
font-family: Ionicons, serif;
pointer-events: none;
position: absolute;
top: 50%;
right: 22px;
transform: translateY(-50%);
font-size: 40px;
color: #19be6b;
opacity: .2;
z-index: 1;
}
.dialog-title {
padding-right: 52px;
}
}

.dialog-avatar {
flex-shrink: 0;
margin-right: 12px;
Expand All @@ -52,21 +71,6 @@
background-color: #9B96DF;
font-size: 24px;
}
&.completed {
&:after {
content: "\f373";
font-family: Ionicons, serif;
pointer-events: none;
position: absolute;
top: 50%;
right: 22px;
transform: translateY(-50%);
font-size: 40px;
color: #19be6b;
opacity: .2;
z-index: 1;
}
}
}
}

Expand Down
33 changes: 19 additions & 14 deletions resources/assets/sass/pages/page-messenger.scss
Original file line number Diff line number Diff line change
Expand Up @@ -113,20 +113,6 @@
background-color: #9B96DF;
font-size: 24px;
}
&.completed {
&:after {
content: "\f373";
font-family: Ionicons, serif;
pointer-events: none;
position: absolute;
bottom: 0;
right: 12px;
font-size: 28px;
color: #19be6b;
opacity: .2;
z-index: 1;
}
}
}
.dialog-box {
flex: 1;
Expand Down Expand Up @@ -212,6 +198,25 @@
margin: 0;
}
}
&.completed {
&:after {
content: "\f373";
font-family: Ionicons, serif;
pointer-events: none;
position: absolute;
bottom: 0;
right: 12px;
font-size: 28px;
color: #19be6b;
opacity: .2;
z-index: 1;
}
.dialog-box {
.dialog-text {
padding-right: 36px;
}
}
}
}
}
&.contacts {
Expand Down

0 comments on commit f846382

Please sign in to comment.