From 2cad29f6f1d2de0967fe046068e209d3d0e05f65 Mon Sep 17 00:00:00 2001
From: liuyg <376836862@qq.com>
Date: Thu, 12 Aug 2021 11:47:23 +0800
Subject: [PATCH] +
---
pages/home/home.vue | 3 ++-
components/submit/submit.vue | 7 ++++---
pages/videoCall/videoCall.nvue | 25 +++++++++++++------------
3 files changed, 19 insertions(+), 16 deletions(-)
diff --git a/components/submit/submit.vue b/components/submit/submit.vue
index de25bbb..0c2348f 100644
--- a/components/submit/submit.vue
+++ b/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
});
},
//接收视频
diff --git a/pages/home/home.vue b/pages/home/home.vue
index 2448c9e..a8cd6c5 100644
--- a/pages/home/home.vue
+++ b/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) {
diff --git a/pages/videoCall/videoCall.nvue b/pages/videoCall/videoCall.nvue
index 24e176e..b5a11f4 100644
--- a/pages/videoCall/videoCall.nvue
+++ b/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;
}
},
--
Gitblit v1.9.3