添加已读

fix/im-0526
ch 3 years ago
parent 2a63673248
commit fed8881529

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 17:48:12
* @LastEditors: ch
* @LastEditTime: 2022-05-27 10:56:40
* @LastEditTime: 2022-05-27 11:09:52
* @Description: file content
-->
@ -49,7 +49,7 @@
</template>
<script>
import UiEmpty from "@/components/UiEmpty.vue";
import {FormatDate} from '@/plugins/utils'
import {FormatDate, CreatUuid} from '@/plugins/utils'
export default {
components: { UiEmpty },
data() {
@ -68,20 +68,24 @@ export default {
mounted() {
// console.log(`socketMsgData`, this.$store.state);
setTimeout(()=>{
this.readMsg()
},2000)
this.readMsg();
},5000)
},
methods: {
/**
* 把当前会话消息置为已读
*/
async readMsg(){
this.Socket.setRead({
content: {
sessionId : this.msgData[0].sessionId
}
});
readMsg(){
this.Socket.send(JSON.stringify({
traceId : CreatUuid(),
traceType : "6",
content: {
sessionId : this.msgData[0].sessionId
}
}));
this.$store.commit("setUnreadCount", 0);
},
/**

@ -2,7 +2,7 @@
* @Author: ch
* @Date: 2022-05-04 21:57:26
* @LastEditors: ch
* @LastEditTime: 2022-05-04 22:24:07
* @LastEditTime: 2022-05-27 11:07:04
* @Description: file content
*/
@ -11,7 +11,7 @@ import {
toAsyncAwait as ToAsyncAwait,
isPhone as IsPhone,
formatDate as FormatDate,
createUUID as CreateUUID,
creatUuid as CreatUuid,
toSearchJson as ToSearchJson
} from "js-util-all"
@ -45,7 +45,7 @@ export {
// 时间格式化
FormatDate,
// 创建UUID
CreateUUID,
CreatUuid,
// 请求Search参数转化为JSON格式
ToSearchJson,
// 防抖函数

Loading…
Cancel
Save