|
|
|
@ -23,13 +23,13 @@ |
|
|
|
|
<view class="dian-on" > |
|
|
|
|
<view class="info"> |
|
|
|
|
<image class="avatar" :src="userOtherInfo.faceImage?userOtherInfo.faceImage:userOtherInfo.img"></image> |
|
|
|
|
<view class="name">{{userOtherInfo.nickname}}</view> |
|
|
|
|
<view class="txt">{{userOtherInfo.age}}/{{userOtherInfo.height}}</view> |
|
|
|
|
<view class="name"><text class="t">{{userOtherInfo.nickname}}</text></view> |
|
|
|
|
<view class="txt"><text class="t">{{userOtherInfo.age}}/{{userOtherInfo.height}}</text></view> |
|
|
|
|
</view> |
|
|
|
|
<view class="tag"> |
|
|
|
|
<view class="titles">个性签名:</view> |
|
|
|
|
<view class="titles"><text class="t">个性签名:</text></view> |
|
|
|
|
<view class="descs"> |
|
|
|
|
<text>{{userOtherInfo.declaration}}</text> |
|
|
|
|
<text class="t">{{userOtherInfo.declaration}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
@ -39,50 +39,111 @@ |
|
|
|
|
<view class="pic" @click="toggleYuyin()" v-if="isJieshou==true"> |
|
|
|
|
<image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image> |
|
|
|
|
<image v-else class="pimg" src="@/static/yuyin-01-on.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt" v-if="isJieshou==true"> |
|
|
|
|
<text class="t">{{isYuyin?'开启':'关闭'}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="item" v-if="isJieshou"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image v-if="isJieshou" @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
<image v-else class="pimg" @click="toJieshou()" src="@/static/yuyin-05.png"></image> |
|
|
|
|
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">挂断</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<template v-if="isJieshou == false"> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">挂断</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"></view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic" v-if="isStart"> |
|
|
|
|
<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> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic" @click="toggleYangsheng()" v-if="isJieshou==true"> |
|
|
|
|
<image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image> |
|
|
|
|
<image class="pimg" v-else src="@/static/yuyin-03-on.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt" v-if="isJieshou==true"> |
|
|
|
|
<text class="t">{{isYangshengqi?'开启':'关闭'}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="room-fd" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" > |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="item" v-if="isJieshou"> |
|
|
|
|
<view class="pic" @click="toggleYuyin()" v-if="isJieshou==true"> |
|
|
|
|
<image v-if="isYuyin" class="pimg" src="@/static/yuyin-01.png"></image> |
|
|
|
|
<image v-else class="pimg" src="@/static/yuyin-01-on.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">{{isYuyin?'开启':'关闭'}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="item" v-if="isJieshou"> |
|
|
|
|
<view class="pic" @click="toggleYangsheng()"> |
|
|
|
|
<image class="pimg" v-if="isYangshengqi" src="@/static/yuyin-03.png"></image> |
|
|
|
|
<image class="pimg" v-else src="@/static/yuyin-03-on.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">{{isYangshengqi?'开启':'关闭'}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="item" v-if="isJieshou"> |
|
|
|
|
<view class="pic" @click="toggleShexiang()" v-if="isJieshou==true"> |
|
|
|
|
<image class="pimg" v-if="isShexiang" src="@/static/yuyin-04.png"></image> |
|
|
|
|
<image class="pimg" v-else src="@/static/yuyin-04-on.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">{{isShexiang?'开启':'关闭'}}</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="room-fd1" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" > |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image v-if="isJieshou" @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
<image v-else class="pimg" @click="toJieshou()" src="@/static/yuyin-05.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<image class="off" @click="toggleHuamian()" src="@/static/yuyin-off.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<template v-if="isJieshou == false"> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<view class="txt"> |
|
|
|
|
<text class="t">挂断</text> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
<view class="item"> |
|
|
|
|
<view class="pic" v-if="isStart"> |
|
|
|
|
<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> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
|
<template v-if="isJieshou"> |
|
|
|
|
<view class="room-fd1" v-if="type==2 || type==4" :style="{'width': winWidth+'px'}" > |
|
|
|
|
<view class="items"> |
|
|
|
|
<view class="pic"> |
|
|
|
|
<image @click="toGuaduan()" class="pimg" src="@/static/yuyin-02.png"></image> |
|
|
|
|
</view> |
|
|
|
|
<image class="off" @click="toggleHuamian()" src="@/static/yuyin-off.png"></image> |
|
|
|
|
</view> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
</view> |
|
|
|
|
</template> |
|
|
|
|
|
|
|
|
@ -134,13 +195,16 @@ |
|
|
|
|
statusBarHeight: 0, |
|
|
|
|
sellerStreamId: "", |
|
|
|
|
viewModeIndex: 0, |
|
|
|
|
isCamera: true |
|
|
|
|
isCamera: true, |
|
|
|
|
isStart: true, |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onLoad(o) { |
|
|
|
|
onLoad(o) { |
|
|
|
|
console.log(o) |
|
|
|
|
this.id = o.id; |
|
|
|
|
this.type=o.type; |
|
|
|
|
this.title = (this.type == 1||this.type == 3)?"语音通话":"视频通话", |
|
|
|
|
this.title = (this.type == 1||this.type == 3)?"语音通话":"视频通话"; |
|
|
|
|
this.isStart = (this.type == 3||this.type == 4)?(o.fid?false:true):true |
|
|
|
|
this.isShexiang = (this.type == 2 || this.type == 4)?true:false |
|
|
|
|
this.isJieshou = o.type<=2?true:false; |
|
|
|
|
this.winWidth = uni.getSystemInfoSync().windowWidth; |
|
|
|
@ -149,16 +213,25 @@ |
|
|
|
|
}, |
|
|
|
|
async onReady() { |
|
|
|
|
const that = this; |
|
|
|
|
uni.onSocketMessage(function (res) { |
|
|
|
|
const obj = res.data?JSON.parse(res.data):{}; |
|
|
|
|
console.log(obj) |
|
|
|
|
uni.$on("watchEvent",function (obj) { |
|
|
|
|
if(obj.topic == 'message'){ |
|
|
|
|
if(obj.type == 12){ |
|
|
|
|
if(uni.getStorageSync("userInfo").id == obj.sellerId){ |
|
|
|
|
that.toGuaduan(1) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
|
|
|
|
|
uni.$on("toJieshouYinship",(obj)=>{ |
|
|
|
|
console.log("toJieshouYinship",obj) |
|
|
|
|
if(obj.topic == 'message'){ |
|
|
|
|
if(obj.type == 20){ |
|
|
|
|
if(uni.getStorageSync("userInfo").id == obj.sellerId){ |
|
|
|
|
that.toJieshou(); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}) |
|
|
|
|
// #ifdef APP-PLUS |
|
|
|
|
if (uni.getSystemInfoSync().platform === "android") { |
|
|
|
@ -167,20 +240,40 @@ |
|
|
|
|
); |
|
|
|
|
const res1 = await permision.requestAndroidPermission( |
|
|
|
|
"android.permission.CAMERA" |
|
|
|
|
); |
|
|
|
|
); |
|
|
|
|
if(res == 1 && res1 == 1){ |
|
|
|
|
if(this.type <= 2){ |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.getOtherUserInfo() |
|
|
|
|
}else{ |
|
|
|
|
this.getOtherUserInfo() |
|
|
|
|
this.getUserInfo(1); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return ; |
|
|
|
|
} |
|
|
|
|
// #endif |
|
|
|
|
if(this.type==3){ |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if(this.type <= 2){ |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
}else{ |
|
|
|
|
// this.getUserInfo(1); |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
this.getUserInfo(1); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
methods: { |
|
|
|
|
methods: { |
|
|
|
|
toJieshou1() { |
|
|
|
|
uni.$emit("jieshouYinship",{ |
|
|
|
|
"userId": uni.getStorageSync("userInfo").id, |
|
|
|
|
sellerId: this.id, |
|
|
|
|
type: 20, |
|
|
|
|
"topic":"message", |
|
|
|
|
}) |
|
|
|
|
if(this.isStart == false){ |
|
|
|
|
this.toJieshou(); |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
onBack() { |
|
|
|
|
const that = this; |
|
|
|
|
uni.showModal({ |
|
|
|
@ -205,7 +298,8 @@ |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
this.socialConsumption(); |
|
|
|
|
clearInterval(timer) |
|
|
|
|
clearInterval(timer) |
|
|
|
|
uni.$emit("watchSocket") |
|
|
|
|
this.isGuaduan = false |
|
|
|
|
/** 停止推流 */ |
|
|
|
|
this.engine?.stopPublishingStream(); |
|
|
|
@ -222,7 +316,8 @@ |
|
|
|
|
}) |
|
|
|
|
}, |
|
|
|
|
toJieshou() { |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.toPermission(); |
|
|
|
|
this.$forceUpdate(); |
|
|
|
|
}, |
|
|
|
|
toggleYuyin() { |
|
|
|
|
this.isYuyin = !this.isYuyin; |
|
|
|
@ -233,14 +328,17 @@ |
|
|
|
|
this.engine.enableCamera(this.isShexiang) |
|
|
|
|
}, |
|
|
|
|
toggleHuamian() { |
|
|
|
|
this.isCamera = ! this.isCamera |
|
|
|
|
this.isCamera = !this.isCamera |
|
|
|
|
this.engine.useFrontCamera(this.isCamera) |
|
|
|
|
}, |
|
|
|
|
toggleYangsheng() { |
|
|
|
|
this.isYangshengqi = ! this.isYangshengqi |
|
|
|
|
this.engine.setAudioRouteToSpeaker(this.isCamera) |
|
|
|
|
}, |
|
|
|
|
async toPermission() { |
|
|
|
|
async toPermission() { |
|
|
|
|
if(this.type ==3 || this.type==1){ |
|
|
|
|
this.getOtherUserInfo(); |
|
|
|
|
} |
|
|
|
|
this.getUserInfo(); |
|
|
|
|
}, |
|
|
|
|
//查询个人信息 |
|
|
|
@ -263,8 +361,9 @@ |
|
|
|
|
}, |
|
|
|
|
//查询taren个人信息 |
|
|
|
|
async getOtherUserInfo(type) { |
|
|
|
|
const { code, data , msg } = await this.$api.findOtherUserInfo({userId: uni.getStorageSync("userInfo").id,sellerId: this.id,}); |
|
|
|
|
const { code, data , msg } = await api.findOtherUserInfo({userId: uni.getStorageSync("userInfo").id,sellerId: this.id,}); |
|
|
|
|
if(code == 200){ |
|
|
|
|
console.log("getOtherUserInfo",data) |
|
|
|
|
this.userOtherInfo = data; |
|
|
|
|
}else{ |
|
|
|
|
uni.showToast({ |
|
|
|
@ -475,11 +574,10 @@ |
|
|
|
|
display: block; |
|
|
|
|
} |
|
|
|
|
.dian-on{ |
|
|
|
|
width: 648rpx; |
|
|
|
|
width: 650rpx; |
|
|
|
|
min-height: 648rpx; |
|
|
|
|
position: absolute; |
|
|
|
|
left: 50%; |
|
|
|
|
margin-left: -324rpx; |
|
|
|
|
margin-left: 50rpx; |
|
|
|
|
top: 250rpx; |
|
|
|
|
z-index: 1; |
|
|
|
|
.tag{ |
|
|
|
@ -493,21 +591,29 @@ |
|
|
|
|
text-align: left; |
|
|
|
|
margin-top: 30rpx; |
|
|
|
|
.titles{ |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
.t{ |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.descs{ |
|
|
|
|
line-height: 45rpx; |
|
|
|
|
font-weight: 400; |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #B8B7BC; |
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
.t{ |
|
|
|
|
font-size: 24rpx; |
|
|
|
|
color: #B8B7BC; |
|
|
|
|
line-height: 45rpx; |
|
|
|
|
font-weight: 400; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.info{ |
|
|
|
|
text-align: center; |
|
|
|
|
overflow: hidden; |
|
|
|
|
display: flex; |
|
|
|
|
justify-content: center; |
|
|
|
|
align-items: center; |
|
|
|
|
flex-direction: column; |
|
|
|
|
.avatar{ |
|
|
|
|
width: 180rpx; |
|
|
|
|
height: 180rpx; |
|
|
|
@ -517,33 +623,42 @@ |
|
|
|
|
} |
|
|
|
|
.name{ |
|
|
|
|
font-weight: 500; |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
margin-top: 10rpx; |
|
|
|
|
white-space: nowrap; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-overflow: ellipsis; |
|
|
|
|
overflow: hidden; |
|
|
|
|
text-align: center; |
|
|
|
|
text-align: center; |
|
|
|
|
margin-top: 10rpx; |
|
|
|
|
.t{ |
|
|
|
|
font-size: 28rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.btn{ |
|
|
|
|
width: 170rpx; |
|
|
|
|
line-height: 56rpx; |
|
|
|
|
background: linear-gradient(0deg, #FF9124, #BD4700); |
|
|
|
|
border-radius: 56rpx; |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
|
|
|
|
|
margin: 0 auto; |
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
.t{ |
|
|
|
|
font-weight: bold; |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
.txt{ |
|
|
|
|
font-weight: 500; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
|
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
opacity: 0.3; |
|
|
|
|
.t{ |
|
|
|
|
font-weight: 500; |
|
|
|
|
font-size: 26rpx; |
|
|
|
|
color: #FFFFFF; |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
@ -552,7 +667,7 @@ |
|
|
|
|
height: 220rpx; |
|
|
|
|
position: fixed; |
|
|
|
|
left: 0; |
|
|
|
|
bottom: 180rpx; |
|
|
|
|
bottom: 200rpx; |
|
|
|
|
z-index: 44; |
|
|
|
|
flex-direction: row; |
|
|
|
|
.item{ |
|
|
|
@ -565,7 +680,7 @@ |
|
|
|
|
align-items: center; |
|
|
|
|
.txt{ |
|
|
|
|
margin-top: 20rpx; |
|
|
|
|
text{ |
|
|
|
|
.t{ |
|
|
|
|
font-size: 30rpx; |
|
|
|
|
color: #ffffff; |
|
|
|
|
} |
|
|
|
|