Commit b2c13510 by Sixong.Zhu

style

parent 3e149803
Showing with 25 additions and 16 deletions
...@@ -91,9 +91,12 @@ ...@@ -91,9 +91,12 @@
</div> </div>
</div> </div>
<span v-if="showTs" class="ts" :class="{ right: isMyMessage }">{{ <span
ts v-if="showTs"
}}</span> class="ts"
:class="{ right: isMyMessage, offset: showWithdraw }"
>{{ ts }}</span
>
</div> </div>
<i <i
...@@ -103,17 +106,7 @@ ...@@ -103,17 +106,7 @@
></i> ></i>
<i class="el-icon-loading" v-else-if="isSendingMessage"></i> <i class="el-icon-loading" v-else-if="isSendingMessage"></i>
<span <span class="withdraw" v-if="showWithdraw" @click="withdraw"
class="withdraw"
v-if="
isMyMessage &&
canWithdraw &&
isWithdraw &&
!isWithdrawMessage &&
!isQuestionAnswerMessage &&
isChatMember
"
@click="withdraw"
>撤回此消息</span >撤回此消息</span
> >
...@@ -285,7 +278,18 @@ ...@@ -285,7 +278,18 @@
private showTsTimer = 0; private showTsTimer = 0;
private get ts() { private get ts() {
return this.data && formatTime(this.data.ts); return this.data && formatTime(this.data.ts, { mini: true });
}
private get showWithdraw() {
return (
this.isMyMessage &&
this.canWithdraw &&
this.isWithdraw &&
!this.isWithdrawMessage &&
!this.isQuestionAnswerMessage &&
this.isChatMember
);
} }
private get isSystemMessage() { private get isSystemMessage() {
...@@ -826,6 +830,10 @@ ...@@ -826,6 +830,10 @@
&.right { &.right {
right: 40px; right: 40px;
left: unset; left: unset;
&.offset {
right: 70px;
}
} }
} }
</style> </style>
......
...@@ -146,6 +146,7 @@ function formatTime2ShortYearMonthDate(time: Date) { ...@@ -146,6 +146,7 @@ function formatTime2ShortYearMonthDate(time: Date) {
interface FormatOption { interface FormatOption {
rule?: TimeFormatRule; rule?: TimeFormatRule;
short?: boolean; short?: boolean;
mini?: boolean;
} }
/** /**
...@@ -198,7 +199,7 @@ export function formatTime( ...@@ -198,7 +199,7 @@ export function formatTime(
return "昨天 " + format2DetailTime(hour, t, option.rule); return "昨天 " + format2DetailTime(hour, t, option.rule);
} }
if (isIn6Days(t)) { if (isIn6Days(t) && !option.mini) {
if (option.short) { if (option.short) {
return `星期${getDayInWeek(t)}`; return `星期${getDayInWeek(t)}`;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment