Skip to content

Commit

Permalink
好忙好忙 😭
Browse files Browse the repository at this point in the history
✨ 多选消息以及合并转发消息支持
🎨 优化统计信息提交,合并为同一个方法
🐛 对 napcat 调整过的精华消息接口支持
💩 UI Debug 模式彻底移除
  • Loading branch information
Stapxs committed Oct 21, 2024
1 parent c395eea commit 3591cc7
Show file tree
Hide file tree
Showing 22 changed files with 383 additions and 198 deletions.
16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) 来查看目前支持的包管理。

Expand All @@ -70,8 +70,16 @@ Stapxs QQ Lite 需要一个 QQ Bot 后端提供服务,你可以参考 [📖
- 如果有什么奇奇怪怪的问题, 欢迎发起 [issue](<https://github.com/Stapxs/Stapxs-QQ-Lite/issues>) 询问! 如果有什么 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/`;如果你本来就运行在根目录下,可以直接删去它。

Expand Down Expand Up @@ -112,5 +120,5 @@ yarn electron:build --linux
## 🎉 鸣谢
感谢这些小伙伴们在开发和文本中提供的支持 ——

<a href="https://github.com/Logic-Accepted"><img src="https://avatars.githubusercontent.com/u/36406453?s=48&v=4"></a>
<a href="https://github.com/doodlehuang"><img src="https://avatars.githubusercontent.com/u/25525621?s=48&v=4"></a>
<a href="https://github.com/Logic-Accepted"><img src="https://avatars.githubusercontent.com/u/36406453?s=48&v=4"></a>
<a href="https://github.com/doodlehuang"><img src="https://avatars.githubusercontent.com/u/25525621?s=48&v=4"></a>
8 changes: 6 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -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
},
Expand Down Expand Up @@ -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() // 检查打开次数
Expand Down
2 changes: 1 addition & 1 deletion src/assets/css/append/append_new.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
54 changes: 54 additions & 0 deletions src/assets/css/chat.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 4 additions & 1 deletion src/assets/css/msg.css
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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;
}
Expand Down
12 changes: 8 additions & 4 deletions src/assets/l10n/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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 ""
12 changes: 8 additions & 4 deletions src/assets/l10n/zh-CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -504,10 +504,6 @@ msgstr ""
msgid "公告"
msgstr ""

#: src/pages/options/OptDev.vue:139
msgid "页面测试"
msgstr ""

#: src/pages/options/OptDev.vue:140
msgid "让我康康 ~"
msgstr ""
Expand Down Expand Up @@ -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 ""
12 changes: 8 additions & 4 deletions src/assets/l10n/zh-TW.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 "「讓我看看!!!」"
Expand Down Expand Up @@ -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 ""
12 changes: 8 additions & 4 deletions src/assets/l10n/zh-YUE.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 啊?"
Expand Down Expand Up @@ -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 ""
16 changes: 8 additions & 8 deletions src/assets/pathMap/NapCat.Onebot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 3 additions & 6 deletions src/components/AboutPan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -127,12 +127,11 @@
</template>

<script lang="ts">
import Umami from '@stapxs/umami-logger-typescript'
import DepPan from './DepPan.vue'
import packageInfo from '../../package.json'
import { defineComponent } from 'vue'
import { openLink } from '@/function/utils/appUtil'
import { openLink, sendStatEvent } from '@/function/utils/appUtil'
import { ContributorElem } from '@/function/elements/system'
import { runtimeData } from '@/function/msg'
Expand Down Expand Up @@ -164,14 +163,12 @@ export default defineComponent({
goGithub() {
openLink('https://github.com/Stapxs/Stapxs-QQ-Lite-2.0')
// UM:统计点击事件
Umami.trackEvent('click_statistics', { name: 'visit_github' })
sendStatEvent('click_statistics', { name: 'visit_github' })
},
goBlog() {
openLink('https://blog.stapxs.cn/About.html')
// UM:统计点击事件
Umami.trackEvent('click_statistics', { name: 'visit_blog' })
sendStatEvent('click_statistics', { name: 'visit_blog' })
}
},
mounted() {
Expand Down
17 changes: 7 additions & 10 deletions src/components/MsgBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
-->

<template>
<div :class="'message' + (type ? ' ' + type : '') + (data.revoke ? ' revoke' : '') + (isMe ? ' me': '')" :data-raw="getMsgRawTxt(data)"
<div :class="'message' + (type ? ' ' + type : '') + (data.revoke ? ' revoke' : '') + (isMe ? ' me': '') + (selected ? ' selected' : '')" :data-raw="getMsgRawTxt(data)"
:id="'chat-' + data.message_id" :data-sender="data.sender.user_id" :data-time="data.time"
@mouseleave="hiddenUserInfo">
<img name="avatar" :src="'https://q1.qlogo.cn/g?b=qq&s=0&nk=' + data.sender.user_id" v-show="!isMe || type == 'merge'">
Expand Down Expand Up @@ -131,7 +131,6 @@
import Option from '@/function/option'
import CardMessage from './msg-component/CardMessage.vue'
import app from '@/main'
import Umami from '@stapxs/umami-logger-typescript'

import { MsgBodyFuns as ViewFuns } from '@/function/model/msg-body'
import { defineComponent } from 'vue'
Expand All @@ -140,12 +139,12 @@ import { runtimeData } from '@/function/msg'
import { Logger, PopInfo, PopType } from '@/function/base'
import { StringifyOptions } from 'querystring'
import { getFace, getMsgRawTxt } from '@/function/utils/msgUtil'
import { openLink, downloadFile } from '@/function/utils/appUtil'
import { openLink, downloadFile, sendStatEvent } from '@/function/utils/appUtil'
import { getSizeFromBytes } from '@/function/utils/systemUtil'

export default defineComponent({
name: 'MsgBody',
props: ['data', 'type'],
props: ['data', 'type', 'selected'],
components: { CardMessage },
data () {
return {
Expand Down Expand Up @@ -343,25 +342,23 @@ export default defineComponent({
}
this.pageViewInfo = pageData
}
// UM:上传使用链接预览功能的事件用于分析(成功)
const reg1 = /\/\/(.*?)\//g
const getDom = fistLink.match(reg1)
if (getDom !== null) {
Umami.trackEvent('link_view', { domain: RegExp.$1, statue: true })
sendStatEvent('link_view', { domain: RegExp.$1, statue: true })
} else {
Umami.trackEvent('link_view', { domain: '', statue: true })
sendStatEvent('link_view', { domain: '', statue: true })
}
})
.catch(error => {
if (error) {
logger.error(error as Error, '获取链接预览失败: ' + fistLink)
// UM:上传使用链接预览功能的事件用于分析(失败)
const reg1 = /\/\/(.*?)\//g
const getDom = fistLink.match(reg1)
if (getDom !== null) {
Umami.trackEvent('link_view', { domain: RegExp.$1, statue: false })
sendStatEvent('link_view', { domain: RegExp.$1, statue: false })
} else {
Umami.trackEvent('link_view', { domain: '', statue: false })
sendStatEvent('link_view', { domain: '', statue: false })
}
}
})
Expand Down
5 changes: 2 additions & 3 deletions src/components/WelPan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@

<script lang="ts">
import languages from '@/assets/l10n/_l10nconfig.json'
import Umami from '@stapxs/umami-logger-typescript'
import { defineComponent } from 'vue'
import { runtimeData } from '@/function/msg'
import { runASWEvent as save } from '@/function/option'
import { sendStatEvent } from '@/function/utils/appUtil'
export default defineComponent({
name: 'WelcomePan',
Expand All @@ -62,8 +62,7 @@ export default defineComponent({
methods: {
gaLanguage(event: Event) {
const sender = event.target as HTMLInputElement
// UM:上传语言选择
Umami.trackEvent('use_language', { name: sender.value })
sendStatEvent('use_language', { name: sender.value })
// 刷新菜单
// TODO
},
Expand Down
Loading

0 comments on commit 3591cc7

Please sign in to comment.