Merge branch 'main' of https://gitea-inner.fontree.cn/scout666/chat-app
Some checks are pending
Check / lint (push) Waiting to run
Check / typecheck (push) Waiting to run
Check / build (build, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build, 18.x, windows-latest) (push) Waiting to run
Check / build (build:app, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:app, 18.x, windows-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, ubuntu-latest) (push) Waiting to run
Check / build (build:mp-weixin, 18.x, windows-latest) (push) Waiting to run

This commit is contained in:
wangyifeng 2025-03-17 16:34:01 +08:00
commit a6810d4f12
9 changed files with 61 additions and 18 deletions

2
components.d.ts vendored
View File

@ -30,8 +30,6 @@ declare module 'vue' {
LoginMessage: typeof import('./src/components/talk/message/LoginMessage.vue')['default']
Message: typeof import('./src/components/x-message/message/index.vue')['default']
MixedMessage: typeof import('./src/components/talk/message/MixedMessage.vue')['default']
NButton: typeof import('naive-ui')['NButton']
NIcon: typeof import('naive-ui')['NIcon']
PageAnimation: typeof import('./src/components/page-animation/index.vue')['default']
RevokeMessage: typeof import('./src/components/talk/message/RevokeMessage.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']

View File

@ -12,9 +12,9 @@ const props = defineProps<{
const isShowRecord = ref(false)
const title = computed(() => {
return [...new Set(props.extra.records.map((v) => v.nickname))].join('')
return [...new Set(props.extra.records.map((v) => v.nickname))].join('')
})
console.log(props.extra.records)
const onClick = () => {
// isShowRecord.value = true
uni.navigateTo({
@ -24,7 +24,7 @@ const onClick = () => {
</script>
<template>
<section class="im-message-forward pointer" :class="{ left: data.float === 'left' }" @click="onClick">
<div class="title">{{ title }} 的会话记录</div>
<div class="title">{{ title }}<span v-if="props.extra.records.length > 2"></span>的会话记录</div>
<div class="list" v-for="(record, index) in extra.records" :key="index">
<p>
<span>{{ record.nickname }}: </span>

View File

@ -14,7 +14,7 @@
</span>
</div>
</template>
<template #right>
<template #right v-if="state.isManager === 'true'">
<div
v-if="state.editMode !== 3"
class="nav-bar-done-btn"
@ -39,7 +39,7 @@
</template>
<div class="notice-text-area">
<div class="notice-view-area">
<div class="notice-view-info" v-if="state.editMode !== 1">
<div class="notice-view-info" v-if="state.editMode !== 1 && state?.groupNoticeObj?.content">
<div class="notice-creater-avatar">
<img :src="state?.groupNoticeObj?.avatar" />
</div>
@ -53,9 +53,12 @@
</div>
</div>
<div class="notice-view-content" v-if="state.editMode === 3">
<span class="text-[32rpx] font-regular">
<span class="text-[32rpx] font-regular" v-if="state?.groupNoticeObj?.content">
{{ state?.groupNoticeObj?.content }}
</span>
<span class="text-[32rpx] font-regular color-[#898989]" v-else>
{{ $t('groupNotice.notice.empty') }}
</span>
</div>
<wd-textarea
size="large"
@ -77,6 +80,7 @@ import useConfirm from '@/components/x-confirm/useConfirm.js'
import ZPaging from '@/uni_modules/z-paging/components/z-paging/z-paging.vue'
import { reactive, computed, onMounted } from 'vue'
import { useGroupStore, useDialogueStore } from '@/store'
import { onLoad } from '@dcloudio/uni-app'
import {
ServeEditGroupNotice,
ServeDeleteGroupNotice,
@ -98,7 +102,8 @@ const state = reactive({
groupNoticeObj: null, //
groupNotice: '', //
canDoComplete: false, //
editMode: 1, // 123
editMode: 3, // 123
isManager: 'false', //
})
onMounted(() => {
@ -107,6 +112,14 @@ onMounted(() => {
state.editMode = 3
state.groupNoticeObj = groupParams.groupNotice[0]
inputGroupNotice(groupParams?.groupNotice[0]?.content)
} else if( state.isManager === 'true'){
state.editMode = 1
}
})
onLoad((options) => {
console.log(options)
if (options?.is_manager) {
state.isManager = options?.is_manager
}
})

View File

@ -455,7 +455,7 @@ const toManagePage = (label) => {
})
} else if (label === t('chat.settings.groupNotice')) {
uni.navigateTo({
url: '/pages/chatSettings/groupManage/manageNotice',
url: `/pages/chatSettings/groupManage/manageNotice?is_manager=${groupParams?.groupInfo?.is_manager}`,
})
} else if (label === t('chat.settings.groupMember')) {
uni.navigateTo({

View File

@ -493,7 +493,7 @@ import useZPaging from '@/uni_modules/z-paging/components/z-paging/js/hooks/useZ
import emojiPanel from './components/emojiPanel.vue'
import filePanel from './components/filePanel.vue'
import lodash from 'lodash'
import { ServePublishMessage, detailGetRecordsContext } from '@/api/chat'
import { ServePublishMessage,detailGetRecordsContext,ServeClearTalkUnreadNum } from '@/api/chat'
import copy07 from '@/static/image/chatList/copy07@2x.png'
import multipleChoices from '@/static/image/chatList/multipleChoices@2x.png'
import cite from '@/static/image/chatList/cite@2x.png'
@ -506,7 +506,7 @@ import zu6053 from '@/static/image/chatList/zu6053@2x.png'
import deepBubble from '@/components/deep-bubble/deep-bubble.vue'
import { isRevoke } from './menu'
import useConfirm from '@/components/x-confirm/useConfirm.js'
import { onLoad as uniOnload } from '@dcloudio/uni-app'
import { onLoad as uniOnload, onUnload as uniOnUnload } from '@dcloudio/uni-app'
Quill.register('formats/emoji', EmojiBlot)
@ -546,6 +546,9 @@ const state = ref({
showWin: false,
onfocusItem: null,
sessionId: '',
talkType: '',
receiverId: '',
indexName: '',
localPageLoadDone: true, //
quoteInfo: null, //
mentionIsMulSelect: false, //
@ -557,8 +560,12 @@ const state = ref({
})
uniOnload((options) => {
console.log('onLoad'+ options)
if (options.sessionId) {
state.value.sessionId = options.sessionId
state.value.talkType = options.talkType
state.value.receiverId = options.receiverId
state.value.indexName = options.indexName
}
if (options.msgInfo) {
const msgInfo = JSON.parse(decodeURIComponent(options.msgInfo))
@ -568,7 +575,20 @@ uniOnload((options) => {
}
initData()
})
uniOnUnload(() => {
console.log('onUnload')
console.log(state.value.talkType)
console.log(state.value.receiverId)
ServeClearTalkUnreadNum({
talk_type: Number(state.value.talkType),
receiver_id: Number(state.value.receiverId)
}).then(() => {
talkStore.updateItem({
index_name: state.value.indexNamee,
unread_num: 0,
})
})
})
const handleEmojiPanel = () => {
state.value.isOpenFilePanel = false
state.value.isOpenEmojiPanel = !state.value.isOpenEmojiPanel

View File

@ -24,8 +24,13 @@ const onLoadData = () => {
}).then((res) => {
if (res.code == 200) {
items.value = res.data.items || []
title.value = [...new Set(items.value.map((v) => v.nickname))].join('、')
//
const uniqueNames = [...new Set(items.value.map(v => v.nickname))];
if (uniqueNames.length <= 2) {
title.value = uniqueNames.join('和');
} else {
title.value = uniqueNames.slice(0, 2).join('和') + '等';
}
}
})
}

View File

@ -7,8 +7,10 @@
>
<div class="avatarImg">
<tm-badge
:count="props.data.unread_num"
:count="props.data.is_disturb === 1 ? props.data.unread_num : ''"
:dot="props.data.is_disturb === 0 && props.data.unread_num"
:maxCount="99"
class="badge"
color="#D03050"
>
<avatarModule
@ -134,7 +136,7 @@ const cellClick = () => {
});
}
uni.navigateTo({
url: "/pages/dialog/index?sessionId=" + props.data.id,
url: `/pages/dialog/index?sessionId=${props.data.id}&talkType=${props.data.talk_type}&receiverId=${props.data.receiver_id}&indexName=${props.data.index_name}`,
});
};
@ -154,6 +156,10 @@ const handleDelete = () => {
// border: 1px solid #fff;
// transform: translate3d(1px, 0px, 0px) !important;
}
::v-deep .badge .round-6{
min-width: 22rpx;
min-height: 22rpx;
}
.chatItem {
width: 100%;
height: 154rpx;

View File

@ -250,7 +250,7 @@ onLoad((options) => {
})
}
uni.navigateTo({
url: '/pages/dialog/index?sessionId=' + openSession.id,
url: `/pages/dialog/index?sessionId=${openSession.id}&talkType=${openSession.talk_type}&receiverId=${openSession.receiver_id}&indexName=${openSession.index_name}`,
})
}
})

View File

@ -130,6 +130,7 @@
"groupNotice.confirm.clear": "清空",
"groupNotice.quit.edit": "退出本次编辑",
"groupNotice.continue.edit": "继续编辑",
"groupNotice.notice.empty": "暂无内容",
"groupNotice.confirm.quit": "退出",
"chatSettings.btn.removeAdmin": "移除",
"groupManage.disband.hint": "退出后,本群将被解散",