Commit 41f2cc74 by Sixong.Zhu

延迟撤回时间

parent c5752ec7
Showing with 27 additions and 6 deletions
......@@ -34,9 +34,14 @@
<span
@click="openReaderList"
class="pointer"
:class="{ all: isAllRead }"
:class="isAllRead ? 'all' : 'not-all'"
>
<template v-if="isAllRead">全部已读</template>
<template v-if="isAllRead">
<i
class="el-icon-circle-check"
title="全部已读"
></i>
</template>
<template
v-else-if="manualReaded || data.read_count"
>{{
......@@ -173,7 +178,7 @@
import { CustomerServiceEvent, MessageEvent } from "../event";
import { PayMessageBody } from "../xim/models/chat";
const twoMinutes = 2 * 60 * 1000;
const oneDay = 24 * 60 * 60 * 1000;
const messageMapping = new Map<dto.MessageType, string>([
[dto.MessageType.Image, "image-message"],
......@@ -274,6 +279,14 @@
private isWithdraw = true;
private get isSystemMessage() {
return (
this.messageBody &&
this.messageBody.eid &&
+this.messageBody.eid === 0
);
}
private get isPayMessage() {
return dto.MessageTypeController.isPayMessage(this.data.type);
}
......@@ -284,13 +297,16 @@
return true;
}
if (this.needReadTip) {
return new Date().valueOf() - this.data.ts * 1000 < twoMinutes;
return new Date().valueOf() - this.data.ts * 1000 < oneDay;
}
}
return false;
}
private get needReadTip() {
if (this.isSystemMessage) {
return false;
}
return (
this.data.type !== dto.MessageType.Pay &&
this.data.type !== dto.MessageType.Refund &&
......@@ -557,7 +573,7 @@
return false;
}
return (this.isWithdraw =
new Date().valueOf() - this.data.ts * 1000 < twoMinutes);
new Date().valueOf() - this.data.ts * 1000 < oneDay);
}
private openReaderList(e: MouseEvent) {
......@@ -719,7 +735,12 @@
}
.all {
color: #4389f8;
color: #ccc;
opacity: 0.7;
}
.not-all {
color: #077aec;
}
.match-keyword {
......
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