修复已知问题

This commit is contained in:
cbb
2026-01-27 16:53:39 +08:00
parent e2c47cf15a
commit 5d0700ee70
6 changed files with 101 additions and 43 deletions

View File

@@ -56,7 +56,7 @@
item.type === TYPES.MSG_GRP_TIP ||
isCreateGroupCustomMessage(item)
"
:content="item"
:content="item.getMessageContent()"
/>
<div
v-else-if="!item.isRevoked && !isPluginMessage(item)"

View File

@@ -5,44 +5,50 @@
</template>
<script lang="ts" setup>
import { computed } from '../../../../adapter-vue';
const props = defineProps({
content: {
type: Object,
default: () => ({}),
},
});
const tipContent = computed(() => `${props.content.nick || props.content.from} 创建群聊`);
import { computed } from '../../../../adapter-vue'
const props = defineProps({
content: {
type: Object,
default: () => ({})
}
})
const tipContent = computed(() => {
if (props.content?.businessID == 'group_create') {
return `${props.content?.showName} 创建群聊`
}
return props.content?.text || props.content?.custom || ''
})
</script>
<style lang="scss" scoped>
@import "../../../../assets/styles/common";
@import '../../../../assets/styles/common';
.message-tip {
margin: 0 auto;
padding: 0 20px;
color: #999;
font-size: 12px;
overflow-wrap: anywhere;
display: flex;
place-content: center center;
align-items: center;
text-align: center;
margin-bottom: 10px;
.message-tip {
margin: 0 auto;
padding: 0 20px;
color: #999;
font-size: 12px;
overflow-wrap: anywhere;
display: flex;
place-content: center center;
align-items: center;
text-align: center;
margin-bottom: 10px;
&-highlight {
animation: highlight 1000ms infinite;
&-highlight {
animation: highlight 1000ms infinite;
@keyframes highlight {
50% {
color: #ff9c19;
@keyframes highlight {
50% {
color: #ff9c19;
}
}
}
@keyframes highlight {
50% {
color: #ff9c19;
@keyframes highlight {
50% {
color: #ff9c19;
}
}
}
}
}
</style>

View File

@@ -31,10 +31,27 @@
@click="handleMenu(childrenItem)"
>
<Icon
v-if="childrenItem.icon"
v-if="
childrenItem.icon &&
!['isAddUser', 'isScan'].includes(
childrenItem.data.name
)
"
class="list-item-icon"
:file="childrenItem.icon"
/>
<image
v-if="childrenItem.data.name == 'isAddUser'"
src="/TUIKit/assets/icon/user-add.svg"
mode="heightFix"
style="height: 37rpx"
/>
<image
v-if="childrenItem.data.name == 'isScan'"
src="/TUIKit/assets/icon/scan.svg"
mode="heightFix"
style="height: 37rpx"
/>
<h1 class="list-item-title">
{{ childrenItem.text }}
</h1>
@@ -108,6 +125,7 @@
listener = { onClicked: () => {} }
} = item
if (children) {
// TUIKit\assets\icon\user-add.svg
const addUserItem = {
data: { name: 'isAddUser' },
icon: '/TUIKit/assets/icon/user-add.svg',

View File

@@ -163,7 +163,10 @@
import { createImGroup } from '../../../../api/tui-kit'
import { chooseImage } from '../../../../utils/media'
import { uploadSingleFile } from '../../../../utils/uploadFile'
import { validateGroupNumber } from '../../../../utils/validate'
import { useUI } from '../../../../utils/use-ui'
const { showToast } = useUI()
const TUIGroupServer = Server.getInstance()
const TUIConstants = TUIGroupServer.constants
@@ -229,9 +232,7 @@
placeholder: TUITranslateService.t('TUIGroup.请输入群名称')
}
const groupIDInput = {
name: `${TUITranslateService.t(
'TUIGroup.群ID'
)}(${TUITranslateService.t('TUIGroup.选填')})`,
name: `群号码`,
key: 'groupID',
placeholder: '搜索加入群使用'
}
@@ -241,7 +242,10 @@
})
const submitDisabledStatus = computed(() => {
return groupInfo.profile.name === '' && !groupInfo.isEdit
return (
groupInfo.profile.name === '' ||
(groupInfo.profile.groupID === '' && !groupInfo.isEdit)
)
})
const selected = (type: any) => {
@@ -296,11 +300,15 @@
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
delete options.groupID
}
const isGroupID = validateGroupNumber(options.groupID)
if (!isGroupID.valid) {
return showToast(isGroupID.message)
}
const res = await TUIGroupService.createGroup({
...options,
avatar: groupAvatar.value
})
console.log(res)
const { type } = res.data.group
if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
await TUIGroupService.joinGroup({
@@ -314,10 +322,14 @@
type: TOAST_TYPE.SUCCESS
})
} catch (err: any) {
Toast({
message: err.message,
type: TOAST_TYPE.ERROR
})
if (err.code === 10025) {
showToast('该群组号已存在', 'error')
} else {
Toast({
message: err.message,
type: TOAST_TYPE.ERROR
})
}
}
}

View File

@@ -2,8 +2,8 @@
"name" : "密谈IM",
"appid" : "__UNI__9EFDC69",
"description" : "",
"versionName" : "1.0.8",
"versionCode" : 107,
"versionName" : "1.1.1",
"versionCode" : 110,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@@ -15,6 +15,9 @@ const PASSWORD_REGEX = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/
/** 交易密码必须是6位数字 */
const TRANSACTION_PASSWORD_REGEX = /^\d{6}$/
/** 群号码只能是数字至少3位最多11位*/
const GROUP_NUMBER_REGEX = /^\d{3,11}$/
/**
* 校验手机号
* @param {string} phone - 待校验的手机号
@@ -102,3 +105,22 @@ export const validateTransactionPassword = (password, name = '密码') => {
}
return { valid: true, message: '' }
}
/**
* 校验群号码
* @param {string} groupNumber - 待校验的群号码
* @returns {{ valid: boolean, message: string }}
*/
export const validateGroupNumber = groupNumber => {
if (!groupNumber) return { valid: false, message: '群号码不能为空' }
if (groupNumber.length < 3) {
return { valid: false, message: '群号码长度不能少于3位' }
}
if (groupNumber.length > 11) {
return { valid: false, message: '群号码长度不能超过11位' }
}
if (!GROUP_NUMBER_REGEX.test(groupNumber)) {
return { valid: false, message: '群号码只能是数字' }
}
return { valid: true, message: '' }
}