发送红包接口有问题,添加群恢复

This commit is contained in:
bobobobo
2026-01-08 01:44:39 +08:00
parent 1634425c17
commit c0619ea4ec
20 changed files with 2070 additions and 1531 deletions

View File

@@ -30,13 +30,13 @@
<Icon :file="rightIcon" />
</span>
</li>
<li class="group-list-item" @click="cbPopupShow.open('bottom')">
<!-- <li class="group-list-item" @click="cbPopupShow.open('bottom')">
<label class="group-list-item-label">申请加群方式</label>
<span class="group-h5-list-item-content">
<p class="content">{{ applyJoinOptionName }}</p>
<Icon :file="rightIcon" />
</span>
</li>
</li> -->
<li class="group-list-introduction">
<div class="group-list-item">
<label class="group-list-item-label">
@@ -261,59 +261,55 @@
const createGroup = async (options: any) => {
try {
const data = {
applyJoinOption: applyJoinOption.value,
faceUrl: groupAvatar.value,
groupName: options.name,
groupType: options.type,
memberList: options.memberList.map((item: IUserProfile) => {
return { memberAccount: item.userID }
})
}
const res = await createImGroup(data)
const e = res.data
// const type = e.groupType
// if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
// await TUIGroupService.joinGroup({
// groupID: e.groupID,
// applyMessage: ''
// const data = {
// applyJoinOption: applyJoinOption.value,
// faceUrl: groupAvatar.value,
// groupName: options.name,
// groupType: options.type,
// memberList: options.memberList.map((item: IUserProfile) => {
// return { memberAccount: item.userID }
// })
// }
const newRes = await TUIGroupService.getGroupProfile({
groupID: e.groupId
})
// const res = await createImGroup(data)
// const e = res.data
handleCompleteCreate(newRes.data.group)
Toast({
message: TUITranslateService.t('TUIGroup.群组创建成功'),
type: TOAST_TYPE.SUCCESS
})
// const newRes = await TUIGroupService.getGroupProfile({
// groupID: e.groupId
// })
// ========= 原本逻辑
// options.memberList = options.memberList.map(
// (item: IUserProfile) => {
// return { userID: item.userID }
// }
// )
// if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
// delete options.groupID
// }
// const res = await TUIGroupService.createGroup(options)
// console.log(res)
// const { type } = res.data.group
// if (type === TUIChatEngine.TYPES.GRP_AVCHATROOM) {
// await TUIGroupService.joinGroup({
// groupID: res.data.group.groupID,
// applyMessage: ''
// })
// }
// handleCompleteCreate(res.data.group)
// handleCompleteCreate(newRes.data.group)
// Toast({
// message: TUITranslateService.t('TUIGroup.群组创建成功'),
// type: TOAST_TYPE.SUCCESS
// })
// ========= 原本逻辑
options.memberList = options.memberList.map(
(item: IUserProfile) => {
return { userID: item.userID }
}
)
if (options.type === TUIChatEngine.TYPES.GRP_COMMUNITY) {
delete options.groupID
}
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({
groupID: res.data.group.groupID,
applyMessage: ''
})
}
handleCompleteCreate(res.data.group)
Toast({
message: TUITranslateService.t('TUIGroup.群组创建成功'),
type: TOAST_TYPE.SUCCESS
})
} catch (err: any) {
Toast({
message: err.message,

View File

@@ -238,7 +238,11 @@
import Server from '../server'
import { enableSampleTaskStatus } from '../../../utils/enableSampleTaskStatus'
import { IFriendProfile, IGroupMember } from '../../../interface'
import { createImGroup, deleteImGroup, quitImGroup } from '../../../../api/tui-kit'
import {
createImGroup,
deleteImGroup,
quitImGroup
} from '../../../../api/tui-kit'
const TUIGroupServer = Server.getInstance()
const TUIConstants = TUIGroupServer.constants
@@ -400,47 +404,63 @@
const updateProfile = async (newGroupProfile: any) => {
const { key, value } = newGroupProfile
if (key === 'muteAllMembers') {
const options: any = {
groupID: currentGroup.value.groupID,
[key]: value
}
TUIGroupService.updateGroupProfile(options)
.then((res: any) => {
console.log(res.data)
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
} else {
const newKey = {
notification: 'notification',
name: 'groupName'
}[key]
const options: any = {
groupId: currentGroup.value.groupID,
[newKey]: value
}
await createImGroup(options, 'put')
TUIGroupService.getGroupProfile({
groupID: currentGroup.value.groupID
})
.then((res: any) => {
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
const options: any = {
groupID: currentGroup.value.groupID,
[key]: value
}
TUIGroupService.updateGroupProfile(options)
.then((res: any) => {
console.log(res.data)
currentGroup.value = res.data.group
editLableName.value = ''
})
.catch((error: any) => {
Toast({
message: error?.message,
type: TOAST_TYPE.ERROR
})
})
// if (key === 'muteAllMembers') {
// const options: any = {
// groupID: currentGroup.value.groupID,
// [key]: value
// }
// TUIGroupService.updateGroupProfile(options)
// .then((res: any) => {
// console.log(res.data)
// currentGroup.value = res.data.group
// editLableName.value = ''
// })
// .catch((error: any) => {
// Toast({
// message: error?.message,
// type: TOAST_TYPE.ERROR
// })
// })
// } else {
// const newKey = {
// notification: 'notification',
// name: 'groupName'
// }[key]
// const options: any = {
// groupId: currentGroup.value.groupID,
// [newKey]: value
// }
// await createImGroup(options, 'put')
// TUIGroupService.getGroupProfile({
// groupID: currentGroup.value.groupID
// })
// .then((res: any) => {
// currentGroup.value = res.data.group
// editLableName.value = ''
// })
// .catch((error: any) => {
// Toast({
// message: error?.message,
// type: TOAST_TYPE.ERROR
// })
// })
// }
}
const setCurrentTab = (tabName: string) => {
@@ -656,8 +676,8 @@
}
const dismissGroup = async (group: any) => {
await deleteImGroup(group.groupID)
// await TUIGroupService.dismissGroup(group.groupID);
// await deleteImGroup(group.groupID)
await TUIGroupService.dismissGroup(group.groupID)
enableSampleTaskStatus('dismissGroup')
Toast({
message: TUITranslateService.t('TUIGroup.群组解散成功'),
@@ -874,8 +894,8 @@
}
const quitGroup = async (group: any) => {
await quitImGroup(group.groupID)
// await TUIGroupService.quitGroup(group.groupID)
// await quitImGroup(group.groupID)
await TUIGroupService.quitGroup(group.groupID)
clearGroupInfo()
}