This commit is contained in:
parent
21901de43a
commit
54187034df
3
app.json
3
app.json
|
|
@ -14,7 +14,8 @@
|
|||
"t-message": "tdesign-miniprogram/message/message",
|
||||
"t-dialog": "tdesign-miniprogram/dialog/dialog",
|
||||
"t-popup": "tdesign-miniprogram/popup/popup",
|
||||
"t-cell": "tdesign-miniprogram/cell/cell"
|
||||
"t-cell": "tdesign-miniprogram/cell/cell",
|
||||
"t-toast": "tdesign-miniprogram/toast/toast"
|
||||
},
|
||||
"entryPagePath": "pages/form/index",
|
||||
"window": {
|
||||
|
|
|
|||
|
|
@ -222,6 +222,18 @@ Page({
|
|||
})
|
||||
return
|
||||
}
|
||||
if (this.data.meetingForm.roomName.length > 10) {
|
||||
Message.error({
|
||||
context: this,
|
||||
offset: [90, 32],
|
||||
duration: 3000,
|
||||
content: '入会名称最多10个字!',
|
||||
});
|
||||
this.setData({
|
||||
isJoin: false
|
||||
})
|
||||
return
|
||||
}
|
||||
GetCheckoutRoomNum(this.data.meetingForm.roomNum).then(async res => {
|
||||
if (res.code === 200) {
|
||||
if (res.data) {
|
||||
|
|
|
|||
|
|
@ -344,14 +344,18 @@
|
|||
flex-grow: 1;
|
||||
|
||||
&-text {
|
||||
flex-grow: 1;
|
||||
color: white;
|
||||
font-size: 14rpx;
|
||||
margin: 0 2rpx;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
overflow: hidden;
|
||||
width: 0;
|
||||
max-width: 100rpx;
|
||||
}
|
||||
|
||||
&-me {
|
||||
color: white;
|
||||
font-size: 14rpx;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ import { GetRoomRtcToken } from '../../api/form/index'
|
|||
import { agora } from '../../utils/agora'
|
||||
import { onInvoke, onSignalr, getSignIr, offSignalr, onStop } from '../../utils/singlr'
|
||||
import { role, getStorage } from '../../utils/utils'
|
||||
import { Message } from 'tdesign-miniprogram';
|
||||
import { Message, Toast } from 'tdesign-miniprogram';
|
||||
import * as signalR from "signalr-for-wx";
|
||||
import dayjs from 'dayjs';
|
||||
const computedBehavior = require('miniprogram-computed').behavior;
|
||||
|
|
@ -88,11 +88,13 @@ Page({
|
|||
leaveDialog: false,
|
||||
userPopupVisible: false,
|
||||
chatPopupVisible: false,
|
||||
inputPopupVisible: false,
|
||||
isFullscreen: false,
|
||||
muted: false,
|
||||
currentRequestSpeakType: '',
|
||||
user: '',
|
||||
messageStr: '',
|
||||
inputStr: '',
|
||||
commonlyChatList: [
|
||||
'能听到我说话吗?',
|
||||
'听得到',
|
||||
|
|
@ -366,6 +368,20 @@ Page({
|
|||
isAutoApplySpeakTime = ''
|
||||
}
|
||||
},
|
||||
showInputPopup() {
|
||||
this.setData({
|
||||
inputPopupVisible: true,
|
||||
inputStr: this.data.messageStr,
|
||||
chatPopupVisible: false
|
||||
})
|
||||
},
|
||||
hideInputPopup() {
|
||||
this.setData({
|
||||
inputPopupVisible: false,
|
||||
messageStr: this.data.inputStr,
|
||||
chatPopupVisible: true
|
||||
})
|
||||
},
|
||||
confirmIsAutoApplySpeakDialog() {
|
||||
if (!this.data.isClicked) {
|
||||
GetApplySpeak(this.data.channelId).then(res => {
|
||||
|
|
@ -605,6 +621,10 @@ Page({
|
|||
// 显示设备列表
|
||||
case 'ShowDriverList':
|
||||
|
||||
break;
|
||||
// 修改用户名称
|
||||
case 'ModifyNickName':
|
||||
this.setAllUserListData('ModifyNickName', item)
|
||||
break;
|
||||
case 'SetSpeaker':
|
||||
await onInvoke('SetSpeakerCallback', item.RoomManagerInputDTO)
|
||||
|
|
@ -677,9 +697,6 @@ Page({
|
|||
item.isRoom = true;
|
||||
item.isAdmin = role.ID.includes(item.roleId) || item.isRoomManager
|
||||
item.avatarName = item.userName?.slice(-2)
|
||||
if (item.uid === this.data.user.uid) {
|
||||
item.userName = item.userName + '(我)'
|
||||
}
|
||||
})
|
||||
this.setData({
|
||||
roomUserList: res.data
|
||||
|
|
@ -687,6 +704,13 @@ Page({
|
|||
}
|
||||
})
|
||||
},
|
||||
showMultiText(e) {
|
||||
Toast({
|
||||
context: this,
|
||||
selector: '#t-toast',
|
||||
message: e.currentTarget.dataset.item.userName,
|
||||
});
|
||||
},
|
||||
async getShowUser(): Promise<void> {
|
||||
await GetShowUser(this.data.channelId).then(async (res) => {
|
||||
if (res.code === 200 && res.data) {
|
||||
|
|
@ -785,6 +809,15 @@ Page({
|
|||
roomUserList
|
||||
})
|
||||
break;
|
||||
case 'ModifyNickName':
|
||||
let row = roomUserList.find((row: any) => row.uid == item.uid)
|
||||
if (row) {
|
||||
row.userName = item.nickName
|
||||
}
|
||||
this.setData({
|
||||
roomUserList
|
||||
})
|
||||
break;
|
||||
}
|
||||
this.changeAgoraDevice()
|
||||
},
|
||||
|
|
@ -1064,6 +1097,11 @@ Page({
|
|||
messageStr: e.detail.value
|
||||
})
|
||||
},
|
||||
changeInputStr(e) {
|
||||
this.setData({
|
||||
inputStr: e.detail.value
|
||||
})
|
||||
},
|
||||
async sendMeg(e) {
|
||||
if (this.data.messageStr || e.target.dataset.item) {
|
||||
await onInvoke('sendChannelMsg', {
|
||||
|
|
|
|||
|
|
@ -98,9 +98,10 @@
|
|||
</view>
|
||||
<scroll-view scroll-y class="user-popup-view" enhanced>
|
||||
<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">
|
||||
<view class="user-popup-view-view-avatar" bind:tap="showMultiText" data-item="{{item}}">
|
||||
<t-avatar size="36rpx">{{item.avatarName}}</t-avatar>
|
||||
<text class="user-popup-view-view-avatar-text">{{item.userName}}</text>
|
||||
<text class="user-popup-view-view-avatar-me" wx:if="{{user.uid=== item.uid}}">(我)</text>
|
||||
</view>
|
||||
<view class="user-popup-view-view-image">
|
||||
<image src="/assets/{{item.enableMicr ? 'icon2' : 'icon2-active'}}.png" class="user-popup-view-view-image-icon" />
|
||||
|
|
@ -130,10 +131,19 @@
|
|||
</view>
|
||||
</view>
|
||||
<view class="chat-popup-input">
|
||||
<input type="text" placeholder="请输入文字" class="chat-popup-input-text" value="{{messageStr}}" bind:input="changeMessageStr" />
|
||||
<input type="text" placeholder="请输入文字" class="chat-popup-input-text" value="{{messageStr}}" bind:input="changeMessageStr" disabled bind:tap="showInputPopup" />
|
||||
<view class="chat-popup-input-submit" bind:tap="sendMeg">发送</view>
|
||||
</view>
|
||||
</view>
|
||||
</t-popup>
|
||||
<t-popup visible="{{inputPopupVisible}}" bind:visible-change="hideInputPopup" placement="top" close-on-overlay-click='{{false}}'>
|
||||
<view style="padding: 10rpx;display: flex;align-items: center;">
|
||||
<view class="chat-popup-input-submit" bind:tap="hideInputPopup">确认</view>
|
||||
<text style="color: gray;font-size: 16rpx;margin: 0 0 0 6rpx">{{inputStr.length}}/30</text>
|
||||
<view style="height: 30rpx;width: 1px;background-color: gray;margin: 0 6rpx"></view>
|
||||
<input type="text" placeholder="请输入文字" value="{{inputStr}}" maxlength='{{30}}' bind:input="changeInputStr" style="flex-grow: 1;" />
|
||||
</view>
|
||||
</t-popup>
|
||||
<t-dialog visible="{{isReconnec}}" content="重连失败,请退出重试!" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" data-type="isReconnec" cancel-btn="{{null}}" bind:confirm="closeRoom" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
||||
<t-dialog visible="{{isAutoApplySpeakDialog}}" content="由于您长时间未发言,已自动取消发言权限,是否重新申请发言?" cancel-btn="取消" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" data-type="isAutoApplySpeakDialog" bind:cancel="cancelIsAutoApplySpeakDialog" bind:confirm="confirmIsAutoApplySpeakDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
||||
<t-dialog visible="{{isAutoApplySpeakDialog}}" content="由于您长时间未发言,已自动取消发言权限,是否重新申请发言?" cancel-btn="取消" confirm-btn="{{ { content: '确定', variant: 'base', theme: 'primary' } }}" data-type="isAutoApplySpeakDialog" bind:cancel="cancelIsAutoApplySpeakDialog" bind:confirm="confirmIsAutoApplySpeakDialog" style="transform: scale(0.5) translate3d(-50%, -50%, 0);" close-btn="{{false}}" />
|
||||
<t-toast id="t-toast" style="transform: scale(0.5) translate3d(-50%, -50%, 0);transform-origin: 0% 0%;"/>
|
||||
|
|
@ -201,6 +201,14 @@ export const onSignalr = (callBack: Function) => {
|
|||
driversJsonString
|
||||
})
|
||||
});
|
||||
// 修改用户名称
|
||||
connection.on("ModifyNickName", (uid, nickName) => {
|
||||
callBack({
|
||||
key: 'ModifyNickName',
|
||||
uid,
|
||||
nickName
|
||||
})
|
||||
});
|
||||
// 设置发言人
|
||||
connection.on("SetSpeaker", (RoomManagerInputDTO) => {
|
||||
callBack({
|
||||
|
|
@ -271,6 +279,7 @@ export const offSignalr = () => {
|
|||
connection.off('DriverList');
|
||||
connection.off('SetDriver');
|
||||
connection.off('ShowDriverList');
|
||||
connection.off('ModifyNickName');
|
||||
connection.off('SetSpeaker');
|
||||
connection.off('ReceivedOperation');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue