订单,视频通话需要开发

This commit is contained in:
cbb
2026-02-07 17:44:59 +08:00
parent 101ddcb0c1
commit 20b6be5dfb
13 changed files with 259 additions and 120 deletions

View File

@@ -31,12 +31,31 @@
<text class="action-btn-content">镜像</text>
</view>
<view class="action-btn" @tap="openNetworkQualityPanel">
<!-- <view class="action-btn" @tap="openNetworkQualityPanel">
<view class="action-btn-image-container">
<image class="action-btn-image" src="/static/images/live-dashboard.png" mode="aspectFit" />
</view>
<text class="action-btn-content">仪表盘</text>
</view>
</view> -->
<view class="action-btn" @tap="muteSpeak">
<view class="action-btn-image-container">
<image
v-if="isMessageDisabled"
class="action-btn-image"
src="/static/images/jinzhifayan.png"
mode="aspectFit"
/>
<image
v-else
class="action-btn-image"
src="/static/images/yunxufayan.png"
mode="aspectFit"
/>
</view>
<text v-if="isMessageDisabled" class="action-btn-content">禁止发言</text>
<text v-else class="action-btn-content">恢复发言</text>
</view>
</view>
</view>
</view>
@@ -50,7 +69,8 @@
<script setup>
import {
ref,
onMounted
onMounted,
watch
} from 'vue';
import NetworkQualityPanel from '@/uni_modules/tuikit-atomic-x/components/NetworkQualityPanel.nvue';
import BeautyPanel from '@/uni_modules/tuikit-atomic-x/components/BeautyPanel.nvue';
@@ -58,6 +78,8 @@
import {
useDeviceState
} from "@/uni_modules/tuikit-atomic-x/state/DeviceState";
import { useUI } from '../utils/use-ui';
import useLiveListState from '@/uni_modules/tuikit-atomic-x/state/LiveListState';
const {
isFrontCamera,
@@ -66,6 +88,10 @@
localMirrorType
} = useDeviceState(uni?.$liveID);
const { updateLiveInfo } = useLiveListState()
const { showLoading, hideLoading, showDialog, showToast } = useUI()
const defaultavatarURL = 'https://web.sdk.qcloud.com/component/TUIKit/assets/avatar_01.png';
const props = defineProps({
@@ -79,15 +105,30 @@
userName: '',
userID: '',
avatarURL: '',
isMessageDisabled: false,
userRole: 1
})
},
currentLive: {
type: Object,
default: () => ({})
}
});
const emit = defineEmits(['update:modelValue', 'update:currentLive']);
// 监听当前直播信息变化
watch(() => props?.currentLive, (newLive) => {
if (newLive) {
console.log('当前直播信息更新:', newLive);
isMessageDisabled.value = !newLive.isMessageDisable
}
});
const isShowNetworkQualityPanel = ref(false);
const isShowBeautyPanel = ref(false);
const isShowAudioEffect = ref(false);
/** 禁止发言状态 */
const isMessageDisabled = ref(true)
const handleBeauty = () => {
isShowBeautyPanel.value = true;
@@ -126,10 +167,37 @@
}
}
const emit = defineEmits(['update:modelValue']);
const close = () => {
emit('update:modelValue', false);
};
const muteSpeak = async () => {
// showDialog
const show = await showDialog('提示', `确认${isMessageDisabled.value ? '禁止' : '恢复'}全部观众发言?`)
if (show) {
showLoading()
const liveInfo = {
liveID: uni?.$liveID,
isMessageDisable: isMessageDisabled.value
}
updateLiveInfo({
liveInfo,
modifyFlagList: ['IS_MESSAGE_DISABLE'],
success: () => {
hideLoading()
showToast(`操作成功`, 'success')
isMessageDisabled.value = false
},
fail: (err) => {
hideLoading()
showToast(`操作失败`, 'error')
console.log('=====修改失败=====', err)
}
})
}
}
</script>
<style>