|
|
|
@ -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> |
|
|
|
@ -168,7 +164,8 @@ |
|
|
|
|
ZegoRemoteView, |
|
|
|
|
}, |
|
|
|
|
data() { |
|
|
|
|
return { |
|
|
|
|
return { |
|
|
|
|
isOpenSocket: true, |
|
|
|
|
isYuyin: true, |
|
|
|
|
isGuaduan: true, |
|
|
|
|
isYangshengqi: true, |
|
|
|
@ -214,10 +211,12 @@ |
|
|
|
|
}, |
|
|
|
|
async onReady() { |
|
|
|
|
const that = this; |
|
|
|
|
uni.$on("watchEvent",function (obj) { |
|
|
|
|
uni.$on("watchEvent",function (obj) { |
|
|
|
|
console.log(obj) |
|
|
|
|
if(obj.topic == 'message'){ |
|
|
|
|
if(obj.type == 12){ |
|
|
|
|
if(uni.getStorageSync("userInfo").id == obj.sellerId){ |
|
|
|
|
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(); |
|
|
|
|
this.toPermission(); |
|
|
|
|
}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, |
|
|
|
@ -275,8 +279,7 @@ |
|
|
|
|
this.toJieshou(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onBack() { |
|
|
|
|
console.log(1111) |
|
|
|
|
onBack() { |
|
|
|
|
const that = this; |
|
|
|
|
uni.showModal({ |
|
|
|
|
title: "温馨提示", |
|
|
|
@ -298,10 +301,12 @@ |
|
|
|
|
type: 12, |
|
|
|
|
"topic":"message", |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
if(type == 1){ |
|
|
|
|
uni.$emit("showToast",this.isJieshou) |
|
|
|
|
} |
|
|
|
|
this.socialConsumption(); |
|
|
|
|
// 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 |
|
|
|
|
}) |
|
|
|
@ -341,10 +348,7 @@ |
|
|
|
|
this.isYangshengqi = ! this.isYangshengqi |
|
|
|
|
this.engine.setAudioRouteToSpeaker(this.isCamera) |
|
|
|
|
}, |
|
|
|
|
async toPermission() { |
|
|
|
|
if(this.type ==3 || this.type==1){ |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
} |
|
|
|
|
async toPermission() { |
|
|
|
|
this.getUserInfo(); |
|
|
|
|
}, |
|
|
|
|
//查询个人信息 |
|
|
|
@ -429,7 +433,8 @@ |
|
|
|
|
}); |
|
|
|
|
// 调用推流接口成功后,当推流器状态发生变更,如出现网络中断导致推流异常等情况,SDK在重试推流的同时,会通过该回调通知 |
|
|
|
|
that.engine.on('publisherStateUpdate', (streamID, state, errorCode, extendedData) => { |
|
|
|
|
console.log("publisherStateUpdate",streamID) |
|
|
|
|
console.log("publisherStateUpdate",streamID) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}); |
|
|
|
|
// 登录房间 |
|
|
|
@ -503,8 +508,8 @@ |
|
|
|
|
toTuiliu() { |
|
|
|
|
const that = this; |
|
|
|
|
console.log("toTuiliu",this.sellerStreamId) |
|
|
|
|
that.engine.startPlayingStream(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; |
|
|
|
@ -565,16 +569,17 @@ |
|
|
|
|
} |
|
|
|
|
&-hd{ |
|
|
|
|
flex-direction: column; |
|
|
|
|
position: relative; |
|
|
|
|
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; |
|
|
|
|