This commit is contained in:
parent
d6718ae65b
commit
877754ac06
|
|
@ -310,7 +310,7 @@
|
||||||
|
|
||||||
.user-popup {
|
.user-popup {
|
||||||
width: 30vw;
|
width: 30vw;
|
||||||
height: 100vh;
|
height: 88vh;
|
||||||
background-color: #16191E;
|
background-color: #16191E;
|
||||||
padding: 10rpx 0;
|
padding: 10rpx 0;
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
|
|
@ -318,12 +318,18 @@
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
||||||
&-title {
|
&-title {
|
||||||
color: white;
|
color: gray;
|
||||||
text-align: center;
|
|
||||||
font-size: 16rpx;
|
font-size: 16rpx;
|
||||||
flex-shrink: 0;
|
flex-shrink: 0;
|
||||||
border-bottom: 1px rgb(59, 59, 59) solid;
|
border-bottom: 1px rgb(59, 59, 59) solid;
|
||||||
padding-bottom: 10rpx;
|
padding-bottom: 10rpx;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: space-around;
|
||||||
|
|
||||||
|
&-active {
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&-view {
|
&-view {
|
||||||
|
|
@ -333,6 +339,7 @@
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
&-view {
|
&-view {
|
||||||
|
color: white;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
|
|
@ -344,7 +351,6 @@
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
|
|
||||||
&-text {
|
&-text {
|
||||||
color: white;
|
|
||||||
font-size: 14rpx;
|
font-size: 14rpx;
|
||||||
margin: 0 2rpx;
|
margin: 0 2rpx;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
|
|
|
||||||
|
|
@ -73,6 +73,7 @@ Page({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
channelId: '',
|
channelId: '',
|
||||||
|
tabBarIndex: 1,
|
||||||
roomInfo: '',
|
roomInfo: '',
|
||||||
roomUserList: [],
|
roomUserList: [],
|
||||||
audioList: [],
|
audioList: [],
|
||||||
|
|
@ -106,7 +107,10 @@ Page({
|
||||||
isReconnec: false,
|
isReconnec: false,
|
||||||
isAutoApplySpeakDialog: false,
|
isAutoApplySpeakDialog: false,
|
||||||
showScroll: false,
|
showScroll: false,
|
||||||
reconnecNumber: 0
|
reconnecNumber: 0,
|
||||||
|
setting: {
|
||||||
|
voiceStimulation: true, //语音激励
|
||||||
|
}
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
'roomUserList.**': function (roomUserList) {
|
'roomUserList.**': function (roomUserList) {
|
||||||
|
|
@ -269,6 +273,17 @@ Page({
|
||||||
},
|
},
|
||||||
onReady() {
|
onReady() {
|
||||||
wx.onNetworkStatusChange(this.listener)
|
wx.onNetworkStatusChange(this.listener)
|
||||||
|
const setting: any = getStorage('setting')
|
||||||
|
if (setting) {
|
||||||
|
this.setData({
|
||||||
|
setting
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
wx.setStorage({
|
||||||
|
key: "setting",
|
||||||
|
data: this.data.setting
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
async onShow() {
|
async onShow() {
|
||||||
wx.setKeepScreenOn({
|
wx.setKeepScreenOn({
|
||||||
|
|
@ -285,6 +300,7 @@ Page({
|
||||||
this.reconnecFun()
|
this.reconnecFun()
|
||||||
}
|
}
|
||||||
isSpeakTime = setInterval(() => {
|
isSpeakTime = setInterval(() => {
|
||||||
|
if (this.data.setting.voiceStimulation) {
|
||||||
function getMaxObject(arr) {
|
function getMaxObject(arr) {
|
||||||
let maxObject = arr[0];
|
let maxObject = arr[0];
|
||||||
for (let i = 1; i < arr.length; i++) {
|
for (let i = 1; i < arr.length; i++) {
|
||||||
|
|
@ -297,11 +313,12 @@ Page({
|
||||||
const isShare = this.data.roomUserList.find(item => item.shareSrc)
|
const isShare = this.data.roomUserList.find(item => item.shareSrc)
|
||||||
const item = getMaxObject(this.data.audioList)
|
const item = getMaxObject(this.data.audioList)
|
||||||
const user = this.data.roomUserList.find(row => item.uid === row.uid)
|
const user = this.data.roomUserList.find(row => item.uid === row.uid)
|
||||||
if (this.data.currentUid !== item.uid && !isShare && (user && user.isRoom) && item.volumeNumber > 0) {
|
if (this.data.currentUid !== item.uid && !isShare && (user && user.isRoom) && item.volumeNumber > 0 && item.uid !== this.data.user.uid) {
|
||||||
this.setData({
|
this.setData({
|
||||||
currentUid: item.uid
|
currentUid: item.uid
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}, 3000)
|
}, 3000)
|
||||||
},
|
},
|
||||||
// 隐藏
|
// 隐藏
|
||||||
|
|
@ -335,6 +352,8 @@ Page({
|
||||||
},
|
},
|
||||||
async startReconnec() {
|
async startReconnec() {
|
||||||
if (getSignIr() === signalR.HubConnectionState.Connected) {
|
if (getSignIr() === signalR.HubConnectionState.Connected) {
|
||||||
|
clearTimeout(reconnectTime)
|
||||||
|
reconnectTime = ''
|
||||||
await GetRoomRtcToken(this.data.channelId).then(res => {
|
await GetRoomRtcToken(this.data.channelId).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
agora.reconnecSetOption(res.data, async (bool) => {
|
agora.reconnecSetOption(res.data, async (bool) => {
|
||||||
|
|
@ -350,8 +369,6 @@ Page({
|
||||||
duration: 3000,
|
duration: 3000,
|
||||||
content: '重连成功',
|
content: '重连成功',
|
||||||
});
|
});
|
||||||
clearTimeout(reconnectTime)
|
|
||||||
reconnectTime = ''
|
|
||||||
this.setData({
|
this.setData({
|
||||||
isReconnec: false
|
isReconnec: false
|
||||||
})
|
})
|
||||||
|
|
@ -716,10 +733,43 @@ Page({
|
||||||
item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager
|
item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager
|
||||||
item.avatarName = item.userName?.slice(-2)
|
item.avatarName = item.userName?.slice(-2)
|
||||||
})
|
})
|
||||||
|
if (this.data.roomUserList.length) {
|
||||||
|
let arr: any = []
|
||||||
|
const { roomUserList } = this.data;
|
||||||
|
res.data.forEach((item: any) => {
|
||||||
|
let userItem = roomUserList.find((row: any) => row.uid == item.uid);
|
||||||
|
if (userItem) {
|
||||||
|
userItem.enableCamera = item.enableCamera;
|
||||||
|
userItem.enableMicr = item.enableMicr;
|
||||||
|
userItem.isRoomManager = item.isRoomManager;
|
||||||
|
userItem.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager;
|
||||||
|
} else {
|
||||||
|
arr.push(item)
|
||||||
|
}
|
||||||
|
});
|
||||||
|
this.setData({
|
||||||
|
roomUserList: [...roomUserList, ...arr]
|
||||||
|
})
|
||||||
|
} else {
|
||||||
this.setData({
|
this.setData({
|
||||||
roomUserList: res.data
|
roomUserList: res.data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 切换tab
|
||||||
|
setTabBarIndex(e) {
|
||||||
|
this.setData({
|
||||||
|
tabBarIndex: Number(e.currentTarget.dataset.tabbarindex)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 修改缓存设置
|
||||||
|
changeSetting(e) {
|
||||||
|
this.data.setting[e.currentTarget.dataset.str] = e.detail.value
|
||||||
|
wx.setStorage({
|
||||||
|
key: "setting",
|
||||||
|
data: this.data.setting
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 成员显示用户名称
|
// 成员显示用户名称
|
||||||
|
|
|
||||||
|
|
@ -18,8 +18,8 @@
|
||||||
<view class="meeting-content-video-canvas" wx:if="{{currentUser.shareSrc}}">
|
<view class="meeting-content-video-canvas" wx:if="{{currentUser.shareSrc}}">
|
||||||
<live-player id="player" src="{{currentUser.shareSrc}}" mode="RTC" autoplay="true" object-fit="contain" />
|
<live-player id="player" src="{{currentUser.shareSrc}}" mode="RTC" autoplay="true" object-fit="contain" />
|
||||||
</view>
|
</view>
|
||||||
<view class="meeting-content-video-canvas" wx:else>
|
<view class="meeting-content-video-canvas" wx:elif='{{currentUser.enableCamera}}'>
|
||||||
<live-player id="player" src="{{currentUser.src}}" mode="RTC" autoplay="true" object-fit="contain" muted="{{!currentUser.enableMicr}}" />
|
<live-player id="player" src="{{currentUser.src}}" mode="RTC" autoplay="true" object-fit="contain" muted="{{currentUser.uid === user.uid ? true : !currentUser.enableMicr}}" />
|
||||||
</view>
|
</view>
|
||||||
<view class="meeting-content-video-user">
|
<view class="meeting-content-video-user">
|
||||||
<view class="meeting-content-video-user-view" wx:if="{{currentUser.roleId === '1' || currentUser.roleId === '3'}}" style=" background:#FDC229">
|
<view class="meeting-content-video-user-view" wx:if="{{currentUser.roleId === '1' || currentUser.roleId === '3'}}" style=" background:#FDC229">
|
||||||
|
|
@ -39,7 +39,7 @@
|
||||||
</view>
|
</view>
|
||||||
<view class="meeting-content-smallvideo-box-view-canvas" wx:if="{{item.src}}">
|
<view class="meeting-content-smallvideo-box-view-canvas" wx:if="{{item.src}}">
|
||||||
<live-pusher wx:if="{{user.uid === item.uid}}" url="{{item.src}}" mode="RTC" object-fit="contain" background-mute enable-mic="{{footerList[1].active}}" enable-camera max-bitrate="500" min-bitrate="200" autopush enable-agc enable-ans device-position="front" class="meeting-content-smallvideo-box-view-canvas-play" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" beauty='{{9}}' whiteness='{{9}}' />
|
<live-pusher wx:if="{{user.uid === item.uid}}" url="{{item.src}}" mode="RTC" object-fit="contain" background-mute enable-mic="{{footerList[1].active}}" enable-camera max-bitrate="500" min-bitrate="200" autopush enable-agc enable-ans device-position="front" class="meeting-content-smallvideo-box-view-canvas-play" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" beauty='{{9}}' whiteness='{{9}}' />
|
||||||
<live-player src="{{item.src}}" class="meeting-content-smallvideo-box-view-canvas-play" mode="RTC" autoplay="true" muted="{{!item.enableMicr}}" object-fit="contain" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" wx:else />
|
<live-player src="{{item.src}}" class="meeting-content-smallvideo-box-view-canvas-play" mode="RTC" autoplay="true" muted="{{item.uid === user.uid ? true : !item.enableMicr}}" object-fit="contain" data-uid="{{item.uid}}" bindaudiovolumenotify="playerAudioVolumenotify" wx:else />
|
||||||
</view>
|
</view>
|
||||||
<view class="meeting-content-smallvideo-box-view-user">
|
<view class="meeting-content-smallvideo-box-view-user">
|
||||||
<view class="meeting-content-smallvideo-box-view-user-view" wx:if="{{item.roleId === '1' || item.roleId === '3'}}" style=" background:#FDC229">
|
<view class="meeting-content-smallvideo-box-view-user-view" wx:if="{{item.roleId === '1' || item.roleId === '3'}}" style=" background:#FDC229">
|
||||||
|
|
@ -91,12 +91,13 @@
|
||||||
<t-message id="t-message" />
|
<t-message id="t-message" />
|
||||||
<t-dialog visible="{{applySpeakDialog}}" content="该操作需向管理员申请发言权限" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" cancel-btn="取消" data-type="applySpeakDialog" bind:confirm="closeDialog" bind:cancel="closeDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
<t-dialog visible="{{applySpeakDialog}}" content="该操作需向管理员申请发言权限" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" cancel-btn="取消" data-type="applySpeakDialog" bind:confirm="closeDialog" bind:cancel="closeDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
||||||
<t-dialog visible="{{leaveDialog}}" content="确定离开房间吗?" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" cancel-btn="取消" data-type="leaveDialog" bind:confirm="closeDialog" bind:cancel="closeDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
<t-dialog visible="{{leaveDialog}}" content="确定离开房间吗?" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" cancel-btn="取消" data-type="leaveDialog" bind:confirm="closeDialog" bind:cancel="closeDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
||||||
<t-popup visible="{{userPopupVisible}}" bind:visible-change="onVisibleChange" placement="right">
|
<t-popup visible="{{userPopupVisible}}" bind:visible-change="onVisibleChange" placement="right" style="bottom: 0;top:unset;height: 88vh;">
|
||||||
<view class="user-popup">
|
<view class="user-popup">
|
||||||
<view class="user-popup-title">
|
<view class="user-popup-title">
|
||||||
成员
|
<view class="{{ tabBarIndex === 1 ? ' user-popup-title-active' : '' }}" bind:tap="setTabBarIndex" data-tabBarIndex='1'>成员</view>
|
||||||
|
<view class="{{ tabBarIndex === 2 ? ' user-popup-title-active' : '' }}" bind:tap="setTabBarIndex" data-tabBarIndex='2'>设置</view>
|
||||||
</view>
|
</view>
|
||||||
<scroll-view scroll-y class="user-popup-view" enhanced>
|
<scroll-view scroll-y class="user-popup-view" enhanced wx:if="{{tabBarIndex === 1}}">
|
||||||
<view class="user-popup-view-view" wx:for="{{roomUserList}}" data-item="{{item}}" wx:key="index" wx:if="{{item.isRoom}}">
|
<view class="user-popup-view-view" wx:for="{{roomUserList}}" data-item="{{item}}" wx:key="index" wx:if="{{item.isRoom}}">
|
||||||
<view class="user-popup-view-view-avatar" bind:tap="showMultiText" data-item="{{item}}">
|
<view class="user-popup-view-view-avatar" bind:tap="showMultiText" data-item="{{item}}">
|
||||||
<t-avatar size="36rpx">{{item.avatarName}}</t-avatar>
|
<t-avatar size="36rpx">{{item.avatarName}}</t-avatar>
|
||||||
|
|
@ -109,6 +110,12 @@
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</scroll-view>
|
</scroll-view>
|
||||||
|
<scroll-view scroll-y class="user-popup-view" enhanced wx:else>
|
||||||
|
<view class="user-popup-view-view">
|
||||||
|
<text>语音激励</text>
|
||||||
|
<switch checked="{{setting.voiceStimulation}}" bindchange="changeSetting" data-str='voiceStimulation' />
|
||||||
|
</view>
|
||||||
|
</scroll-view>
|
||||||
</view>
|
</view>
|
||||||
</t-popup>
|
</t-popup>
|
||||||
<t-popup visible="{{chatPopupVisible}}" bind:visible-change="onVisibleChange" placement="right">
|
<t-popup visible="{{chatPopupVisible}}" bind:visible-change="onVisibleChange" placement="right">
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue