diff --git a/package.json b/package.json index f14f906..d8b505a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "stapxs-qq-lite", - "version": "2.7.10", + "version": "2.7.11", "private": false, "author": "Stapx Steve [林槐]", "description": "一个兼容 OneBot 的非官方网页版 QQ 客户端,使用 Vue 重制的全新版本。", diff --git a/src/App.vue b/src/App.vue index 899535f..3eeaa6e 100644 --- a/src/App.vue +++ b/src/App.vue @@ -55,7 +55,7 @@ {{ $t('home_card_auto_con') }} - docWidth || y + senderHeight > docHeight || (x < mouseX && x + senderWidth > mouseX && y < mouseY && y + senderHeight > mouseY)) + // 设置按钮位置 + sender.style.left = x + 'px' + sender.style.top = y + 'px' + } } }, mounted () { @@ -473,6 +500,10 @@ export default defineComponent({ App.checkUpdate() // 检查更新 App.checkOpenTimes() // 检查打开次数 App.checkNotice() // 检查公告 + // 加载愚人节附加 + if(new Date().getMonth() == 3 && new Date().getDate() == 1) { + document.getElementById('connect_btn')?.classList.add('afd') + } } } }) diff --git a/src/assets/css/append/append_new.css b/src/assets/css/append/append_new.css index bf16a6f..f44e24d 100644 --- a/src/assets/css/append/append_new.css +++ b/src/assets/css/append/append_new.css @@ -9,15 +9,6 @@ font-size: 0.95rem; font-weight: bold; } -.layui-tab-title li { - font-size: 0.8rem; - line-height: 30px; - min-width: 10%; -} -.layui-tab-title .layui-this:after { - transform: translateX(-50%); - height: 30px; -} .main-body > ul { min-width: 45px; @@ -28,8 +19,7 @@ min-width: 50px; padding: 0; } -.main-body > ul > li > svg, -.main-body > ul > li.layui-this > svg { +.main-body > ul > li > svg { width: 15px; height: 15px; padding: 10px; @@ -56,6 +46,13 @@ height: 30px; width: 95%; } +.login-pan-card button.afd { + transform: translateX(calc(-50% + 25px)); + position: fixed; + width: 240px; + left: 50vw; + top: 75vh; +} .friend-list { width: 220px; @@ -179,6 +176,37 @@ margin-bottom: 0 !important; } +.jin-ppan { + max-width: 350px; +} +.jin-pan > div:first-child { + padding: 10px; +} +.jin-pan > div:first-child > svg { + height: 1rem; +} +.jin-pan > div:first-child > span { + font-size: 0.9rem; +} +.jin-pan-body { + padding: 0 10px 0 10px; + margin-bottom: 10px; +} +.jin-pan-body > div > div:first-child a { + font-size: 0.8rem; +} +.jin-pan-body > div > div:first-child span { + font-size: 0.65rem; +} +.jin-pan-body > div > div:first-child > span { + font-size: 0.75rem; + flex: 1; + text-align: right; +} +.jin-pan-body > div > div.context { + padding: 10px 10px 5px 10px; +} + .ss-card:hover { box-shadow: 0 0 3px var(--color-shader); } @@ -591,6 +619,23 @@ font-size: 0.65rem; } +.account-not-login { + margin: 20px auto 0 auto; +} +.account-not-login > svg { + font-size: 1.5rem; + margin-top: 20px; +} +.account-not-login > span { + font-size: 0.8rem; + margin-top: 5px; +} +.account-not-login > button { + margin-top: 15px; + margin-bottom: 10px; + font-size: 0.7rem; +} + @media (max-width: 700px) { .main-body > ul { background: var(--color-card-2) !important; @@ -643,4 +688,8 @@ height: calc(100% - 125px); padding-top: 40px; } + .account-not-login { + margin: 0 auto; + width: calc(100% - 20px); + } } diff --git a/src/assets/css/append/append_vibrancy.css b/src/assets/css/append/append_vibrancy.css index c05b82a..8d4d427 100644 --- a/src/assets/css/append/append_vibrancy.css +++ b/src/assets/css/append/append_vibrancy.css @@ -6,7 +6,7 @@ max-width: 240px !important; } .login-pan-card:hover { - box-shadow: none; + box-shadow: none !important; } .wave-pan { display: none; diff --git a/src/assets/css/chat.css b/src/assets/css/chat.css index 1be29ce..8f832eb 100644 --- a/src/assets/css/chat.css +++ b/src/assets/css/chat.css @@ -988,9 +988,6 @@ input { width: 300px; padding: 0; } -.face-pan > div.layui-tab { - margin: 0; -} .fase-pan-tab > li > svg { color: var(--color-font); margin-top: 10px; @@ -998,9 +995,6 @@ input { height: 1.1rem; width: 1.1rem; } -.fase-pan-tab > li.layui-this > svg { - color: var(--color-main) !important; -} .face-pan .tab-bar { --bc-tab-margin: 5px; @@ -1134,7 +1128,7 @@ input { outline: 2px solid var(--color-main); border-radius: 100%; margin-right: 10px; - width: 22px; + width: 25px; } .jin-pan-body > div > div:first-child > div { flex-direction: column; @@ -1142,11 +1136,17 @@ input { } .jin-pan-body > div > div:first-child a { color: var(--color-font); + font-size: 0.9rem; } .jin-pan-body > div > div:first-child span { color: var(--color-font-2); border-radius: 2rem; - font-size: 0.5rem; + font-size: 0.8rem; +} +.jin-pan-body > div > div:first-child > span { + font-size: 0.8rem; + flex: 1; + text-align: right; } .jin-pan-body > div > div.context { padding: 15px 15px 5px 15px; diff --git a/src/assets/css/msg.css b/src/assets/css/msg.css index 8279071..89e4b12 100644 --- a/src/assets/css/msg.css +++ b/src/assets/css/msg.css @@ -47,7 +47,7 @@ color: var(--color-font-r); } .message.merge > div.message-body { - max-width: 100%; + max-width: calc(100% - 50px); } .message.revoke { display: none; diff --git a/src/assets/css/options.css b/src/assets/css/options.css index 17d19f6..e581fcf 100644 --- a/src/assets/css/options.css +++ b/src/assets/css/options.css @@ -183,16 +183,6 @@ display: none !important; } -.layui-this { - color: var(--color-main) !important; -} - -.layui-this:after { - border-bottom: 3px solid var(--color-main) !important; - transform: scaleX(0.5) !important; - border-radius: 1px !important; -} - .bcd-about { padding: 5px 20px 10px 20px; margin-bottom: 40px; @@ -482,7 +472,6 @@ margin-left: 10px; opacity: 0.7; } - .account-info>svg { background: var(--color-card-2); color: var(--color-main); @@ -493,6 +482,29 @@ width: 20px; } +.account-not-login { + display: flex; + flex-direction: column; + align-items: center; + width: 50%; + margin: 40px auto 0 auto; +} +.account-not-login > svg { + font-size: 2rem; + color: var(--color-main); + margin-top: 40px; +} +.account-not-login > span { + color: var(--color-font-2); + font-size: 0.9rem; + margin-top: 10px; +} +.account-not-login > button { + width: 90%; + margin-top: 30px; + margin-bottom: 20px; +} + .end-card { margin: 20px 5px 20px 5px; display: flex; @@ -596,4 +608,11 @@ .opt-tab .tab-bar > span { display: none; } +} + +@media (max-width: 500px) { + .account-not-login { + margin: 0 auto; + width: calc(100% - 40px); + } } \ No newline at end of file diff --git a/src/assets/css/view.css b/src/assets/css/view.css index a946e25..29774f8 100644 --- a/src/assets/css/view.css +++ b/src/assets/css/view.css @@ -79,6 +79,12 @@ input::placeholder { #app, #base-app { height: 100%; } +#base-app { + transition: transform .2s; +} +#base-app.no-touch { + transform: rotate(180deg); +} #base-app.withBar { height: calc(100% - 40px); padding-top: 40px; @@ -1019,17 +1025,18 @@ input::placeholder { min-width: 100% !important; z-index: 20; } - .main-body > ul > li { - margin: 0 !important; - } - .side-bar-space { - display: none; - } .hiden-home { margin-top: calc(100% + 5px) !important; transform: translateY(0) !important; margin-left: -70px; } + .main-body > ul > li { + margin-top: 0; + margin-bottom: 0 !important; + } + .side-bar-space { + display: none; + } /* 二级侧栏 */ .friend-list { transition: width .3s; @@ -1166,12 +1173,6 @@ input::placeholder { } } - -/* 其他覆盖样式 */ -.layui-tab-bar { - display: none; -} - /* 全局淡入淡出动画 */ .v-enter-active, .v-leave-active { diff --git a/src/assets/l10n/zh-CN.json b/src/assets/l10n/zh-CN.json index e39e315..ed08300 100644 --- a/src/assets/l10n/zh-CN.json +++ b/src/assets/l10n/zh-CN.json @@ -312,6 +312,10 @@ "reply_placeholder": "快速回复……", "btn_iframe_tip": "请不要在内嵌页面中输入敏感信息,内嵌页面并不安全。", "option_dev_get_version_info": "正在收集调试消息……", + "option_account_notlogin": "还没有连接到 OneBot 耶", + "option_account_gologin": "去连接", + "option_view_dont_touch": "不要点这个", + "option_view_dont_touch_tip": "啊吧啊吧(智慧)", "menu_about": "关于", "menu_update": "检查更新…", diff --git a/src/assets/pathMap/NapCat.Onebot.yaml b/src/assets/pathMap/NapCat.Onebot.yaml index 44c4c5e..404eb6b 100644 --- a/src/assets/pathMap/NapCat.Onebot.yaml +++ b/src/assets/pathMap/NapCat.Onebot.yaml @@ -1,10 +1,18 @@ +# NapCat.Onbot/LLOneBot 消息结构声明 +# https://napneko.github.io/zh-CN/develop/api +# PS:解析中可以使用 jsonpath,左斜杠开头则表示为当前位置 + +# Bot 名称 name: NapCat.Onebot +# Bot 版本信息 version_info: $.data +# 登录信息 login_info: uin: $.data.user_id bkn: "" nickname: $.data.nickname +# 群、好友列表 user_list: source: $.data[*] list: @@ -17,6 +25,7 @@ user_list: user_id: /user_id nickname: /nickname remark: /remark +# 消息列表 message_list: name: get_group_msg_history private_name: get_friend_msg_history @@ -35,6 +44,7 @@ message_list: sender: /sender message: /message raw_message: /raw_message +# 转发消息体 forward_msg: name: get_forward_msg source: $.data.messages[*] @@ -48,21 +58,26 @@ forward_msg: sender: /sender message: /content raw_message: null +# 消息基础信息 message_info: message_id: $.message_id private_id: $.user_id group_id: $.group_id target_id: $.target_id sender: $.sender.user_id +# 获取消息体 get_message: $.message message_value: file: name: $.file +# 设置消息已读 set_message_read: name: mark_group_msg_as_read private_name: mark_private_msg_as_read +# 设置消息回应 send_respond: name: set_msg_emoji_like +# 获取分组信息 class_list: name: get_friends_with_category source: $.data[*] @@ -71,6 +86,7 @@ class_list: class_name: /categroyName user_count: /categroyMbCount list: /buddyList +# 获取群公告 group_notices: name: _get_group_notice source: $.data[*] @@ -79,4 +95,17 @@ group_notices: sender: /sender_id time: /publish_time is_read: null - read_num: null \ No newline at end of file + read_num: null +# 获取群精华消息 +group_essence: + name: get_essence_msg_list + source: $.data.msg_list[*] + list: + sender_uin: /sender_uin + 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 \ No newline at end of file diff --git a/src/assets/pathMap/Shamrock.yaml b/src/assets/pathMap/Shamrock.yaml deleted file mode 100644 index 86c971a..0000000 --- a/src/assets/pathMap/Shamrock.yaml +++ /dev/null @@ -1,43 +0,0 @@ -name: Shamrock -version_info: $.data -login_info: - uin: $.data.user_id - bkn: "" - nickname: $.data.nickname -user_list: - source: $.data[*] - list: - group_id: /group_id - group_name: /group_name - member_count: /member_count - admin_flag: $.admins[?(@ == '')] - - class_id: /group_id - class_name: /group_name - user_id: /user_id - nickname: /user_name - remark: /user_remark -class_list: $[*] -message_list: - name: get_history_msg - private_name: get_history_msg - source: $.data.messages[*] - type: json_with_data|$.data - message_type: - user: private - group: group - list: - message_id: /message_id - message_type: /message_type - time: /time - post_type: null - group_id: /group_id - sender: /sender - message: /message - raw_message: /raw_message -message_info: - message_id: $.message_id - private_id: $.target_id - group_id: $.group_id - sender: $.sender.user_id -get_message: $.message \ No newline at end of file diff --git a/src/components/DepPan.vue b/src/components/DepPan.vue index a222841..14f2651 100644 --- a/src/components/DepPan.vue +++ b/src/components/DepPan.vue @@ -175,11 +175,14 @@ export default defineComponent({ margin-right: 0; margin-bottom: 20px; } + .main > div:first-child { + display: none; + } .power-by > img { width: 60%; } .dept { - height: 20vh; + height: 40vh; } } diff --git a/src/function/elements/information.ts b/src/function/elements/information.ts index 9f63fb2..e861bd2 100644 --- a/src/function/elements/information.ts +++ b/src/function/elements/information.ts @@ -65,14 +65,11 @@ export interface ChatInfoElem { group_sub_files: { [key: string]: any }, group_notices?: { [key: string]: any }, now_member_info?: { [key: string]: any }, - image_list?: { index: number, message_id: string, img_url: string }[] + image_list?: { index: number, message_id: string, img_url: string }[], jin_info: { - data: { - msg_list: { [key: string]: any }[], - [key: string]: any - }, - retcode?: number, - retmsg?: string + list: { [key: string]: any }[], + is_end?: boolean, + pages: number } } } diff --git a/src/function/msg.ts b/src/function/msg.ts index c577bf3..dff8978 100644 --- a/src/function/msg.ts +++ b/src/function/msg.ts @@ -62,7 +62,7 @@ export function parse(str: string) { case 'getGroupNotices' : saveGroupNotices(msg); break case 'getGroupFiles' : saveFileList(msg.data.data); break case 'getMoreGroupFiles' : saveMoreFileList(msg.data.data); break - case 'getJin' : saveJin(msg.data.data); break + case 'getJin' : saveJin(msg.data); break case 'getSystemMsg' : runtimeData.systemNoticesList = msg.data; break case 'getSendMsg' : saveSendedMsg(echoList, msg); break case 'getGroupMemberInfo' : saveMemberInfo(msg); break @@ -996,16 +996,19 @@ function sendNotice(info: any) { * @param data 返回数据 */ function saveJin(data: any) { - if (runtimeData.chatInfo.info.jin_info.data.msg_list.length == 0) { - // 首次获取 - runtimeData.chatInfo.info.jin_info = data - } else { - // 追加保存 - if (data.retcode == 0) { - runtimeData.chatInfo.info.jin_info.data.msg_list = - runtimeData.chatInfo.info.jin_info.data.msg_list.concat(data.data.msg_list) - runtimeData.chatInfo.info.jin_info.data.is_end = data.data.is_end + const jinList = getMsgData('group_essence', data, msgPath.group_essence) + const is_end = getMsgData('is_end', data, msgPath.group_essence.is_end) + if (jinList && is_end) { + if (runtimeData.chatInfo.info.jin_info.list.length == 0) { + runtimeData.chatInfo.info.jin_info.list = jinList + } else { + const now_page = runtimeData.chatInfo.info.jin_info.pages ?? 0 + + runtimeData.chatInfo.info.jin_info.list = + runtimeData.chatInfo.info.jin_info.list.concat(jinList) + runtimeData.chatInfo.info.jin_info.pages = now_page + 1 } + runtimeData.chatInfo.info.jin_info.is_end = is_end[0] } } @@ -1107,7 +1110,10 @@ const baseRuntime = { group_members: [], group_files: {}, group_sub_files: {}, - jin_info: { data: { msg_list: [] } } + jin_info: { + list: [] as { [key: string]: any }[], + pages: 0 + } } }, pageView: { diff --git a/src/pages/Chat.vue b/src/pages/Chat.vue index 6a9cdc1..8b8396d 100644 --- a/src/pages/Chat.vue +++ b/src/pages/Chat.vue @@ -88,15 +88,14 @@ -
+
{{ $t('chat_fun_menu_jin') }}
-
@@ -106,6 +105,10 @@ { hour: "numeric", minute: "numeric" }) .format(new Date(item.sender_time * 1000)) }} {{ $t('chat_send') }}
+ {{ $t('chat_fun_menu_jin_sender', + { time: Intl.DateTimeFormat(trueLang, + { hour: "numeric", minute: "numeric" }) + .format(new Date(item.add_digest_time * 1000)),name: item.add_digest_nick }) }}
- {{ $t('chat_fun_menu_jin_sender', - { time: Intl.DateTimeFormat(trueLang, - { hour: "numeric", minute: "numeric" }) - .format(new Date(item.add_digest_time * 1000)),name: item.add_digest_nick }) }}
@@ -1605,13 +1604,13 @@ export default defineComponent({ */ showJin () { this.details[2].open = !this.details[2].open - if (runtimeData.chatInfo.info.jin_info.data.msg_list.length == 0) { - const url = `https://qun.qq.com/cgi-bin/group_digest/digest_list?bkn=${runtimeData.loginInfo.bkn}&group_code=${this.chat.show.id}&page_start=0&page_limit=40` - Connector.send( - 'http_proxy', - { 'url': url }, - 'getJin' - ) + if (runtimeData.chatInfo.info.jin_info.list.length == 0) { + // `https://qun.qq.com/cgi-bin/group_digest/digest_list?bkn=${runtimeData.loginInfo.bkn}&group_code=${this.chat.show.id}&page_start=0&page_limit=40` + const name = runtimeData.jsonMap.group_essence.name ?? 'get_essence_msg_list' + Connector.send(name, { + group_id: this.chat.show.id, + pages: 0 + }, 'getJin' ) } this.tags.showMoreDetail = !this.tags.showMoreDetail }, @@ -1623,14 +1622,13 @@ export default defineComponent({ const body = event.target as HTMLDivElement // 滚动到底部,加载更多 if (body.scrollTop + body.clientHeight === body.scrollHeight && !this.tags.isJinLoading) { - if (this.chat.info.jin_info.retcode == 0 && this.chat.info.jin_info.data.is_end == false) { + if (this.chat.info.jin_info.is_end == false) { this.tags.isJinLoading = true - const url = `https://qun.qq.com/cgi-bin/group_digest/digest_list?bkn=${runtimeData.loginInfo.bkn}&group_code=${this.chat.show.id}&page_start=${(this.chat.info.jin_info.data.msg_list.length) / 40 + 1}&page_limit=40` - Connector.send( - 'http_proxy', - { 'url': url }, - 'getJin' - ) + const name = runtimeData.jsonMap.group_essence.name ?? 'get_essence_msg_list' + Connector.send(name, { + group_id: this.chat.show.id, + pages: this.chat.info.jin_info.pages + 1 + }, 'getJin' ) } } }, @@ -1672,7 +1670,7 @@ export default defineComponent({ // PS:由于监听 list 本身返回的新旧值是一样,于是监听 length(反正也只要知道长度) this.$watch(() => this.list.length, this.updateList) //精华消息列表刷新 - this.$watch(() => this.chat.info.jin_info.data.msg_list.length, () => { + this.$watch(() => this.chat.info.jin_info.list.length, () => { this.tags.isJinLoading = false }) } diff --git a/src/pages/Info.vue b/src/pages/Info.vue index 1969a7d..7a79944 100644 --- a/src/pages/Info.vue +++ b/src/pages/Info.vue @@ -118,7 +118,7 @@
-
+
diff --git a/src/pages/options/OptAccount.vue b/src/pages/options/OptAccount.vue index ae94c5f..18f8fd6 100644 --- a/src/pages/options/OptAccount.vue +++ b/src/pages/options/OptAccount.vue @@ -9,38 +9,47 @@ @@ -209,6 +222,19 @@ export default defineComponent({ isMobile() { return getDeviceType() === 'Android' || getDeviceType() === 'iOS' + }, + + modifyTouch(event: Event) { + const sender = event.target as HTMLInputElement + const baseApp = document.getElementById('base-app') + if(baseApp && sender.checked == true) { + if(baseApp.classList.contains('no-touch')) { + baseApp.classList.remove('no-touch') + sender.checked = false + } else { + baseApp.classList.add('no-touch') + } + } } }, mounted() {