From c1f81a8e5c4ab8a74f2619dcb98a570aad2d1ba6 Mon Sep 17 00:00:00 2001 From: zdg Date: Fri, 23 Aug 2024 10:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=20=E7=82=B9=E8=B5=9E?= =?UTF-8?q?=EF=BC=8C=E7=96=91=E6=83=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/renderer/src/plugins/imChat/index.js | 4 +- .../src/views/tool/components/homework.vue | 3 +- .../src/views/tool/components/upvote.vue | 127 +++++++++++++++--- src/renderer/src/views/tool/sphere.vue | 12 +- 4 files changed, 120 insertions(+), 26 deletions(-) diff --git a/src/renderer/src/plugins/imChat/index.js b/src/renderer/src/plugins/imChat/index.js index ed48817..3b42935 100644 --- a/src/renderer/src/plugins/imChat/index.js +++ b/src/renderer/src/plugins/imChat/index.js @@ -169,12 +169,12 @@ export class ImChat { logout() { if (!this.timChat) return return this.timChat.TIMLogout().then(res => { - console.log('登出成功', res) + this.setConsole('%cim-chat: logout', '登出成功') this.status.isLogin = false this.timChat.TIMUninit() // 反初始化 return res }).catch(error => { - console.log('登出失败', error) + this.setConsole('%cim-chat: logout', '登出失败', error) return error }) } diff --git a/src/renderer/src/views/tool/components/homework.vue b/src/renderer/src/views/tool/components/homework.vue index 955b03b..09daa2c 100644 --- a/src/renderer/src/views/tool/components/homework.vue +++ b/src/renderer/src/views/tool/components/homework.vue @@ -77,7 +77,7 @@ import { getSmarttalkPage, getPrepareById } from '@/api/file' import SetHomework from '@/views/prepare/container/set-homework.vue' import FileImage from '@/components/file-image/index.vue' import { useGetHomework } from '@/hooks/useGetHomework' -import { ipcMsgSend, ipcMsgInvoke } from '@/utils/tool' +import { ipcMsgSend, ipcMsgSend2, ipcMsgInvoke } from '@/utils/tool' import { useToolState } from '@/store/modules/tool' import { asyncLocalFile } from '@/utils/talkFile' import Lesson from './lesson.vue'; @@ -113,6 +113,7 @@ const sendHomework = (row) => { const closeHomework = async() => { ipcMsgSend('tool-sphere:set:ignore', true) // 发送im消息-推送作业(app|平板) + console.log('发送im消息-推送作业(app|平板)', curRow.value.id) await ipcMsgInvoke('im-chat:msg', curRow.value.id, MsgEnum.HEADS.MSG_0016) setDialog.value = false } diff --git a/src/renderer/src/views/tool/components/upvote.vue b/src/renderer/src/views/tool/components/upvote.vue index 8f12e4f..91c1fcc 100644 --- a/src/renderer/src/views/tool/components/upvote.vue +++ b/src/renderer/src/views/tool/components/upvote.vue @@ -1,9 +1,15 @@ \ No newline at end of file diff --git a/src/renderer/src/views/tool/sphere.vue b/src/renderer/src/views/tool/sphere.vue index 6e9d9fe..cef6cde 100644 --- a/src/renderer/src/views/tool/sphere.vue +++ b/src/renderer/src/views/tool/sphere.vue @@ -7,7 +7,7 @@ - + @@ -67,7 +67,8 @@ const classObj = reactive({ // 课程相关 data: {} // 课程信息 }) const msgIds = [] // 消息id -const btnList = [ // 工具栏按钮列表 +const electron = window.electron // electron +const btnList = [ // 工具栏按钮列表 { label: '选择', value: 'select', icon: 'icon-mouse' }, { label: '画笔', value: 'brush', icon: 'icon-huabi' }, { label: '板擦', value: 'erase', icon: 'icon-xiangpica' }, @@ -78,9 +79,10 @@ const btnList = [ // 工具栏按钮列表 ] // === 页面加载完毕 === onMounted(async() => { - getClassInfo() // 获取课堂详情 ex3 + if (!electron) return // 浏览器端 + getClassInfo() // 获取课堂详情 ex3 setTimeout(() => { - resetStatus() // 开启重置状态-监听 + resetStatus() // 开启重置状态-监听 }, 200); }) @@ -130,7 +132,7 @@ const chatChange = (type, data, ...args) => { case MsgEnum.HEADS.MSG_0002: // 疑惑 // console.log('点赞:', data) if(msgIds.includes(msgId)) return // 忽略重复-点赞消息 - upvoteRef.value.trigger(data.name) // 触发点赞|疑惑 + upvoteRef.value.trigger(head, data.name) // 触发点赞|疑惑 if (msgIds.length >= 100) msgIds.shift() // 删除第一个 msgIds.push(msgId) // 添加到数组 break