This commit is contained in:
yj 2025-02-07 17:46:35 +08:00
parent b916bb3a2f
commit 254417d23b
4 changed files with 68 additions and 6 deletions

4
app.js
View File

@ -1,5 +1,7 @@
App({
onShow() {
wx.setKeepScreenOn({
keepScreenOn: true,
});
}
});

View File

@ -142,6 +142,39 @@
&-smallvideo {
overflow-y: auto;
position: relative;
&-up {
position: fixed;
z-index: 5;
right: 7.4%;
top: 14%;
color: white;
background-color: rgba(0, 0, 0, 0.5);
border: 1px white solid;
width: 30rpx;
height: 20rpx;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.4;
}
&-down {
position: fixed;
z-index: 5;
right: 7.4%;
bottom: 14%;
color: white;
background-color: rgba(0, 0, 0, 0.5);
border: 1px white solid;
width: 30rpx;
height: 20rpx;
display: flex;
align-items: center;
justify-content: center;
opacity: 0.4;
}
&-box {
height: calc(100% / 3);

View File

@ -76,6 +76,7 @@ Page({
currentUid: '',
currentUser: '',
userNumer: 0,
scrollTop: 0,
noViewChatList: 0,
applySpeakDialog: false,
leaveDialog: false,
@ -500,9 +501,11 @@ Page({
})
break;
}
this.setData({
currentUser: roomUserList.find(row => row.uid == this.data.currentUid || row.screenShareId == this.data.currentUid)
})
if (item.user && (item.user.uid === this.data.currentUid)) {
this.setData({
currentUser: roomUserList.find(row => row.uid == this.data.currentUid || row.screenShareId == this.data.currentUid)
})
}
this.changeAgoraDevice()
},
async changeFooterList(e): Promise<void> {
@ -814,7 +817,7 @@ Page({
})
}
},
scroll() {
scroll(e) {
const query = wx.createSelectorQuery().in(this);
query.select('#meeting-content-smallvideo').boundingClientRect()
query.selectAll('.meeting-content-smallvideo-box').boundingClientRect()
@ -833,4 +836,22 @@ Page({
});
})
},
scrollUp() {
const query = wx.createSelectorQuery()
query.select('#meeting-content-smallvideo').scrollOffset((res => {
this.setData({
scrollTop: res.scrollTop - 50
})
}))
query.exec()
},
scrollDown() {
const query = wx.createSelectorQuery()
query.select('#meeting-content-smallvideo').scrollOffset((res => {
this.setData({
scrollTop: res.scrollTop + 50
})
}))
query.exec()
},
})

View File

@ -29,7 +29,7 @@
<text class="meeting-content-video-user-text">{{currentUser.userName}}</text>
</view>
</view>
<scroll-view scroll-y class="meeting-content-smallvideo" id="meeting-content-smallvideo" style="width: {{isFullscreen ? '0' :'20%'}}" bindscroll='scroll'>
<scroll-view scroll-y class="meeting-content-smallvideo" id="meeting-content-smallvideo" style="width: {{isFullscreen ? '0' :'20%'}}" bindscroll='scroll' scroll-top="{{scrollTop}}">
<view class="meeting-content-smallvideo-box" id="video-{{item.uid}}" wx:for="{{roomUserList}}" data-item="{{item}}" wx:key="index" bind:tap="clickChangeVideo" wx:if="{{item.isRoom && item.isAdmin}}">
<view class="meeting-content-smallvideo-box-view {{item.uid == currentUid ? 'active' : ''}}">
<view class="meeting-content-smallvideo-box-view-avatar {{item.uid == currentUid ? 'active' : ''}}" wx:if="{{!item.enableCamera}}">
@ -59,6 +59,12 @@
</view>
</view>
</view>
<view class="meeting-content-smallvideo-up" bind:tap="scrollUp" wx:if="{{isAdmin>3}}">
<t-icon name="chevron-up" size="24rpx" data-name="chevron-up" />
</view>
<view class="meeting-content-smallvideo-down" bind:tap="scrollDown" wx:if="{{isAdmin>3}}">
<t-icon name="chevron-down" size="24rpx" data-name="chevron-down" />
</view>
</scroll-view>
</view>
<view class="meeting-footer" wx:if="{{!isFullscreen}}">