|
|
|
@ -2,29 +2,31 @@ |
|
|
|
|
<view class="room" :style="{'width': winWidth+'px', 'height': winHeight+'px'}"> |
|
|
|
|
<view class="room-navbar" :style="{'width': winWidth+'px', 'height': (statusBarHeight+44)+'px'}"> |
|
|
|
|
<view class="navbar" :style="{'width': winWidth+'px', 'margin-top': (statusBarHeight)+'px'}"> |
|
|
|
|
<view class="back" @click="onBack()"> |
|
|
|
|
<view class="back" @click="onBack()" :style="{'top': (statusBarHeight)+'px'}"> |
|
|
|
|
<image class="img" src="@/static/arrow-left.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="title" :style="{'width': winWidth+'px'}"><text class="txt">{{title}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view v-if="type == 2 || type == 4"> |
|
|
|
|
<view class="room-hd" v-if="isToggle"> |
|
|
|
|
<zego-local-view class="video-view" :style="{'width': winWidth+'px', 'height': winHeight+'px'}"></zego-local-view> |
|
|
|
|
<zego-remote-view class="shitu" :streamID="sellerStreamId" :style="{'top': (statusBarHeight+60)+'px'}"></zego-remote-view> |
|
|
|
|
</view> |
|
|
|
|
<view class="room-hd" v-else> |
|
|
|
|
<zego-remote-view class="video-view" :streamID="sellerStreamId" :style="{'width': winWidth+'px', 'height': winHeight+'px'}"></zego-remote-view> |
|
|
|
|
<zego-local-view class="shitu" :style="{'top': (statusBarHeight+60)+'px'}"></zego-local-view> |
|
|
|
|
<view class="room-hd" @click="qiehuan()" v-if="isOpenSocket == false"> |
|
|
|
|
<view class="a" v-if="isToggle"> |
|
|
|
|
<zego-local-view class="video-view" :style="{'width': winWidth+'px', 'height': winHeight+'px'}"></zego-local-view> |
|
|
|
|
<zego-remote-view class="shitu" :streamID="sellerStreamId" :style="{'top': (statusBarHeight+60)+'px'}"></zego-remote-view> |
|
|
|
|
</view> |
|
|
|
|
<view class="a" v-else> |
|
|
|
|
<zego-remote-view class="video-view" :streamID="sellerStreamId" :style="{'width': winWidth+'px', 'height': winHeight+'px'}"></zego-remote-view> |
|
|
|
|
<zego-local-view class="shitu" :style="{'top': (statusBarHeight+60)+'px'}"></zego-local-view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="room-bd" :style="{'width': winWidth+'px', 'height': winHeight+'px'}" v-if="type == 1 || type == 3"> |
|
|
|
|
<view class="room-bd" :style="{'width': winWidth+'px', 'height': winHeight+'px'}" v-if="isOpenSocket"> |
|
|
|
|
<image class="pic" :style="{'width': winWidth+'px', 'height': winHeight+'px'}" src="@/static/yuyin-bg.png"></image> |
|
|
|
|
<view class="dian-on" > |
|
|
|
|
<view class="info"> |
|
|
|
|
<image class="avatar" :src="userOtherInfo.faceImage?userOtherInfo.faceImage:userOtherInfo.img"></image> |
|
|
|
|
<view class="name"><text class="t">{{userOtherInfo.nickname}}</text></view> |
|
|
|
|
<view class="txt"><text class="t">{{userOtherInfo.age}}/{{userOtherInfo.height}}</text></view> |
|
|
|
|
<view class="txt"><text class="t">{{userOtherInfo.age}}岁/{{userOtherInfo.height}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="tag"> |
|
|
|
|
<view class="titles"><text class="t">个性签名:</text></view> |
|
|
|
@ -61,14 +63,11 @@ |
|
|
|
|
<text class="t">挂断</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"></view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic" v-if="isStart"> |
|
|
|
|
<view class="item" v-if="isStart == false"></view> |
|
|
|
|
<view class="item" v-if="isStart == false"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image class="pimg" src="@/static/yuyin-05.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="pic" v-else> |
|
|
|
|
<image class="pimg" @click="toJieshou1()" src="@/static/yuyin-05.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">{{isStart?'等待':'接受'}}</text> |
|
|
|
|
</view> |
|
|
|
@ -121,13 +120,10 @@ |
|
|
|
|
<text class="t">挂断</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic" v-if="isStart"> |
|
|
|
|
<view class="item" v-if="isStart == false" @click="toJieshou1()"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image class="pimg" src="@/static/yuyin-05.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="pic" v-else> |
|
|
|
|
<image class="pimg" @click="toJieshou1()" src="@/static/yuyin-05.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">{{isStart?'等待':'接受'}}</text> |
|
|
|
|
</view> |
|
|
|
@ -169,6 +165,7 @@ |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
isOpenSocket: true, |
|
|
|
|
isYuyin: true, |
|
|
|
|
isGuaduan: true, |
|
|
|
|
isYangshengqi: true, |
|
|
|
@ -215,9 +212,11 @@ |
|
|
|
|
async onReady() { |
|
|
|
|
const that = this; |
|
|
|
|
uni.$on("watchEvent",function (obj) { |
|
|
|
|
console.log(obj) |
|
|
|
|
if(obj.topic == 'message'){ |
|
|
|
|
if(obj.type == 12){ |
|
|
|
|
if(uni.getStorageSync("userInfo").id == obj.sellerId){ |
|
|
|
|
that.isGuaduan = false; |
|
|
|
|
that.toGuaduan(1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -230,6 +229,9 @@ |
|
|
|
|
if(obj.type == 20){ |
|
|
|
|
if(uni.getStorageSync("userInfo").id == obj.sellerId){ |
|
|
|
|
that.toJieshou(); |
|
|
|
|
this.isOpenSocket = false; |
|
|
|
|
}else{ |
|
|
|
|
this.isOpenSocket = false; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -245,25 +247,27 @@ |
|
|
|
|
if(res == 1 && res1 == 1){ |
|
|
|
|
if(this.type <= 2){ |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.getOtherUserInfo() |
|
|
|
|
}else{ |
|
|
|
|
this.getOtherUserInfo() |
|
|
|
|
this.getUserInfo(1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
this.getOtherUserInfo() |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
// #endif |
|
|
|
|
|
|
|
|
|
if(this.type <= 2){ |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
}else{ |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
this.getUserInfo(1); |
|
|
|
|
} |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
qiehuan() { |
|
|
|
|
this.isToggle = !this.isToggle; |
|
|
|
|
console.log(this.isToggle) |
|
|
|
|
}, |
|
|
|
|
toJieshou1() { |
|
|
|
|
uni.$emit("jieshouYinship",{ |
|
|
|
|
"userId": uni.getStorageSync("userInfo").id, |
|
|
|
@ -276,7 +280,6 @@ |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onBack() { |
|
|
|
|
console.log(1111) |
|
|
|
|
const that = this; |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "温馨提示", |
|
|
|
@ -299,9 +302,11 @@ |
|
|
|
|
"topic":"message", |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.socialConsumption(); |
|
|
|
|
if(type == 1){ |
|
|
|
|
uni.$emit("showToast",this.isJieshou) |
|
|
|
|
} |
|
|
|
|
// this.socialConsumption(); |
|
|
|
|
clearInterval(timer) |
|
|
|
|
uni.$emit("watchSocket") |
|
|
|
|
if(this.toIsBack == false){ |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
@ -317,6 +322,8 @@ |
|
|
|
|
this.engine?.logoutRoom(this.roomId); |
|
|
|
|
/** 销毁引擎 */ |
|
|
|
|
ZegoExpressEngine.destroyEngine(); |
|
|
|
|
uni.$off("watchEvent") |
|
|
|
|
uni.$off("toJieshouYinship") |
|
|
|
|
uni.navigateBack({ |
|
|
|
|
delta: 1 |
|
|
|
|
}) |
|
|
|
@ -342,9 +349,6 @@ |
|
|
|
|
this.engine.setAudioRouteToSpeaker(this.isCamera) |
|
|
|
|
}, |
|
|
|
|
async toPermission() { |
|
|
|
|
if(this.type ==3 || this.type==1){ |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
} |
|
|
|
|
this.getUserInfo(); |
|
|
|
|
}, |
|
|
|
|
//查询个人信息 |
|
|
|
@ -431,6 +435,7 @@ |
|
|
|
|
that.engine.on('publisherStateUpdate', (streamID, state, errorCode, extendedData) => { |
|
|
|
|
console.log("publisherStateUpdate",streamID) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// 登录房间 |
|
|
|
|
// 开始登录房间 |
|
|
|
@ -504,7 +509,7 @@ |
|
|
|
|
const that = this; |
|
|
|
|
console.log("toTuiliu",this.sellerStreamId) |
|
|
|
|
that.engine.startPlayingStream(this.sellerStreamId); |
|
|
|
|
|
|
|
|
|
that.isOpenSocket = false; |
|
|
|
|
ZegoExpressEngine.instance().on("playerStateUpdate", (streamID, state, errorCode, extendedData) => { |
|
|
|
|
/** 调用拉流接口成功后,当拉流器状态发生变更,如出现网络中断导致推流异常等情况,SDK在重试拉流的同时,会通过该回调通知 */ |
|
|
|
|
console.log("playerStateUpdate",streamID) |
|
|
|
@ -527,7 +532,7 @@ |
|
|
|
|
position: fixed; |
|
|
|
|
left: 0; |
|
|
|
|
top: 0; |
|
|
|
|
z-index: 22; |
|
|
|
|
z-index: 122; |
|
|
|
|
display: flex; |
|
|
|
|
flex-direction: row; |
|
|
|
|
.navbar{ |
|
|
|
@ -551,7 +556,6 @@ |
|
|
|
|
height: 44px; |
|
|
|
|
position: fixed; |
|
|
|
|
left: 0; |
|
|
|
|
top: 50px; |
|
|
|
|
z-index: 44; |
|
|
|
|
display: flex; |
|
|
|
|
align-items: center; |
|
|
|
@ -566,15 +570,16 @@ |
|
|
|
|
&-hd{ |
|
|
|
|
flex-direction: column; |
|
|
|
|
position: relative; |
|
|
|
|
z-index: 2; |
|
|
|
|
.shitu{ |
|
|
|
|
width: 300rpx; |
|
|
|
|
height: 300rpx; |
|
|
|
|
height: 380rpx; |
|
|
|
|
border-radius: 10rpx; |
|
|
|
|
overflow: hidden; |
|
|
|
|
position: absolute; |
|
|
|
|
position: fixed; |
|
|
|
|
right: 20rpx; |
|
|
|
|
top: 120rpx; |
|
|
|
|
z-index: 12; |
|
|
|
|
z-index: 212; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
&-bd{ |
|
|
|
@ -679,7 +684,7 @@ |
|
|
|
|
position: fixed; |
|
|
|
|
left: 0; |
|
|
|
|
bottom: 200rpx; |
|
|
|
|
z-index: 44; |
|
|
|
|
z-index: 122; |
|
|
|
|
flex-direction: row; |
|
|
|
|
.item{ |
|
|
|
|
flex: 1; |
|
|
|
|