no message

This commit is contained in:
kuaifan 2022-05-21 20:03:18 +08:00
parent 2ab12f74ee
commit df1d5d97c4
4 changed files with 13 additions and 8 deletions

View File

@ -102,13 +102,11 @@
* @returns {*|string} * @returns {*|string}
*/ */
formatTime(date) { formatTime(date) {
let time = $A.Date(date, true), let now = $A.Time(),
now = $A.Time(), time = $A.Date(date, true),
string = ''; string = '';
if ($A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) { if (now - time < 3600 * 6 || $A.formatDate('Ymd', now) === $A.formatDate('Ymd', time)) {
string = $A.formatDate('H:i', time) string = $A.formatDate('H:i', time)
} else if (now - time < 86400 * 7) {
string = $A.formatDate('m-d H:i', time)
} else if ($A.formatDate('Y', now) === $A.formatDate('Y', time)) { } else if ($A.formatDate('Y', now) === $A.formatDate('Y', time)) {
string = $A.formatDate('m-d', time) string = $A.formatDate('m-d', time)
} else { } else {

View File

@ -907,7 +907,10 @@ export default {
return; // return; //
} }
// //
const {id, dialog_id, type, msg} = data; const {id, dialog_id, type, msg, userid} = data;
if (userid == this.userId) {
return; //
}
let body = ''; let body = '';
switch (type) { switch (type) {
case 'text': case 'text':

View File

@ -47,7 +47,8 @@
<!--时间/阅读--> <!--时间/阅读-->
<div v-if="msgData.created_at" class="dialog-foot"> <div v-if="msgData.created_at" class="dialog-foot">
<div class="time" :title="msgData.created_at">{{$A.formatTime(msgData.created_at)}}</div> <div v-if="timeShow" class="time" @click="timeShow=false">{{msgData.created_at}}</div>
<div v-else class="time" :title="msgData.created_at" @click="timeShow=true">{{$A.formatTime(msgData.created_at)}}</div>
<div v-if="msgData.send > 1 || dialogType === 'group'" class="percent" @click="openReadPercentage"> <div v-if="msgData.send > 1 || dialogType === 'group'" class="percent" @click="openReadPercentage">
<EPopover <EPopover
@ -106,6 +107,7 @@ export default {
return { return {
popperLoad: 0, popperLoad: 0,
popperShow: false, popperShow: false,
timeShow: false,
allList: [], allList: [],
} }
}, },

View File

@ -526,7 +526,9 @@ export default {
updateDialogs() { updateDialogs() {
this.__updateDialogs && clearTimeout(this.__updateDialogs) this.__updateDialogs && clearTimeout(this.__updateDialogs)
this.__updateDialogs = setTimeout(_ => { this.__updateDialogs = setTimeout(_ => {
if (this.tabActive === 'dialog') {
this.$store.dispatch("getDialogs", true).catch(() => {}); this.$store.dispatch("getDialogs", true).catch(() => {});
}
}, 2000) }, 2000)
}, },
} }