no message

This commit is contained in:
kuaifan 2022-05-25 11:35:04 +08:00
parent 844cdd734e
commit c5a0e04242
9 changed files with 23 additions and 7 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -64,9 +64,11 @@
@onScroll="onScroll"
class="dialog-scroller overlay-y">
<template #before>
<div v-if="dialogData.hasMorePages" class="dialog-item history" @click="loadNextPage">{{$L('加载历史消息')}}</div>
<div v-else-if="dialogData.loading > 0 && dialogMsgList.length === 0" class="dialog-item loading"><Loading/></div>
<div v-else-if="dialogMsgList.length === 0" class="dialog-item nothing">{{$L('暂无消息')}}</div>
<template v-if="allMsgs.length === 0">
<div v-if="dialogData.loading > 0" class="dialog-item loading"><Loading/></div>
<div v-else class="dialog-item nothing">{{$L('暂无消息')}}</div>
</template>
<div v-else-if="dialogData.hasMorePages" class="dialog-item history" @click="loadNextPage">{{$L('加载历史消息')}}</div>
</template>
<template v-slot="{ item, index, active }">
<DynamicScrollerItem
@ -89,7 +91,7 @@
</DynamicScrollerItem>
</template>
</DynamicScroller>
<div :class="['dialog-footer', msgNew > 0 && dialogMsgList.length > 0 ? 'newmsg' : '']" @click="onActive">
<div :class="['dialog-footer', msgNew > 0 && allMsgs.length > 0 ? 'newmsg' : '']" @click="onActive">
<div class="dialog-newmsg" @click="onToBottom">{{$L('' + msgNew + '条新消息')}}</div>
<div class="dialog-input">
<slot name="inputBefore"/>
@ -335,11 +337,16 @@ export default {
if (id) {
this.msgNew = 0;
this.topId = -1;
if (this.dialogMsgList.length > 0) {
setTimeout(this.onToBottom, 10);
let cacheTimer = null;
if (this.allMsgList.length > 0) {
cacheTimer = setTimeout(_ => {
this.allMsgs = this.allMsgList;
this.onToBottom();
}, 1);
}
const startTime = new Date().getTime();
this.$store.dispatch("getDialogMsgs", id).then(_ => {
cacheTimer && clearTimeout(cacheTimer);
setTimeout(this.onToBottom, Math.max(0, 100 - (new Date().getTime() - startTime)));
}).catch(_ => {});
}

View File

@ -27,7 +27,10 @@
<div class="percent-info" @click.stop="modalPercent(item)">{{item.task_my_complete}}<em>/{{item.task_my_num}}</em></div>
</div>
<div class="project-footer">
<div class="footer-percent" @click.stop="modalPercent(item)">{{item.task_complete}}<em>/{{item.task_num}}</em></div>
<div class="footer-percent" @click.stop="modalPercent(item)">
<i class="taskfont">&#xe641;</i>
{{item.task_complete}}<em>/{{item.task_num}}</em>
</div>
<div class="footer-user">
<UserAvatar v-for="(uid, ukey) in item.user_simple" :key="ukey" :userid="uid" :size="26" :borderWitdh="2"/>
<div v-if="item.user_count > 3" class="footer-user-more">{{item.user_count > 99 ? '99+' : `${item.user_count}+`}}</div>

View File

@ -105,6 +105,12 @@
margin-right: 12px;
min-width: 28px;
text-align: left;
display: flex;
align-items: center;
.taskfont {
font-size: 14px;
padding-right: 4px;
}
> em {
opacity: 0.7;
font-style: normal;