This commit is contained in:
bobobobo
2026-02-12 20:25:35 +08:00
parent 2191f46317
commit 2f1b592772
7 changed files with 158 additions and 21 deletions

View File

@@ -83,6 +83,7 @@
import TUIChatConfig from '../config'
import { useAuthUser } from '../../../../composables/useAuthUser'
import { useUI } from '../../../../utils/use-ui'
import { getGroupBanList } from '../../../../api'
interface IProps {
placeholder: string
@@ -171,15 +172,23 @@
const getMuteTime = async (displayType: ToolbarDisplayType) => {
TUIGroupService.getGroupProfile({
groupID: props.groupID
}).then(res => {
}).then(async res => {
// muteAllMembers
console.log(res.data.group.muteAllMembers)
if (res.data.group.muteAllMembers) {
// 禁言了
showDialog('提示', '当前群组已全员禁言', false)
} else {
// emits('changeToolbarDisplayType', displayType)
// 判断某个成员是不是禁言
const list = await getGroupBanList(props.groupID)
const show = list.data.MutedAccountList.find(
(v: any) => v.Member_Account === tencentUserSig.value.userId
)
if (show?.Member_Account) {
showDialog('提示', '你被禁言了', false)
} else {
emits('changeToolbarDisplayType', displayType)
}
}
})
}

View File

@@ -16,6 +16,7 @@ import OfflinePushInfoManager, {
} from '../offlinePushInfoManager/index'
import { useAuthUser } from '../../../../composables/useAuthUser'
import { useUI } from '../../../../utils/use-ui'
import { getGroupBanList } from '../../../../api'
export const sendMessageErrorCodeMap: Map<number, string> = new Map([
[3123, '文本包含本地审核拦截词'],
@@ -130,6 +131,21 @@ export const sendMessages = async (
showDialog('提示', '当前群组已全员禁言', false)
} else {
// 判断某个成员是不是禁言
const list = await getGroupBanList(
currentConversation?.groupProfile?.groupID
)
const show = list.data.MutedAccountList.find(
(v: any) =>
v.Member_Account === tencentUserSig.value.userId
)
if (show?.Member_Account) {
showDialog('提示', '你被禁言了', false)
} else {
await TUIChatService.sendTextMessage(
options,
sendMessageOptions
)
}
}
} else {
await TUIChatService.sendTextMessage(

View File

@@ -187,3 +187,11 @@ export const banUser = data => {
method: 'post'
})
}
/** 群禁言列表 */
export const getGroupBanList = id => {
return http({
url: `/api/service/imGroup/muted/account/${id}`,
method: 'get'
})
}

View File

@@ -2,8 +2,8 @@
"name" : "密谈IM",
"appid" : "__UNI__D40A151",
"description" : "",
"versionName" : "1.1.5",
"versionCode" : 114,
"versionName" : "1.1.6",
"versionCode" : 115,
"transformPx" : false,
/* 5+App */
"app-plus" : {

View File

@@ -506,6 +506,13 @@
"navigationBarTitleText": "记录详情",
"navigationBarBackgroundColor": "#ffffff"
}
},
{
"path": "pages/discover/livelist/list",
"style": {
"navigationBarTitleText": "直播列表",
"navigationBarBackgroundColor": "#ffffff"
}
}
],
"globalStyle": {

View File

@@ -2,7 +2,6 @@
import { navigateTo } from '@/utils/router'
import { ref } from 'vue'
import { useUI } from '@/utils/use-ui'
import { getLiveRoomList } from '../../api/tui-kit'
const { showDialog } = useUI()
@@ -52,22 +51,7 @@
return
}
if (item === 'liveStream') {
getLiveRoomList({
pageNum: 1,
pageSize: 15
})
return
let url = ''
// #ifdef APP-PLUS
url = '/pages/discover/livelist/index'
// #endif
// #ifdef H5
url = '/pages/discover/livelist/h5-list'
// #endif
navigateTo(url)
return
navigateTo('/pages/discover/livelist/list')
}
}

View File

@@ -0,0 +1,113 @@
<script setup>
import { navigateTo } from '@/utils/router'
import { getLiveRoomList } from '../../../api/tui-kit'
import { ref } from 'vue'
const list = ref([])
const paging = ref(null)
const getList = async (pageNum, pageSize) => {
try {
const res = await getLiveRoomList({
pageNum,
pageSize
})
paging.value.complete(res.rows)
} catch (error) {
paging.value.complete(false)
}
}
const onGo = item => {
// #ifdef APP-PLUS
uni.$liveID = item.roomId
navigateTo('/pages/audience/index', { liveID: item.roomId })
// #endif
// #ifdef H5
navigateTo('/pages/discover/livelist/h5-live-player', {
liveId: item.roomId
})
// #endif
}
</script>
<template>
<z-paging
ref="paging"
v-model="list"
:default-page-no="1"
:default-page-size="15"
safe-area-inset-bottom
use-safe-area-placeholder
:paging-style="{ 'background-color': '#f9f9f9' }"
@query="getList"
>
<view class="list-box">
<view
v-for="item in list"
:key="item.roomId"
class="live-box"
@click="onGo(item)"
>
<!-- 背景图 -->
<image
:src="item.coverUrl"
lazy-load
mode="aspectFill"
class="bg-box"
/>
<view class="title-box">
<view class="title-text">
<text>
{{ item.roomName }}
</text>
</view>
</view>
</view>
</view>
</z-paging>
</template>
<style lang="scss" scoped>
.list-box {
display: flex;
flex-wrap: wrap;
justify-content: space-between;
padding: 0 20rpx;
.live-box {
width: 48%;
margin-top: 32rpx;
height: 420rpx;
border-radius: 20rpx;
overflow: hidden;
position: relative;
.bg-box {
width: 100%;
height: 100%;
}
.title-box {
position: absolute;
width: 100%;
left: 0;
bottom: 0;
padding: 16rpx 0;
background: rgba(88, 88, 88, 0.164);
display: flex;
align-items: center;
.title-text {
color: #fff;
padding: 0 10rpx 0 14rpx;
font-size: 26rpx;
text {
display: -webkit-box;
-webkit-line-clamp: 1; /* 显示3行 */
-webkit-box-orient: vertical;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
}
</style>