From 3591cc7fea8a17106d9795fb049847800903062b Mon Sep 17 00:00:00 2001 From: stapxs <1007028430.stapx@gmail.com> Date: Mon, 21 Oct 2024 13:25:23 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=A5=BD=E5=BF=99=E5=A5=BD=E5=BF=99=20?= =?UTF-8?q?=F0=9F=98=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :sparkles: 多选消息以及合并转发消息支持 :art: 优化统计信息提交,合并为同一个方法 :bug: 对 napcat 调整过的精华消息接口支持 :poop: UI Debug 模式彻底移除 --- README.md | 16 +- src/App.vue | 8 +- src/assets/css/append/append_new.css | 2 +- src/assets/css/chat.css | 54 +++++ src/assets/css/msg.css | 5 +- src/assets/l10n/en-US.po | 12 +- src/assets/l10n/zh-CN.po | 12 +- src/assets/l10n/zh-TW.po | 12 +- src/assets/l10n/zh-YUE.po | 12 +- src/assets/pathMap/NapCat.Onebot.yaml | 16 +- src/components/AboutPan.vue | 9 +- src/components/MsgBody.vue | 17 +- src/components/WelPan.vue | 5 +- src/components/msg-component/CardMessage.vue | 8 +- src/function/model/msg-body.ts | 84 ++++---- src/function/msg.ts | 12 +- src/function/option.ts | 17 +- src/function/utils/appUtil.ts | 31 +-- src/function/utils/msgUtil.ts | 7 +- src/pages/Chat.vue | 214 ++++++++++++++++--- src/pages/options/OptDev.vue | 16 +- src/pages/options/OptView.vue | 12 +- 22 files changed, 383 insertions(+), 198 deletions(-) diff --git a/README.md b/README.md index 548d4e8..8f60abe 100644 --- a/README.md +++ b/README.md @@ -47,7 +47,7 @@ Stapxs QQ Lite 需要一个 QQ Bot 后端提供服务,你可以参考 [📖 本仓库开启了 GitHub Pages, 所有向主分支提交的代码将会自动构建并发布。你可以直接访问 [🌎 这个页面](https://stapxs.github.io/Stapxs-QQ-Lite-2.0) 来使用已经构建并部署的页面。 ### > 安装应用 -除了直接使用本仓库的构建页面,你也可以下载使用 electron 打包的功能**稍稍**更丰富的客户端版本,访问 [📦️ 这儿](https://github.com/Stapxs/Stapxs-QQ-Lite-2.0/releases) 查看构建列表。 +除了直接使用本仓库的构建页面,你也可以下载使用 electron 打包的功能**稍稍**更丰富的客户端版本,访问 [📦️ 这儿](https://github.com/Stapxs/Stapxs-QQ-Lite-2.0/releases) 查看版本发布列表。 当然你也可以使用包管理来安装它,使用包管理安装将会更便于更新 Stapxs QQ Lite 而不用每次都从 Github 上手动更新,访问 [💬 这儿](https://github.com/Stapxs/Stapxs-QQ-Lite-2.0/issues/99) 来查看目前支持的包管理。 @@ -70,8 +70,16 @@ Stapxs QQ Lite 需要一个 QQ Bot 后端提供服务,你可以参考 [📖 - 如果有什么奇奇怪怪的问题, 欢迎发起 [issue]() 询问! 如果有什么 BUG 和优化建议也可以哦! ## 📦️ 构建应用 +为了规范对其他仓库的引用,Stapxs QQ Lite 2.0 仓库含有一些子模块,这意味着你需要在克隆仓库的时候包含子模块: +~~~bash +git clone https://github.com/Stapxs/Stapxs-QQ-Lite-2.0 --recursive +~~~ +如果你已经克隆了仓库,也可以使用这个来补全子模块: +~~~bash +git submodule update --init +~~~ ### > 构建 Web 页面 -Stapxs QQ Lite 2.0 是一个基于 Vue 的单页应用,这意味着如果你想自行部署到网页服务需要进行构建。 +Stapxs QQ Lite 2.0 是一个基于 Vue 的单页应用,这意味着如果你想自行部署到网页服务需要进行构建。当然你同样可以前往 [这儿](https://github.com/Stapxs/Stapxs-QQ-Lite-2.0/releases) 来下载预构建好的根目录文件包。 注意。在正式构建前,如果你的网站运作目录并不在根域名下,你需要修改(或增加)项目根目录下 `vue.config.js` 内导出的 `publicPath` 字段的值,它代表着最终你会运行在的目录,比如它在现在是 `/Stapxs-QQ-Lite-2.0/`;如果你本来就运行在根目录下,可以直接删去它。 @@ -112,5 +120,5 @@ yarn electron:build --linux ## 🎉 鸣谢 感谢这些小伙伴们在开发和文本中提供的支持 —— - - + + diff --git a/src/App.vue b/src/App.vue index 4b9305f..3de0a76 100644 --- a/src/App.vue +++ b/src/App.vue @@ -269,7 +269,9 @@ export default defineComponent({ */ changeTab (name: string, view: string, show: boolean) { // UM:发送页面路由分析 - Umami.trackPageView('/' + view) + if (!Option.get('close_ga') && process.env.NODE_ENV == 'production') { + Umami.trackPageView('/' + view) + } this.tags.showChat = show this.tags.page = view }, @@ -534,7 +536,9 @@ export default defineComponent({ } Umami.initialize(config) } else if (process.env.NODE_ENV == 'development') { - logger.debug('由于运行在调试模式下,分析组件并未加载 ……') + logger.debug('由于运行在调试模式下,分析组件并未初始化 ……') + } else if (Option.get('close_ga')) { + logger.debug('统计功能已被关闭,分析组件并未初始化 ……') } App.checkUpdate() // 检查更新 App.checkOpenTimes() // 检查打开次数 diff --git a/src/assets/css/append/append_new.css b/src/assets/css/append/append_new.css index 2e8133f..d07227f 100644 --- a/src/assets/css/append/append_new.css +++ b/src/assets/css/append/append_new.css @@ -566,7 +566,7 @@ max-width: 30%; } .app-msg > div > a { - font-size: 0.87rem; + font-size: 0.75rem; } .app-msg > div > div:first-child > svg { margin-top: 3px; diff --git a/src/assets/css/chat.css b/src/assets/css/chat.css index 977dccd..9bcae14 100644 --- a/src/assets/css/chat.css +++ b/src/assets/css/chat.css @@ -1297,6 +1297,60 @@ input { flex: 1; } +.select-tag { + background: var(--color-card-1); + justify-content: space-evenly; + margin: 0 20px 10px 20px; + transition: all .3s; + align-items: center; + flex-direction: row; + border-radius: 7px; + overflow: hidden; + display: flex; + height: 0; +} +.select-tag.show { + margin: 0 20px 10px 20px; + margin-top: 20px; + padding: 15px 10px; + height: auto; +} +.select-tag > div { + flex-direction: column; + align-items: center; + display: flex; +} +.select-tag > div > svg, +.select-tag > div > span:first-child { + background: var(--color-card-2); + color: var(--color-font-1); + border-radius: 100%; + cursor: pointer; + height: 0.8rem; + width: 0.8rem; + padding: 15px; +} +.select-tag > div > span:first-child { + border: 1px solid var(--color-main); + text-align: center; + font-weight: bold; + color: var(--color-font); + font-size: calc(0.8rem + 3px); + padding: 12px 15px 18px 15px; +} +.select-tag > div > span { + color: var(--color-font-2); + font-size: 0.75rem; + margin-top: 5px; +} + +.msg-select-tag { + +} +msg-select-tag > svg { + +} + .replay-tag { background: var(--color-card-1); margin: 0 20px -10px 20px; diff --git a/src/assets/css/msg.css b/src/assets/css/msg.css index 0f8b05a..f480ba9 100644 --- a/src/assets/css/msg.css +++ b/src/assets/css/msg.css @@ -14,6 +14,9 @@ flex-wrap: wrap; transition: opacity 0.3s; } +.message.selected { + background: #00000008; +} .message.forward { border: 2px solid var(--color-card-2); width: calc(100% - 45px); @@ -81,7 +84,7 @@ .message-body > span { font-size: 0.7rem; background: var(--color-main); - color: #fff; + color: var(--color-font-r); border-radius: 10px; padding: 1px 4px; } diff --git a/src/assets/l10n/en-US.po b/src/assets/l10n/en-US.po index a146933..7abb5fa 100644 --- a/src/assets/l10n/en-US.po +++ b/src/assets/l10n/en-US.po @@ -503,10 +503,6 @@ msgstr "{readNum} read | {isRead}" msgid "公告" msgstr "Announcements" -#: src/pages/options/OptDev.vue:139 -msgid "页面测试" -msgstr "UI test" - #: src/pages/options/OptDev.vue:140 msgid "让我康康 ~" msgstr "Show test interfaces" @@ -1443,3 +1439,11 @@ msgstr "" #: src/function/utils/msgUtil.ts:231 msgid "视频" msgstr "" + +#: src/pages/Chat.vue:159 +msgid "合并转发" +msgstr "" + +#: src/pages/Chat.vue:163 +msgid "截图" +msgstr "" \ No newline at end of file diff --git a/src/assets/l10n/zh-CN.po b/src/assets/l10n/zh-CN.po index 55afdd9..8f22f45 100644 --- a/src/assets/l10n/zh-CN.po +++ b/src/assets/l10n/zh-CN.po @@ -504,10 +504,6 @@ msgstr "" msgid "公告" msgstr "" -#: src/pages/options/OptDev.vue:139 -msgid "页面测试" -msgstr "" - #: src/pages/options/OptDev.vue:140 msgid "让我康康 ~" msgstr "" @@ -1440,3 +1436,11 @@ msgstr "" #: src/function/utils/msgUtil.ts:231 msgid "视频" msgstr "" + +#: src/pages/Chat.vue:159 +msgid "合并转发" +msgstr "" + +#: src/pages/Chat.vue:163 +msgid "截图" +msgstr "" \ No newline at end of file diff --git a/src/assets/l10n/zh-TW.po b/src/assets/l10n/zh-TW.po index 8ca6607..54c464e 100644 --- a/src/assets/l10n/zh-TW.po +++ b/src/assets/l10n/zh-TW.po @@ -504,10 +504,6 @@ msgstr "{readNum} 人已讀 | {isRead}" msgid "公告" msgstr "公告" -#: src/pages/options/OptDev.vue:139 -msgid "页面测试" -msgstr "頁面測試" - #: src/pages/options/OptDev.vue:140 msgid "让我康康 ~" msgstr "「讓我看看!!!」" @@ -1440,3 +1436,11 @@ msgstr "" #: src/function/utils/msgUtil.ts:231 msgid "视频" msgstr "" + +#: src/pages/Chat.vue:159 +msgid "合并转发" +msgstr "" + +#: src/pages/Chat.vue:163 +msgid "截图" +msgstr "" \ No newline at end of file diff --git a/src/assets/l10n/zh-YUE.po b/src/assets/l10n/zh-YUE.po index a31dc2a..b44a725 100644 --- a/src/assets/l10n/zh-YUE.po +++ b/src/assets/l10n/zh-YUE.po @@ -504,10 +504,6 @@ msgstr "{readNum} 人已讀 | {isRead}" msgid "公告" msgstr "公告" -#: src/pages/options/OptDev.vue:139 -msgid "页面测试" -msgstr "頁面測試" - #: src/pages/options/OptDev.vue:140 msgid "让我康康 ~" msgstr "點解我要 OT 啊?" @@ -1440,3 +1436,11 @@ msgstr "" #: src/function/utils/msgUtil.ts:231 msgid "视频" msgstr "" + +#: src/pages/Chat.vue:159 +msgid "合并转发" +msgstr "" + +#: src/pages/Chat.vue:163 +msgid "截图" +msgstr "" \ No newline at end of file diff --git a/src/assets/pathMap/NapCat.Onebot.yaml b/src/assets/pathMap/NapCat.Onebot.yaml index 73f77d2..77bb9be 100644 --- a/src/assets/pathMap/NapCat.Onebot.yaml +++ b/src/assets/pathMap/NapCat.Onebot.yaml @@ -106,16 +106,16 @@ group_notices: # 获取群精华消息 group_essence: name: get_essence_msg_list - source: $.data.msg_list[*] + source: $.data[*] list: - sender_uin: /sender_uin + sender_uin: /sender_id sender_nick: /sender_nick - sender_time: /sender_time - msg_content: /msg_content - add_digest_uin: /add_digest_uin - add_digest_nick: /add_digest_nick - add_digest_time: /add_digest_time - is_end: $.data.is_end + sender_time: /operator_time + msg_content: /content + add_digest_uin: /operator_id + add_digest_nick: /operator_nick + add_digest_time: /operator_time + is_end: null # 获取群成员信息 group_member_info: name: get_group_member_info diff --git a/src/components/AboutPan.vue b/src/components/AboutPan.vue index d9a7be8..58c4599 100644 --- a/src/components/AboutPan.vue +++ b/src/components/AboutPan.vue @@ -127,12 +127,11 @@ - + \ No newline at end of file diff --git a/src/components/MsgBody.vue b/src/components/MsgBody.vue index 6c69edd..539a199 100644 --- a/src/components/MsgBody.vue +++ b/src/components/MsgBody.vue @@ -32,14 +32,13 @@
{{ item }} + - - {{ item.text }} [ {{ $t('图片') }}:{{ item.text }} ]
{{ getAtName(item) }} diff --git a/src/function/utils/msgUtil.ts b/src/function/utils/msgUtil.ts index 1906102..2f9623b 100644 --- a/src/function/utils/msgUtil.ts +++ b/src/function/utils/msgUtil.ts @@ -220,9 +220,8 @@ export function getMsgRawTxt(data: any): string { // eslint-disable-next-line case 'text': back += message[i].text.replaceAll('\n', ' ').replaceAll('\r', ' '); break case 'face': back += '[' + $t('表情') + ']'; break - case 'mface': back += message[i].summary ?? message[i].text; break case 'bface': back += message[i].text; break - case 'image': back += '[' + $t('图片') + ']'; break + case 'image': back += message[i].summary ?? '[' + $t('图片') + ']'; break case 'record': back += '[' + $t('语音') + ']'; break case 'video': back += '[' + $t('视频') + ']'; break case 'file': back += '[' + $t('文件') + ']'; break @@ -430,7 +429,6 @@ export function updateLastestHistory(item: UserFriendElem & UserGroupElem) { } export function sendMsgAppendInfo(msg: any) { - msg.message.forEach(() => { - // TODO - }) + msg + // TODO } \ No newline at end of file diff --git a/src/pages/Chat.vue b/src/pages/Chat.vue index faff208..97909a2 100644 --- a/src/pages/Chat.vue +++ b/src/pages/Chat.vue @@ -357,10 +357,6 @@
{{ $t('下载图片') }}
-
-
- {{ $t('收藏商城表情') }} -
{{ $t('撤回') }} @@ -454,7 +450,6 @@ import { Logger, LogType, PopInfo, PopType } from '@/function/base' import { Connector, login as loginInfo } from '@/function/connect' import { runtimeData} from '@/function/msg' import { BaseChatInfoElem, MsgItemElem, SQCodeElem, GroupMemberInfoElem, UserFriendElem, UserGroupElem } from '@/function/elements/information' -import option from '@/function/option' export default defineComponent({ name: 'ViewChat', @@ -493,7 +488,6 @@ export default defineComponent({ copy: true, copySelect: false, downloadImg: false as string | false, - addStoreFace: false, revoke: false, at: true, remove: false, @@ -854,9 +848,7 @@ export default defineComponent({ this.tags.menuDisplay.add = false } }) - if(data.message[0].type == 'mface') { - this.tags.menuDisplay.addStoreFace = true - } else if(select.nodeName == 'IMG') { + if(select.nodeName == 'IMG') { // 右击图片需要显示的内容,这边特例设置为链接 this.tags.menuDisplay.downloadImg = (select as HTMLImageElement).src } @@ -913,7 +905,6 @@ export default defineComponent({ copy: true, copySelect: false, downloadImg: false, - addStoreFace: false, revoke: false, at: false, remove: false, @@ -1107,30 +1098,6 @@ export default defineComponent({ }) }, - /** - * 添加商城表情 - */ - addStoreFace() { - const popInfo = new PopInfo() - const msg = this.selectedMsg - if (msg !== null) { - const mface = msg.message[0] - const storeFaceList = option.get('store_face') ?? [] - const face = storeFaceList.find((item: any) => { - return item.emoji_package_id == mface.emoji_package_id && - item.emoji_id == mface.emoji_id - }) - if(face) { - popInfo.add(PopType.INFO, this.$t('表情已被收藏')) - } else { - storeFaceList.push(mface) - option.save('store_face', storeFaceList) - popInfo.add(PopType.INFO, this.$t('表情收藏成功')) - } - } - this.closeMsgMenu() - }, - /** * 发送消息回应 * @param num @@ -1625,7 +1592,7 @@ export default defineComponent({ this.list.forEach((item: any) => { if (item.message !== undefined) { item.message.forEach((msg: MsgItemElem) => { - if (msg.type === 'image' && !msg.asface) { + if (msg.type === 'image' && msg.file != 'marketface') { const info = { index: item.message_id, message_id: item.message_id, From 7aeb089aa21e76273911399990135cc7de77247b Mon Sep 17 00:00:00 2001 From: stapxs <1007028430.stapx@gmail.com> Date: Wed, 23 Oct 2024 10:46:49 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E6=88=B3=E6=88=B3=E6=88=B3=E6=88=B3?= =?UTF-8?q?=E6=88=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit :sparkles: 支持 Napcat 3.0 戳一戳功能 :heavy_plus_sign: 更新依赖:vue3-bcui --- package.json | 4 ++-- src/assets/pathMap/NapCat.Onebot.yaml | 6 +++++- src/components/MsgBody.vue | 7 ++++++- src/function/utils/msgUtil.ts | 8 ++++++-- src/pages/Chat.vue | 19 ++++++++++++++----- 5 files changed, 33 insertions(+), 11 deletions(-) diff --git a/package.json b/package.json index 7cfaaa4..2708dc3 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stapxs-qq-lite", - "version": "2.9.1", + "version": "2.9.2", "private": false, "author": "Stapx Steve [林槐]", "description": "一个兼容 OneBot 的非官方网页版 QQ 客户端,使用 Vue 重制的全新版本。", @@ -47,7 +47,7 @@ "vue-clipboard2": "^0.3.3", "vue-i18n": "^9.2.2", "vue-prism-editor": "^2.0.0-alpha.2", - "vue3-bcui": "^0.2.3", + "vue3-bcui": "^0.2.6", "vue3-danmaku": "^1.6.0", "vue3-infinite-scroll-better": "^2.2.0", "xss": "^1.0.14" diff --git a/src/assets/pathMap/NapCat.Onebot.yaml b/src/assets/pathMap/NapCat.Onebot.yaml index 77bb9be..6ed696f 100644 --- a/src/assets/pathMap/NapCat.Onebot.yaml +++ b/src/assets/pathMap/NapCat.Onebot.yaml @@ -146,4 +146,8 @@ recent_contact: user_id: /peerUin time: /msgTime chat_type: /chatType - name: /peerName \ No newline at end of file + name: /peerName +# 戳一戳 +poke: + name: group_poke + private_name: friend_poke \ No newline at end of file diff --git a/src/components/MsgBody.vue b/src/components/MsgBody.vue index 539a199..73e8720 100644 --- a/src/components/MsgBody.vue +++ b/src/components/MsgBody.vue @@ -13,7 +13,7 @@
- +