智慧保安互联网APP
liuyg
2021-08-12 dd10ee2243fcfc1a0f6ae340c4c1732e5c5d1cf2
components/submit/submit.vue
@@ -259,6 +259,9 @@
         //开始音频
         openAudio(val) { //Mains
            // console.log(this.names)
            // var socketOpen = false;
            uni.navigateTo({
               url: '../videoCall/videoCall?state=' + val + '&type=audio'
            });
@@ -271,17 +274,37 @@
         },
         //开始视频
         openVideo(val) { //Mains
            // uni.onSocketOpen(function(res) {
            //    // socketOpen = true;
            //    console.log('持续连接成功')
            //    sendSocketMessage();
            // });
            // function sendSocketMessage() {
            //    var data = {
            //       name: this.$store.state.puserName,
            //       id: this.names[1],
            //       // id: state.puserID,
            //       type: 'video'
            //    }
            //    // if (socketOpen) {
            //    uni.sendSocketMessage({
            //       data: JSON.stringify(data)
            //    });
            //    // }
            // }
            uni.navigateTo({
               url: '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] +
                  '&toname=' + this.names[1]
            });
         },
         //接收视频
         receiveVideo(val, room) { //Receiver
            uni.navigateTo({
               url: '../videoCall/videoCall?state=' + val + '&type=video' + '&room=' + room
            });
         }
         // receiveVideo(val, room) { //Receiver
         //    uni.navigateTo({
         //       url: '../videoCall/videoCall?state=' + val + '&type=video' + '&room=' + room
         //    });
         // }
      },
      mounted() {
         // uni.onSocketMessage(function(res) {