| | |
| | | }; |
| | | }, |
| | | created() { |
| | | this.getUser(); |
| | | this.getRoomId(); |
| | | this.getUser(); |
| | | }, |
| | | |
| | | computed: { |
| | | isStartExercise() { |
| | | let roomId = this.roomId |
| | | let userId = this.userId; |
| | | return { roomId, userId }; |
| | | } |
| | | }, |
| | | |
| | | watch: { |
| | | |
| | | isStartExercise: { |
| | | immediate: true, |
| | | handler(n) { |
| | | if (n.roomId && n.userId) { |
| | | // 判断这两个值同时存在 |
| | | // alert(this.userId) |
| | | // alert(this.roomId) |
| | | this.loading = false; |
| | | this.showComponent = true; |
| | | } |
| | | }, |
| | | } |
| | | |
| | | }, |
| | | methods: { |
| | | // 获取房间号 |
| | |
| | | this.user = response.data; |
| | | this.userId = this.user.nickName |
| | | // alert(this.userId) |
| | | // alert(this.roomId) |
| | | }); |
| | | setTimeout(() => { |
| | | this.loading = false; |
| | | this.showComponent = true; |
| | | }, 3000); |
| | | // setTimeout(() => { |
| | | // this.loading = false; |
| | | // this.showComponent = true; |
| | | // }, 5000); |
| | | // if(this.userId !== '' && this.roomId !== ''){ |
| | | // alert(123) |
| | | // this.loading = false; |
| | | // this.showComponent = true; |
| | | // } |
| | | |
| | | }, |
| | | handleValueChange(value, key) { |