智慧保安互联网APP
+
liuyg
2021-08-12 2cad29f6f1d2de0967fe046068e209d3d0e05f65
+
3 files modified
35 ■■■■ changed files
components/submit/submit.vue 7 ●●●●● patch | view | raw | blame | history
pages/home/home.vue 3 ●●●● patch | view | raw | blame | history
pages/videoCall/videoCall.nvue 25 ●●●● patch | view | raw | blame | history
components/submit/submit.vue
@@ -293,10 +293,11 @@
                //     });
                //     // }
                // }
                uni.navigateTo({
                    url: '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] +
                var url = '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] +
                        '&toname=' + this.names[1]
            console.log(url)
                uni.navigateTo({
                    url: url
                });
            },
            //接收视频
pages/home/home.vue
@@ -213,7 +213,8 @@
        methods: {
            openVideo(val){
                uni.navigateTo({
                    url: '../videoCall/videoCall?state=' + val + '&type=video'
                    // url: '../videoCall/videoCall?state=' + val + '&type=video'
                    url: '../videoCall/videoCall?state=Mains&type=video&myname=wo&toname=1424647828935819265'
                });
            },
            changePicker(e) {
pages/videoCall/videoCall.nvue
@@ -217,16 +217,17 @@
            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 => {
@@ -235,10 +236,10 @@
                //得到返回值   开始视频  或者拒绝视频
                // 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) {
@@ -259,10 +260,10 @@
                            }, 2000)
                        
                        } else if (d.res == 1) {
                            this.channel = d.roomId;
                            that.channel = d.roomId;
                            console.log('对方在线-- 等待对方接受');
                            // call = true;
                            this.join();
                            that.join();
                        }
                    }
                })
@@ -276,17 +277,17 @@
                    // }
                    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;
            }
        },