智慧保安互联网APP
shuishen
2021-08-13 18bc56d4176b90ab5a1afceddcfa3ce55da5e070
components/submit/submit.vue
@@ -76,7 +76,7 @@
   const recorderManager = uni.getRecorderManager()
   export default {
      props: ['names'],
      props: ['names','callname'],
      data() {
         return {
            isrecord: false,
@@ -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,38 @@
         },
         //开始视频
         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)
            //    });
            //    // }
            // }
            var url = '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] +
                  '&toname=' + this.names[1] + '&callname=' + this.callname
         console.log(url)
            uni.navigateTo({
               url: '../videoCall/videoCall?state=' + val + '&type=video' + '&myname=' + this.names[0] +
                  '&toname=' + this.names[1]
               url: url
            });
         },
         //接收视频
         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) {