添加已读

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

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

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

Loading…
Cancel
Save