修复已知问题
This commit is contained in:
@@ -56,7 +56,7 @@
|
|||||||
item.type === TYPES.MSG_GRP_TIP ||
|
item.type === TYPES.MSG_GRP_TIP ||
|
||||||
isCreateGroupCustomMessage(item)
|
isCreateGroupCustomMessage(item)
|
||||||
"
|
"
|
||||||
:content="item"
|
:content="item.getMessageContent()"
|
||||||
/>
|
/>
|
||||||
<div
|
<div
|
||||||
v-else-if="!item.isRevoked && !isPluginMessage(item)"
|
v-else-if="!item.isRevoked && !isPluginMessage(item)"
|
||||||
|
|||||||
@@ -5,44 +5,50 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts" setup>
|
<script lang="ts" setup>
|
||||||
import { computed } from '../../../../adapter-vue';
|
import { computed } from '../../../../adapter-vue'
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
content: {
|
content: {
|
||||||
type: Object,
|
type: Object,
|
||||||
default: () => ({}),
|
default: () => ({})
|
||||||
},
|
}
|
||||||
});
|
})
|
||||||
const tipContent = computed(() => `${props.content.nick || props.content.from} 创建群聊`);
|
|
||||||
|
const tipContent = computed(() => {
|
||||||
|
if (props.content?.businessID == 'group_create') {
|
||||||
|
return `${props.content?.showName} 创建群聊`
|
||||||
|
}
|
||||||
|
return props.content?.text || props.content?.custom || ''
|
||||||
|
})
|
||||||
</script>
|
</script>
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
@import "../../../../assets/styles/common";
|
@import '../../../../assets/styles/common';
|
||||||
|
|
||||||
.message-tip {
|
.message-tip {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
padding: 0 20px;
|
padding: 0 20px;
|
||||||
color: #999;
|
color: #999;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
overflow-wrap: anywhere;
|
overflow-wrap: anywhere;
|
||||||
display: flex;
|
display: flex;
|
||||||
place-content: center center;
|
place-content: center center;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin-bottom: 10px;
|
margin-bottom: 10px;
|
||||||
|
|
||||||
&-highlight {
|
&-highlight {
|
||||||
animation: highlight 1000ms infinite;
|
animation: highlight 1000ms infinite;
|
||||||
|
|
||||||
@keyframes highlight {
|
@keyframes highlight {
|
||||||
50% {
|
50% {
|
||||||
color: #ff9c19;
|
color: #ff9c19;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@keyframes highlight {
|
@keyframes highlight {
|
||||||
50% {
|
50% {
|
||||||
color: #ff9c19;
|
color: #ff9c19;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -31,10 +31,27 @@
|
|||||||
@click="handleMenu(childrenItem)"
|
@click="handleMenu(childrenItem)"
|
||||||
>
|
>
|
||||||
<Icon
|
<Icon
|
||||||
v-if="childrenItem.icon"
|
v-if="
|
||||||
|
childrenItem.icon &&
|
||||||
|
!['isAddUser', 'isScan'].includes(
|
||||||
|
childrenItem.data.name
|
||||||
|
)
|
||||||
|
"
|
||||||
class="list-item-icon"
|
class="list-item-icon"
|
||||||
:file="childrenItem.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">
|
<h1 class="list-item-title">
|
||||||
{{ childrenItem.text }}
|
{{ childrenItem.text }}
|
||||||
</h1>
|
</h1>
|
||||||
@@ -108,6 +125,7 @@
|
|||||||
listener = { onClicked: () => {} }
|
listener = { onClicked: () => {} }
|
||||||
} = item
|
} = item
|
||||||
if (children) {
|
if (children) {
|
||||||
|
// TUIKit\assets\icon\user-add.svg
|
||||||
const addUserItem = {
|
const addUserItem = {
|
||||||
data: { name: 'isAddUser' },
|
data: { name: 'isAddUser' },
|
||||||
icon: '/TUIKit/assets/icon/user-add.svg',
|
icon: '/TUIKit/assets/icon/user-add.svg',
|
||||||
|
|||||||
@@ -163,7 +163,10 @@
|
|||||||
import { createImGroup } from '../../../../api/tui-kit'
|
import { createImGroup } from '../../../../api/tui-kit'
|
||||||
import { chooseImage } from '../../../../utils/media'
|
import { chooseImage } from '../../../../utils/media'
|
||||||
import { uploadSingleFile } from '../../../../utils/uploadFile'
|
import { uploadSingleFile } from '../../../../utils/uploadFile'
|
||||||
|
import { validateGroupNumber } from '../../../../utils/validate'
|
||||||
|
import { useUI } from '../../../../utils/use-ui'
|
||||||
|
|
||||||
|
const { showToast } = useUI()
|
||||||
const TUIGroupServer = Server.getInstance()
|
const TUIGroupServer = Server.getInstance()
|
||||||
const TUIConstants = TUIGroupServer.constants
|
const TUIConstants = TUIGroupServer.constants
|
||||||
|
|
||||||
@@ -229,9 +232,7 @@
|
|||||||
placeholder: TUITranslateService.t('TUIGroup.请输入群名称')
|
placeholder: TUITranslateService.t('TUIGroup.请输入群名称')
|
||||||
}
|
}
|
||||||
const groupIDInput = {
|
const groupIDInput = {
|
||||||
name: `${TUITranslateService.t(
|
name: `群号码`,
|
||||||
'TUIGroup.群ID'
|
|
||||||
)}(${TUITranslateService.t('TUIGroup.选填')})`,
|
|
||||||
key: 'groupID',
|
key: 'groupID',
|
||||||
placeholder: '搜索加入群使用'
|
placeholder: '搜索加入群使用'
|
||||||
}
|
}
|
||||||
@@ -241,7 +242,10 @@
|
|||||||
})
|
})
|
||||||
|
|
||||||
const submitDisabledStatus = computed(() => {
|
const submitDisabledStatus = computed(() => {
|
||||||
return groupInfo.profile.name === '' && !groupInfo.isEdit
|
return (
|
||||||
|
groupInfo.profile.name === '' ||
|
||||||
|
(groupInfo.profile.groupID === '' && !groupInfo.isEdit)
|
||||||
|
)
|
||||||
})
|
})
|
||||||
|
|
||||||
const selected = (type: any) => {
|
const selected = (type: any) => {
|
||||||
@@ -296,11 +300,15 @@
|
|||||||
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
|
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
|
||||||
delete options.groupID
|
delete options.groupID
|
||||||
}
|
}
|
||||||
|
const isGroupID = validateGroupNumber(options.groupID)
|
||||||
|
|
||||||
|
if (!isGroupID.valid) {
|
||||||
|
return showToast(isGroupID.message)
|
||||||
|
}
|
||||||
const res = await TUIGroupService.createGroup({
|
const res = await TUIGroupService.createGroup({
|
||||||
...options,
|
...options,
|
||||||
avatar: groupAvatar.value
|
avatar: groupAvatar.value
|
||||||
})
|
})
|
||||||
console.log(res)
|
|
||||||
const { type } = res.data.group
|
const { type } = res.data.group
|
||||||
if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
|
if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
|
||||||
await TUIGroupService.joinGroup({
|
await TUIGroupService.joinGroup({
|
||||||
@@ -314,10 +322,14 @@
|
|||||||
type: TOAST_TYPE.SUCCESS
|
type: TOAST_TYPE.SUCCESS
|
||||||
})
|
})
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
Toast({
|
if (err.code === 10025) {
|
||||||
message: err.message,
|
showToast('该群组号已存在', 'error')
|
||||||
type: TOAST_TYPE.ERROR
|
} else {
|
||||||
})
|
Toast({
|
||||||
|
message: err.message,
|
||||||
|
type: TOAST_TYPE.ERROR
|
||||||
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name" : "密谈IM",
|
"name" : "密谈IM",
|
||||||
"appid" : "__UNI__9EFDC69",
|
"appid" : "__UNI__9EFDC69",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.8",
|
"versionName" : "1.1.1",
|
||||||
"versionCode" : 107,
|
"versionCode" : 110,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -15,6 +15,9 @@ const PASSWORD_REGEX = /^(?=.*[A-Za-z])(?=.*\d)[A-Za-z\d@$!%*#?&]{8,}$/
|
|||||||
/** 交易密码(必须是6位数字) */
|
/** 交易密码(必须是6位数字) */
|
||||||
const TRANSACTION_PASSWORD_REGEX = /^\d{6}$/
|
const TRANSACTION_PASSWORD_REGEX = /^\d{6}$/
|
||||||
|
|
||||||
|
/** 群号码(只能是数字,至少3位,最多11位)*/
|
||||||
|
const GROUP_NUMBER_REGEX = /^\d{3,11}$/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验手机号
|
* 校验手机号
|
||||||
* @param {string} phone - 待校验的手机号
|
* @param {string} phone - 待校验的手机号
|
||||||
@@ -102,3 +105,22 @@ export const validateTransactionPassword = (password, name = '密码') => {
|
|||||||
}
|
}
|
||||||
return { valid: true, message: '' }
|
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: '' }
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user