修改
This commit is contained in:
parent
ac636bf3f0
commit
70f86244ae
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"prompt": "template"
|
"prompt" : "template"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,8 @@
|
|||||||
"name" : "xinelu-doctor-app",
|
"name" : "xinelu-doctor-app",
|
||||||
"appid" : "__UNI__9BA7A08",
|
"appid" : "__UNI__9BA7A08",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "1.0.3",
|
"versionName" : "1.0.4",
|
||||||
"versionCode" : 103,
|
"versionCode" : 104,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
/* 5+App特有相关 */
|
/* 5+App特有相关 */
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
@ -85,9 +85,17 @@
|
|||||||
"mp-weixin" : {
|
"mp-weixin" : {
|
||||||
"appid" : "",
|
"appid" : "",
|
||||||
"setting" : {
|
"setting" : {
|
||||||
"urlCheck" : false
|
"urlCheck" : false,
|
||||||
|
"es6" : true,
|
||||||
|
"minified" : true,
|
||||||
|
"postcss" : true
|
||||||
},
|
},
|
||||||
"usingComponents" : true
|
"usingComponents" : true,
|
||||||
|
"permission" : {
|
||||||
|
"scope.userLocation" : {
|
||||||
|
"desc" : "获取当前所在位置"
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"mp-alipay" : {
|
"mp-alipay" : {
|
||||||
"usingComponents" : true
|
"usingComponents" : true
|
||||||
|
|||||||
@ -42,7 +42,7 @@
|
|||||||
methods: {
|
methods: {
|
||||||
govideo() {
|
govideo() {
|
||||||
uni.navigateTo({
|
uni.navigateTo({
|
||||||
url: `./video?roomId=${this.roomId}&userId=${this.userId}&userName=${this.userName}&userSig=${this.userSig}`
|
url: `./video?roomId=${this.roomId}&userId=${this.userId}&userName=${this.userName}&userSig=${this.userSig}&remoteUserId=${this.item.patientId}`
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
getUserSig() {
|
getUserSig() {
|
||||||
|
|||||||
@ -1,20 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="trtc-container">
|
<div class="trtc-container">
|
||||||
<view class="trtc-video-area">
|
<view class="trtc-video-area">
|
||||||
<view class="trtc-video-view" id='root'>
|
<view class="trtc-video-view1" id='root'>
|
||||||
<trtc-local-view :viewId="userId" style="height:400rpx;flex: 1"></trtc-local-view>
|
<trtc-local-view :viewId="userId"></trtc-local-view>
|
||||||
</view>
|
</view>
|
||||||
<view class="trtc-video-view">
|
<view class="trtc-video-view2">
|
||||||
<trtc-remote-view v-if="remoteUserId" :userId="remoteUserId" :viewId="remoteUserId"
|
<trtc-remote-view v-if="remoteUserId" :userId="remoteUserId" :viewId="remoteUserId">
|
||||||
style="height:400rpx;flex: 1">
|
|
||||||
</trtc-remote-view>
|
</trtc-remote-view>
|
||||||
</view>
|
</view>
|
||||||
<image class="imgbtn" @click="leave" src="@/static/leave.png"></image>
|
|
||||||
</view>
|
</view>
|
||||||
|
<image class="imgbtn" @click="leave" src="@/static/leave.png"></image>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import permision from "@/TrtcCloud/permission.js";
|
import permision from "@/TrtcCloud/permission.js";
|
||||||
|
import TrtcCloud from '@/TrtcCloud/lib/index';
|
||||||
import {
|
import {
|
||||||
TRTCAppScene,
|
TRTCAppScene,
|
||||||
TRTCVideoStreamType,
|
TRTCVideoStreamType,
|
||||||
@ -24,7 +24,7 @@
|
|||||||
} from '@/TrtcCloud/lib/TrtcDefines';
|
} from '@/TrtcCloud/lib/TrtcDefines';
|
||||||
import TrtcLocalView from '@/TrtcCloud/view/TrtcLocalView';
|
import TrtcLocalView from '@/TrtcCloud/view/TrtcLocalView';
|
||||||
import TrtcRemoteView from '@/TrtcCloud/view/TrtcRemoteView';
|
import TrtcRemoteView from '@/TrtcCloud/view/TrtcRemoteView';
|
||||||
import TrtcCloud from '@/TrtcCloud/lib/index';
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
TrtcLocalView: TrtcLocalView,
|
TrtcLocalView: TrtcLocalView,
|
||||||
@ -42,10 +42,10 @@
|
|||||||
onLoad(options) {
|
onLoad(options) {
|
||||||
this.roomId = options.roomId
|
this.roomId = options.roomId
|
||||||
this.userId = options.userId
|
this.userId = options.userId
|
||||||
this.remoteUserId = options.userId
|
|
||||||
this.userName = options.userName
|
this.userName = options.userName
|
||||||
this.userSig = options.userSig
|
this.userSig = options.userSig
|
||||||
console.log(this.userSig, this.userId, this.roomId)
|
this.remoteUserId = options.remoteUserId
|
||||||
|
console.log(this.userSig, this.userId, this.roomId, this.remoteUserId)
|
||||||
},
|
},
|
||||||
onShow() {},
|
onShow() {},
|
||||||
onBackPress() {
|
onBackPress() {
|
||||||
@ -62,6 +62,12 @@
|
|||||||
join() {
|
join() {
|
||||||
// 创建 TRTC 的对象实例
|
// 创建 TRTC 的对象实例
|
||||||
this.trtcCloud = TrtcCloud.createInstance();
|
this.trtcCloud = TrtcCloud.createInstance();
|
||||||
|
this.trtcCloud.on('onWarning', (res) => {
|
||||||
|
console.log('- onWarning: ', JSON.stringify(res));
|
||||||
|
});
|
||||||
|
this.trtcCloud.on('onError', (res) => {
|
||||||
|
console.log('- onError: ', JSON.stringify(res));
|
||||||
|
});
|
||||||
// 组装 TRTC 进房参数,请将 TRTCParams 中的各字段都替换成您自己的参数
|
// 组装 TRTC 进房参数,请将 TRTCParams 中的各字段都替换成您自己的参数
|
||||||
// Please replace each field in TRTCParams with your own parameters
|
// Please replace each field in TRTCParams with your own parameters
|
||||||
const params = {
|
const params = {
|
||||||
@ -73,57 +79,25 @@
|
|||||||
};
|
};
|
||||||
// 如果您的场景是“在线直播”,请将应用场景设置为 TRTC_APP_SCENE_LIVE
|
// 如果您的场景是“在线直播”,请将应用场景设置为 TRTC_APP_SCENE_LIVE
|
||||||
// If your application scenario is a video call between several people, please use "TRTC_APP_SCENE_LIVE"
|
// If your application scenario is a video call between several people, please use "TRTC_APP_SCENE_LIVE"
|
||||||
this.trtcCloud.on('onWarning', (res) => {
|
|
||||||
console.log('- onWarning: ', JSON.stringify(res));
|
|
||||||
uni.showToast({
|
|
||||||
title: `onWarning: ${JSON.stringify(res)}`,
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.trtcCloud.on('onError', (res) => {
|
|
||||||
console.log('- onError: ', JSON.stringify(res));
|
|
||||||
uni.showToast({
|
|
||||||
title: `error: ${JSON.stringify(res)}`,
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
});
|
|
||||||
// 打开摄像头预览
|
|
||||||
//打开麦克风采集
|
|
||||||
this.trtcCloud.enterRoom(params, TRTCAppScene.TRTCAppSceneVideoCall);
|
this.trtcCloud.enterRoom(params, TRTCAppScene.TRTCAppSceneVideoCall);
|
||||||
this.trtcCloud.startLocalAudio(TRTCAudioQuality.TRTCAudioQualityDefault);
|
|
||||||
this.trtcCloud.startLocalPreview(true, this.userId);
|
|
||||||
// 进入房间
|
// 进入房间
|
||||||
this.trtcCloud.on('onEnterRoom', (result) => {
|
this.trtcCloud.on("onEnterRoom", (result) => {
|
||||||
console.log(`- onEnterRoom = ${result}`);
|
|
||||||
if (result > 0) {
|
if (result > 0) {
|
||||||
uni.showToast({
|
console.log('进房成功');
|
||||||
title: `进房成功,耗时: ${result}ms`,
|
|
||||||
icon: 'none',
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
console.log(`enter room failed,error code = ${result}`);
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// 打开摄像头预览
|
||||||
|
this.trtcCloud.startLocalPreview(true, this.userId);
|
||||||
|
//打开麦克风采集
|
||||||
|
this.trtcCloud.startLocalAudio(TRTCAudioQuality.TRTCAudioQualityDefault);
|
||||||
// 播放远端视频流
|
// 播放远端视频流
|
||||||
this.trtcCloud.startRemoteView(this.remoteUserId, TRTCVideoStreamType.TRTCVideoStreamTypeBig, this
|
this.trtcCloud.startRemoteView(this.remoteUserId, TRTCVideoStreamType.TRTCVideoStreamTypeBig, this
|
||||||
.remoteUserId);
|
.remoteUserId);
|
||||||
this.trtcCloud.on('onExitRoom', (reason) => {
|
this.trtcCloud.on('onRemoteUserEnterRoom', (userId) => {
|
||||||
const reasonList = ['主动调用 exitRoom 退房', '被服务器踢出当前房间', '当前房间整个被解散'];
|
console.log('remote user enter room id ', userId);
|
||||||
uni.showToast({
|
|
||||||
title: `退房 ${reasonList[reason]}`,
|
|
||||||
icon: 'none',
|
|
||||||
duration: 1000
|
|
||||||
});
|
|
||||||
});
|
|
||||||
this.trtcCloud.on('onFirstVideoFrame', (res) => {
|
|
||||||
console.log(`渲染的首帧画面响应 = ${JSON.stringify(res)}`);
|
|
||||||
});
|
});
|
||||||
// 视频状态变化通知
|
// 视频状态变化通知
|
||||||
this.trtcCloud.on("onRemoteUserEnterRoom", (userId) => {
|
|
||||||
console.log(`远端进房: userId = ${userId}`);
|
|
||||||
});
|
|
||||||
this.trtcCloud.on('onUserVideoAvailable', (res) => {
|
this.trtcCloud.on('onUserVideoAvailable', (res) => {
|
||||||
console.log(res)
|
|
||||||
const {
|
const {
|
||||||
userId,
|
userId,
|
||||||
available
|
available
|
||||||
@ -177,156 +151,29 @@
|
|||||||
height: 43rpx;
|
height: 43rpx;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
bottom: 20rpx;
|
bottom: 20rpx;
|
||||||
left: 290rpx
|
left: 290rpx;
|
||||||
|
z-index: 99999;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trtc-container {
|
.trtc-container {
|
||||||
background-color: #F4F4F4;
|
width: 100%;
|
||||||
|
height: 100vh;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trtc-log-view {
|
.trtc-video-view1 {
|
||||||
position: fixed;
|
|
||||||
background-color: #000000;
|
|
||||||
height: 76.92rpx;
|
|
||||||
left: 0;
|
|
||||||
right: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-log-fold-btn {
|
|
||||||
position: fixed;
|
|
||||||
right: 0;
|
|
||||||
width: 100rpx;
|
|
||||||
height: 50rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-log-text {
|
|
||||||
width: 750rpx;
|
|
||||||
font-size: 23.07rpx;
|
|
||||||
line-height: 40rpx;
|
|
||||||
color: #FFFFFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-row-area {
|
|
||||||
flex-direction: row;
|
|
||||||
margin-left: 36.53rpx;
|
|
||||||
margin-right: 36.53rpx;
|
|
||||||
margin-top: 17.3rpx;
|
|
||||||
margin-bottom: 17.3rpx;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: space-between;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-input {
|
|
||||||
background-color: #FFFFFF;
|
|
||||||
border-radius: 9.61rpx;
|
|
||||||
border-color: #BBBBBB;
|
|
||||||
border-width: 1.92rpx;
|
|
||||||
border-style: solid;
|
|
||||||
color: #101010;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
height: 46.15rpx;
|
|
||||||
padding-left: 9.61rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-video-area {
|
|
||||||
flex-direction: row;
|
|
||||||
flex: 1;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-local-view {}
|
|
||||||
|
|
||||||
.trtc-video-view {
|
|
||||||
border-width: 1.92rpx;
|
border-width: 1.92rpx;
|
||||||
border-color: #BBBBBB;
|
border-color: #BBBBBB;
|
||||||
/* background-color: #FFFFFF; */
|
height: 500rpx;
|
||||||
height: 403.84rpx;
|
width: 300rpx;
|
||||||
flex: 1;
|
position: fixed;
|
||||||
|
top: 20rpx;
|
||||||
|
right: 20rpx;
|
||||||
}
|
}
|
||||||
|
|
||||||
.trtc-video-remote-view {
|
.trtc-video-view2 {
|
||||||
border-width: 1.92rpx;
|
border-width: 1.92rpx;
|
||||||
border-color: #BBBBBB;
|
border-color: #BBBBBB;
|
||||||
/* background-color: #FFFFFF; */
|
height: 70%;
|
||||||
height: 403.84rpx;
|
width: 100%;
|
||||||
width: 375rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-video-btn {
|
|
||||||
position: fixed;
|
|
||||||
background-color: #52C2FF;
|
|
||||||
color: #FFF;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
bottom: 11.53rpx;
|
|
||||||
height: 57.69rpx;
|
|
||||||
left: 17.3rpx;
|
|
||||||
right: 17.3rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-video-text {
|
|
||||||
position: fixed;
|
|
||||||
margin-top: 90.38rpx;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-line {
|
|
||||||
background-color: #BBBBBB;
|
|
||||||
height: 1.92rpx;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-title-container {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
justify-content: space-around;
|
|
||||||
margin-top: 10rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-title-text {
|
|
||||||
color: #101010;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-btn-long {
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
background-color: #2985FF;
|
|
||||||
border-color: #A3D0FD;
|
|
||||||
border-width: 1.92rpx;
|
|
||||||
margin-left: 42.3rpx;
|
|
||||||
margin-right: 42.3rpx;
|
|
||||||
margin-top: 20rpx;
|
|
||||||
color: #FFF;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-btn-mid {
|
|
||||||
background-color: #2985FF;
|
|
||||||
border-color: #A3D0FD;
|
|
||||||
color: #FFF;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
width: 292.3rpx;
|
|
||||||
height: 55.76rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-btn-short {
|
|
||||||
background-color: #52C2FF;
|
|
||||||
border-color: #A3D0FD;
|
|
||||||
color: #FFF;
|
|
||||||
font-size: 19.23rpx;
|
|
||||||
width: 75rpx;
|
|
||||||
height: 38.46rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.trtc-conent-text {
|
|
||||||
color: #AEAEAE;
|
|
||||||
font-size: 19.23rpx;
|
|
||||||
}
|
|
||||||
|
|
||||||
.picker-view {
|
|
||||||
padding: 15rpx 25rpx;
|
|
||||||
line-height: 50rpx;
|
|
||||||
font-size: 26.92rpx;
|
|
||||||
background: #FFF;
|
|
||||||
flex: 1;
|
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
@ -37,7 +37,6 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
title: 'Hello',
|
|
||||||
personAccount: 'wangxiaoyan',
|
personAccount: 'wangxiaoyan',
|
||||||
personPassword: 'Ww851108.',
|
personPassword: 'Ww851108.',
|
||||||
form: {
|
form: {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user