提示优化

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