Skip to content

Commit

Permalink
获得成就:冷门景点
Browse files Browse the repository at this point in the history
✨ 对 image 形式的 mface 进行支持,移除对 mface 的支持
💩 移除对商城表情发送的功能支持,已经存储在设置项内的数据可能需要手动删除后重新导入
  • Loading branch information
Stapxs committed Oct 22, 2024
1 parent 3591cc7 commit 1c417a8
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 175 deletions.
6 changes: 0 additions & 6 deletions src/assets/css/append/append_new.css
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,6 @@
.face-pan {
border: 1px solid var(--color-card-2);
}
.store-face-list > div {
width: calc(20% - 10px) !important;
}
.face-pan div.tab-main {
margin-top: 10px !important;
}
Expand Down Expand Up @@ -595,9 +592,6 @@
height: 19px;
width: 19px;
}
.store-face-list {
height: calc(300px - 90px) !important;
}

.face-stickers {
height: calc(300px - 90px);
Expand Down
12 changes: 0 additions & 12 deletions src/assets/l10n/en-US.po
Original file line number Diff line number Diff line change
Expand Up @@ -1062,18 +1062,6 @@ msgstr ""
msgid "下载更新…"
msgstr ""

#: src/pages/Chat.vue:336
msgid "收藏商城表情"
msgstr ""

#: src/pages/Chat.vue:1027
msgid "表情已被收藏"
msgstr ""

#: src/pages/Chat.vue:1031
msgid "表情收藏成功"
msgstr ""

#: src/function/utils/appUtil.ts:69
msgid "请不要在内嵌页面中输入敏感信息,内嵌页面并不安全。"
msgstr ""
Expand Down
12 changes: 0 additions & 12 deletions src/assets/l10n/zh-CN.po
Original file line number Diff line number Diff line change
Expand Up @@ -1063,18 +1063,6 @@ msgstr ""
msgid "下载更新…"
msgstr ""

#: src/pages/Chat.vue:336
msgid "收藏商城表情"
msgstr ""

#: src/pages/Chat.vue:1027
msgid "表情已被收藏"
msgstr ""

#: src/pages/Chat.vue:1031
msgid "表情收藏成功"
msgstr ""

#: src/function/utils/appUtil.ts:69
msgid "请不要在内嵌页面中输入敏感信息,内嵌页面并不安全。"
msgstr ""
Expand Down
12 changes: 0 additions & 12 deletions src/assets/l10n/zh-TW.po
Original file line number Diff line number Diff line change
Expand Up @@ -1063,18 +1063,6 @@ msgstr ""
msgid "下载更新…"
msgstr ""

#: src/pages/Chat.vue:336
msgid "收藏商城表情"
msgstr ""

#: src/pages/Chat.vue:1027
msgid "表情已被收藏"
msgstr ""

#: src/pages/Chat.vue:1031
msgid "表情收藏成功"
msgstr ""

#: src/function/utils/appUtil.ts:69
msgid "请不要在内嵌页面中输入敏感信息,内嵌页面并不安全。"
msgstr ""
Expand Down
12 changes: 0 additions & 12 deletions src/assets/l10n/zh-YUE.po
Original file line number Diff line number Diff line change
Expand Up @@ -1063,18 +1063,6 @@ msgstr ""
msgid "下载更新…"
msgstr ""

#: src/pages/Chat.vue:336
msgid "收藏商城表情"
msgstr ""

#: src/pages/Chat.vue:1027
msgid "表情已被收藏"
msgstr ""

#: src/pages/Chat.vue:1031
msgid "表情收藏成功"
msgstr ""

#: src/function/utils/appUtil.ts:69
msgid "请不要在内嵌页面中输入敏感信息,内嵌页面并不安全。"
msgstr ""
Expand Down
81 changes: 2 additions & 79 deletions src/components/FacePan.vue
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,6 @@
</div>
</div>
</div>
<div icon="fa-solid fa-store">
<div class="store-face-list">
<div v-for="face in storeFace" :key="face.emoji_id">
<font-awesome-icon @click="removeMface(face)" :icon="['fas', 'xmark']" />
<img loading="lazy"
:src="face.url"
:title="face.summary"
@click="addMface(face)">
</div>
</div>
</div>
</BcTab>
</div>
</template>
Expand Down Expand Up @@ -66,7 +55,6 @@ export default defineComponent({
Option: Option,
runtimeData: runtimeData,
baseFaceMax: 348,
storeFace: [] as {[type: string]: string}[],
stickerPage: 1
}
},
Expand All @@ -78,21 +66,7 @@ export default defineComponent({
this.addSpecialMsg({ type: 'face', id: id }, true)
},
addImgFace(url: string) {
this.addSpecialMsg({ type: 'image', file: url, cache: true, asface: true }, true)
},
addMface(data: any) {
this.addSpecialMsg(data, true)
},
getStoreFaceList() {
this.storeFace = Option.get('store_face') ?? []
},
removeMface(data: any) {
const index = this.storeFace.findIndex((face) => face.emoji_id === data.emoji_id)
if (index !== -1) {
this.storeFace.splice(index, 1)
Option.save('store_face', this.storeFace)
}
this.addSpecialMsg({ type: 'image', file: url, subType: 1 }, true)
},
stickersScroll(e: Event) {
Expand Down Expand Up @@ -123,57 +97,6 @@ export default defineComponent({
Connector.send(runtimeData.jsonMap.roaming_stamp.name, {}, 'getRoamingStamp')
}
}
this.getStoreFaceList()
// 监听表情商店列表
this.$watch(() => runtimeData.sysConfig.store_face.length, () => {
this.getStoreFaceList()
})
}
})
</script>
<style scoped>
.store-face-list {
display: flex;
width: 100%;
flex-direction: row;
flex-wrap: wrap;
align-content: flex-start;
justify-content: center;
height: calc(300px - 120px);
overflow-y: scroll;
}
.store-face-list > div {
cursor: pointer;
width: calc(25% - 15px);
margin-right: 10px;
margin-top: 5px;
display: flex;
flex-direction: column;
align-items: flex-end;
}
.store-face-list > div:hover > svg {
opacity: 0.8;
}
.store-face-list svg {
width: 10px;
height: 10px;
color: var(--color-font);
margin-bottom: -12px;
margin-right: -5px;
opacity: 0;
z-index: 1;
background: var(--color-card-2);
border-radius: 100px;
padding: 5px;
backdrop-filter: blur(15px);
transition: opacity 0.3s;
}
.store-face-list svg:hover {
opacity: 1;
}
.store-face-list img {
border-radius: 7px;
width: 100%;
border: 2px solid var(--color-card-2);
}
</style>
</script>
3 changes: 1 addition & 2 deletions src/components/MsgBody.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,13 @@
<div v-if="item.type === undefined"></div>
<span v-else-if="isDebugMsg" class="msg-text">{{ item }}</span>
<span v-else-if="item.type == 'text'" @click="textClick" v-show="item.text !== ''" class="msg-text" v-html="parseText(item.text)"></span>
<img v-else-if="item.type == 'image' && item.file == 'marketface'" @load="scrollButtom" @error="imgLoadFail" :class="imgStyle(data.message.length, index, item.asface) + ' msg-mface'" :src="item.url">
<img v-else-if="item.type == 'image'" :title="$t('预览图片')" :alt="$t('图片')" @load="scrollButtom" @error="imgLoadFail" @click="imgClick(data.message_id)" :class="imgStyle(data.message.length, index, item.asface)" :src="item.url">
<template v-else-if="item.type == 'face'">
<img v-if="getFace(item.id)" :alt="item.text" class="msg-face" :src="getFace(item.id)" :title="item.text">
<span v-else-if="item.id == 394" class="msg-face-long"><span v-for="i in 15" :key="data.message_id + '-l-' + i">🐲</span></span>
<font-awesome-icon v-else :class="'msg-face-svg' + (isMe ? ' me': '')" :icon="['fas', 'face-grin-wide']" />
</template>
<img v-else-if="item.type == 'mface' && item.url" @load="scrollButtom" @error="imgLoadFail" :class="imgStyle(data.message.length, index, item.asface) + ' msg-mface'" :src="item.url">
<span v-else-if="item.type == 'mface' && item.text" class="msg-unknown">{{ item.text }}</span>
<span v-else-if="item.type == 'bface'" style="font-style: italic;opacity: 0.7;">[ {{ $t('图片') }}:{{ item.text }} ]</span>
<div v-else-if="item.type == 'at'" :class="getAtClass(item.qq)">
<a @mouseenter="showUserInfo" :data-id="item.qq" :data-group="data.group_id">{{ getAtName(item) }}</a>
Expand Down
8 changes: 3 additions & 5 deletions src/function/utils/msgUtil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -430,7 +429,6 @@ export function updateLastestHistory(item: UserFriendElem & UserGroupElem) {
}

export function sendMsgAppendInfo(msg: any) {
msg.message.forEach(() => {
// TODO
})
msg
// TODO
}
37 changes: 2 additions & 35 deletions src/pages/Chat.vue
Original file line number Diff line number Diff line change
Expand Up @@ -357,10 +357,6 @@
<div><font-awesome-icon :icon="['fas', 'floppy-disk']" /></div>
<a>{{ $t('下载图片') }}</a>
</div>
<div @click="addStoreFace" v-show="tags.menuDisplay.addStoreFace != false">
<div><font-awesome-icon :icon="['fas', 'heart']" /></div>
<a>{{ $t('收藏商城表情') }}</a>
</div>
<div @click="revokeMsg" v-show="tags.menuDisplay.revoke">
<div><font-awesome-icon :icon="['fas', 'xmark']" /></div>
<a>{{ $t('撤回') }}</a>
Expand Down Expand Up @@ -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',
Expand Down Expand Up @@ -493,7 +488,6 @@ export default defineComponent({
copy: true,
copySelect: false,
downloadImg: false as string | false,
addStoreFace: false,
revoke: false,
at: true,
remove: false,
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -913,7 +905,6 @@ export default defineComponent({
copy: true,
copySelect: false,
downloadImg: false,
addStoreFace: false,
revoke: false,
at: false,
remove: false,
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 1c417a8

Please sign in to comment.