提示优化

This commit is contained in:
yj 2024-11-26 16:06:57 +08:00
parent 57a899b809
commit 717e0f72b6
2 changed files with 42 additions and 2 deletions

View File

@ -12,6 +12,7 @@ Page({
isCamera: false, isCamera: false,
netWorkErrorDialog: false, netWorkErrorDialog: false,
historicalList: [], historicalList: [],
isJoin: false
}, },
onShow() { onShow() {
const that = this; const that = this;
@ -91,6 +92,9 @@ Page({
}, },
joinMeeting() { joinMeeting() {
this.closeDialog() this.closeDialog()
this.setData({
isJoin: true
})
const navigateToMeeting = async (deviceId: string): Promise<void> => { const navigateToMeeting = async (deviceId: string): Promise<void> => {
await PostAnonLogin({ await PostAnonLogin({
deviceId, deviceId,
@ -118,6 +122,13 @@ Page({
}) })
}) })
} }
this.setData({
isJoin: false
})
}).catch(() => {
this.setData({
isJoin: false
})
}) })
} }
if (!this.data.meetingForm.roomNum) { if (!this.data.meetingForm.roomNum) {
@ -127,6 +138,9 @@ Page({
duration: 3000, duration: 3000,
content: '请输入会议号!', content: '请输入会议号!',
}); });
this.setData({
isJoin: false
})
return return
} }
if (!this.data.meetingForm.roomName) { if (!this.data.meetingForm.roomName) {
@ -136,8 +150,12 @@ Page({
duration: 3000, duration: 3000,
content: '请输入入会名称!', content: '请输入入会名称!',
}); });
this.setData({
isJoin: false
})
return return
} }
const that = this;
GetCheckoutRoomNum(this.data.meetingForm.roomNum).then(res => { GetCheckoutRoomNum(this.data.meetingForm.roomNum).then(res => {
if (res.code === 200) { if (res.code === 200) {
if (res.data) { if (res.data) {
@ -145,11 +163,29 @@ Page({
success: (res) => { success: (res) => {
const { code } = res const { code } = res
GetOpenId(code).then(res => { GetOpenId(code).then(res => {
navigateToMeeting(res.data) if (res.code === 200) {
navigateToMeeting(res.data)
} else {
that.setData({
isJoin: false
})
}
}).catch(() => {
that.setData({
isJoin: false
})
})
},
fail: () => {
that.setData({
isJoin: false
}) })
} }
}) })
} else { } else {
this.setData({
isJoin: false
})
Message.error({ Message.error({
context: this, context: this,
offset: [90, 32], offset: [90, 32],
@ -158,6 +194,10 @@ Page({
}); });
} }
} }
}).catch(() => {
this.setData({
isJoin: false
})
}) })
}, },
setting() { setting() {

View File

@ -5,7 +5,7 @@
<t-input label="会议号" placeholder="请输入会议号" maxlength="{{8}}" value="{{meetingForm.roomNum}}" bind:clear="changeMeetingForm" bind:change="changeMeetingForm" clearable data-type='roomNum' /> <t-input label="会议号" placeholder="请输入会议号" maxlength="{{8}}" value="{{meetingForm.roomNum}}" bind:clear="changeMeetingForm" bind:change="changeMeetingForm" clearable data-type='roomNum' />
<t-input label="入会名称" placeholder="请输入入会名称" value="{{meetingForm.roomName}}" bind:clear="changeMeetingForm" bind:change="changeMeetingForm" clearable data-type='roomName' /> <t-input label="入会名称" placeholder="请输入入会名称" value="{{meetingForm.roomName}}" bind:clear="changeMeetingForm" bind:change="changeMeetingForm" clearable data-type='roomName' />
<view style="display: flex;justify-content: center;"> <view style="display: flex;justify-content: center;">
<t-button theme="primary" style="width: 90%;margin: 20rpx 0 30rpx;" bind:tap="joinMeeting" wx:if="{{isCamera && isRecord}}">加入会议</t-button> <t-button theme="primary" style="width: 90%;margin: 20rpx 0 30rpx;" bind:tap="joinMeeting" wx:if="{{isCamera && isRecord}}">{{isJoin ? '正在加入...' : '加入会议'}}</t-button>
<t-button theme="primary" style="width: 90%;margin: 20rpx 0 30rpx;" bind:tap="setting" wx:else> <t-button theme="primary" style="width: 90%;margin: 20rpx 0 30rpx;" bind:tap="setting" wx:else>
点击开启摄像头麦克风 点击开启摄像头麦克风
</t-button> </t-button>