diff --git a/pages/form/index.ts b/pages/form/index.ts index 9f2626e..2a55dda 100644 --- a/pages/form/index.ts +++ b/pages/form/index.ts @@ -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 => { 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() { diff --git a/pages/form/index.wxml b/pages/form/index.wxml index 9f93e31..7446654 100644 --- a/pages/form/index.wxml +++ b/pages/form/index.wxml @@ -5,7 +5,7 @@ - 加入会议 + {{isJoin ? '正在加入...' : '加入会议'}} 点击开启摄像头麦克风