mirror of
https://github.com/kuaifan/dootask.git
synced 2026-02-01 18:38:13 +00:00
perf: 未读消息优化
This commit is contained in:
parent
1a62a47935
commit
85d88b6800
@ -616,13 +616,14 @@ class DialogController extends AbstractController
|
|||||||
$dialogUser->updated_at = Carbon::now();
|
$dialogUser->updated_at = Carbon::now();
|
||||||
$dialogUser->save();
|
$dialogUser->save();
|
||||||
//
|
//
|
||||||
$dialogUser->webSocketDialog->generateUnread($user->userid);
|
$dialogUser->webSocketDialog->generateUnread($user->userid, true);
|
||||||
$data[] = [
|
$data[] = [
|
||||||
'id' => $dialogUser->webSocketDialog->id,
|
'id' => $dialogUser->webSocketDialog->id,
|
||||||
'unread' => $dialogUser->webSocketDialog->unread,
|
'unread' => $dialogUser->webSocketDialog->unread,
|
||||||
'mention' => $dialogUser->webSocketDialog->mention,
|
'mention' => $dialogUser->webSocketDialog->mention,
|
||||||
|
'position_msgs' => $dialogUser->webSocketDialog->position_msgs,
|
||||||
'user_at' => Carbon::parse($dialogUser->updated_at)->toDateTimeString('millisecond'),
|
'user_at' => Carbon::parse($dialogUser->updated_at)->toDateTimeString('millisecond'),
|
||||||
'user_ms' => Carbon::parse($dialogUser->updated_at)->valueOf()
|
'user_ms' => Carbon::parse($dialogUser->updated_at)->valueOf(),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
return Base::retSuccess('success', $data);
|
return Base::retSuccess('success', $data);
|
||||||
|
|||||||
@ -136,10 +136,10 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!--跳转提示-->
|
<!--跳转提示-->
|
||||||
<div v-if="positionMsg" class="dialog-position" :class="{'down': tagShow}">
|
<div v-if="positionMsg" class="dialog-position" :class="{'down': true}">
|
||||||
<div class="position-label" @click="onPositionMark">
|
<div class="position-label" @click="onPositionMark">
|
||||||
<Icon v-if="positionLoad > 0" type="ios-loading" class="icon-loading"></Icon>
|
<Icon v-if="positionLoad > 0" type="ios-loading" class="icon-loading"></Icon>
|
||||||
<i v-else class="taskfont"></i>
|
<i v-else class="taskfont" :class="{'below': positionLoadMark}"></i>
|
||||||
{{positionMsg.label}}
|
{{positionMsg.label}}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -694,6 +694,7 @@ export default {
|
|||||||
scrollTmp: 0,
|
scrollTmp: 0,
|
||||||
|
|
||||||
positionLoad: 0,
|
positionLoad: 0,
|
||||||
|
positionLoadMark: false,
|
||||||
|
|
||||||
approveDetails:{id: 0},
|
approveDetails:{id: 0},
|
||||||
approveDetailsShow: false,
|
approveDetailsShow: false,
|
||||||
@ -1036,6 +1037,7 @@ export default {
|
|||||||
watch: {
|
watch: {
|
||||||
dialogId: {
|
dialogId: {
|
||||||
handler(dialog_id, old_id) {
|
handler(dialog_id, old_id) {
|
||||||
|
this.positionLoadMark = false;
|
||||||
this.mountedNow = Date.now();
|
this.mountedNow = Date.now();
|
||||||
if (dialog_id) {
|
if (dialog_id) {
|
||||||
this.msgNew = 0
|
this.msgNew = 0
|
||||||
@ -2996,6 +2998,7 @@ export default {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
this.positionLoadMark = true;
|
||||||
this.positionLoad++
|
this.positionLoad++
|
||||||
const {msg_id} = this.positionMsg;
|
const {msg_id} = this.positionMsg;
|
||||||
this.onPositionId(msg_id).finally(_ => {
|
this.onPositionId(msg_id).finally(_ => {
|
||||||
|
|||||||
@ -1392,6 +1392,9 @@
|
|||||||
height: 14px;
|
height: 14px;
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
line-height: 14px;
|
line-height: 14px;
|
||||||
|
&.below{
|
||||||
|
transform: rotate(-180deg);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user