fix: 修改聊天引用消息的跳转
This commit is contained in:
parent
24c94a04ad
commit
7886f260d4
@ -3,7 +3,7 @@ import { watch, onMounted, ref, nextTick, onUnmounted } from 'vue'
|
||||
import { NDropdown, NCheckbox, NPopover, NInfiniteScroll } from 'naive-ui'
|
||||
import { Loading, MoreThree, ToTop } from '@icon-park/vue-next'
|
||||
import { bus } from '@/utils/event-bus'
|
||||
import { useDialogueStore } from '@/store'
|
||||
import { useDialogueStore, useTalkStore } from '@/store'
|
||||
import { formatTime, parseTime } from '@/utils/datetime'
|
||||
import { clipboard, htmlDecode, clipboardImage } from '@/utils/common'
|
||||
import { downloadImage } from '@/utils/functions'
|
||||
@ -19,8 +19,11 @@ import RevokeMessage from '@/components/talk/message/RevokeMessage.vue'
|
||||
import { voiceToText, ServeMessageReadDetail } from '@/api/chat.js'
|
||||
import { confirmBox } from '@/components/confirm-box/service.js'
|
||||
import ws from '@/connect'
|
||||
import { useRouter } from 'vue-router'
|
||||
import avatarModule from '@/components/avatar-module/index.vue'
|
||||
|
||||
const router = useRouter()
|
||||
|
||||
// 定义消息已读状态接口
|
||||
interface ReadStatus {
|
||||
msg_ids: string[]
|
||||
@ -86,11 +89,28 @@ const { dropdown, showDropdownMenu, closeDropdownMenu, isOneMonthBefore } = useM
|
||||
const { showUserInfoModal } = useInject()
|
||||
const dialogueStore = useDialogueStore()
|
||||
const userStore = useUserStore()
|
||||
const talkStore = useTalkStore()
|
||||
// const showUserInfoModal = (uid: number) => {
|
||||
// userStore.getUserInfo(uid)
|
||||
// }
|
||||
// 置底按钮
|
||||
const skipBottom = ref(false)
|
||||
const goToMessage = (result) => {
|
||||
const talk_type = props.talk_type
|
||||
const receiver_id = props.receiver_id
|
||||
dialogueStore.specifiedMsg = encodeURIComponent(
|
||||
JSON.stringify({
|
||||
talk_type,
|
||||
receiver_id,
|
||||
msg_id: result.msg_id,
|
||||
cursor: result.sequence - 15 > 0 ? result.sequence - 15 : 0,
|
||||
direction: 'down',
|
||||
sort_sequence: 'asc',
|
||||
create_time: result.created_at
|
||||
})
|
||||
)
|
||||
talkStore.toTalk(talk_type, receiver_id, router)
|
||||
}
|
||||
// 是否显示消息时间
|
||||
const isShowTalkTime = (index: number, datetime: string) => {
|
||||
if (datetime == undefined) {
|
||||
@ -908,11 +928,11 @@ const onCustomSkipBottomEvent = () => {
|
||||
<n-icon class="more-tools pointer" :component="MoreThree" @click="onContextMenu($event, item)" />
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
<!-- @click="onJumpMessage(item.extra?.reply?.msg_id)" -->
|
||||
<div
|
||||
v-if="item.extra.reply"
|
||||
class="talk-reply pointer"
|
||||
@click="onJumpMessage(item.extra?.reply?.msg_id)"
|
||||
@click="goToMessage(item.extra?.reply)"
|
||||
>
|
||||
<n-icon :component="ToTop" size="14" class="icon-top" />
|
||||
<span class="ellipsis">
|
||||
@ -1057,6 +1077,7 @@ const onCustomSkipBottomEvent = () => {
|
||||
&.border {
|
||||
border-radius: 10px;
|
||||
border: 1px solid var(--im-primary-color);
|
||||
background-color: red;
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user