| | |
| | | this.init(); |
| | | }, |
| | | onLoad(option) { |
| | | this.toName = option.toname; |
| | | var that = this; |
| | | that.toName = option.toname; |
| | | console.log(option) |
| | | if (option.type) { |
| | | this.Otype = option.type; |
| | | that.Otype = option.type; |
| | | } else { |
| | | return |
| | | } |
| | | console.log(option.state); |
| | | if (option.state == "Mains") { |
| | | this.isMain = true; |
| | | that.isMain = true; |
| | | var call = false; |
| | | // this.userName = 'faqiren'; |
| | | // setTimeout(res => { |
| | |
| | | //得到返回值 开始视频 或者拒绝视频 |
| | | // this.join(); |
| | | uni.request({ |
| | | url: this.$store.state.api + '/pushMsg/inviteVideoCall', |
| | | url: that.$store.state.api + '/pushMsg/inviteVideoCall', |
| | | data: { |
| | | userId: option.toname, |
| | | name: this.$store.state.puserName, |
| | | name: that.$store.state.puserName, |
| | | type: 'video' |
| | | }, |
| | | success(res) { |
| | |
| | | }, 2000) |
| | | |
| | | } else if (d.res == 1) { |
| | | this.channel = d.roomId; |
| | | that.channel = d.roomId; |
| | | console.log('对方在线-- 等待对方接受'); |
| | | // call = true; |
| | | this.join(); |
| | | that.join(); |
| | | } |
| | | } |
| | | }) |
| | |
| | | // } |
| | | if (data.type = 'close') { |
| | | console.log('对方已挂断'); |
| | | this.closeAll(); |
| | | that.closeAll(); |
| | | } |
| | | }); |
| | | |
| | | |
| | | // }, 5000) |
| | | } else if (option.state == "Receiver") { |
| | | this.userName = option.name; |
| | | // this.formName = 'wo'; |
| | | this.channel = option.room; |
| | | this.isMain = false; |
| | | that.userName = option.name; |
| | | // that.formName = 'wo'; |
| | | that.channel = option.room; |
| | | that.isMain = false; |
| | | } |
| | | }, |
| | | |