连云港陪玩陪聊
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
chunwan/pages/pipei/shipin/index.vue

476 lines
11 KiB

3 months ago
<template>
<view class="tongcheng">
<view class="tongcheng-navbar">
3 months ago
<u-navbar :title="title" back-icon-color="#ffffff" title-color="#ffffff" :background="background"></u-navbar>
3 months ago
</view>
<view class="tongcheng-content">
1 month ago
<view class="title" v-if="isSucess == 1">正在寻找新朋友...</view>
<view class="desc" v-if="isSucess == 1">当前用户过多请耐心等待</view>
<view class="desc1" v-else>{{isSucess == 1?'你有一条新的缘分':'匹配成功马上开始这段缘分吧'}}</view>
<view class="dian" v-if="isSucess == 1">
<view class="user">
<view class="item">
<image class="avatar" :src="userInfo.faceImage?userInfo.faceImage:userInfo.img"></image>
<view class="txt">{{userInfo.nickname}}</view>
3 months ago
</view>
1 month ago
<view class="items">
<image src="@/static/yuyin-xin2.png"></image>
3 months ago
</view>
1 month ago
<view class="item">
<view class="pic">
<image class="avatar1" src="@/static/nan.png"></image>
<image class="avatar2" src="@/static/nv.png"></image>
3 months ago
</view>
</view>
</view>
1 month ago
</view>
<view class="dian-on" v-if="isSucess == 2">
<view class="info">
<image :src="info.faceImage?info.faceImage:info.img"></image>
<view class="name">{{info.nickname}}</view>
<view class="txt">{{info.age}}/{{info.height}}</view>
</view>
<view class="tag">
<view class="titles">个性签名</view>
<view class="descs">
<text>{{info.declaration}}</text>
</view>
</view>
</view>
3 months ago
</view>
1 month ago
<view class="tongcheng-end" v-if="isSucess == 1">
3 months ago
<view class="send">茫茫人海今天和你相遇</view>
1 month ago
<view class="todo" @click="toBack()">
3 months ago
<image src="@/static/yuyin-cha.png"></image>
3 months ago
</view>
</view>
1 month ago
<!-- <view class="tongcheng-start"> -->
<!-- <view class="item" @click="toggleMenu(1)">
<image src="@/static/yuyin-01.png" v-if="isMakefeng"></image><image v-else src="@/static/yuyin-01-on.png"></image>麦克风{{isMakefeng?'开启':'已关'}}
3 months ago
</view>
1 month ago
<view class="item" @click="toggleMenu(2)">
<image src="@/static/yuyin-03.png" v-if="isYangshengqi"></image><image v-else src="@/static/yuyin-03-on.png"></image>扬声器{{isYangshengqi?'开启':'已关'}}
3 months ago
</view>
1 month ago
<view class="item" @click="toggleMenu(6)">
<image src="@/static/yuyin-04.png" v-if="isShexiangtou"></image><image v-else src="@/static/yuyin-04-on.png"></image>摄像头{{isShexiangtou?'开启':'已关'}}
</view> -->
<!-- <view class="item"></view> -->
<!-- <view class="items">
<image @click="toggleMenu(4)" src="@/static/yuyin-02.png"></image>
<image @click="toggleMenu(5)" class="off" src="@/static/yuyin-off.png"></image>
</view> -->
<!-- <view class="item"></view> -->
<!-- </view> -->
<view class="tongcheng-start" v-if="isSucess == 2">
<view class="item" @click="toPage(1)">
<image src="@/static/yuyin-02.png"></image>换一个
</view>
3 weeks ago
<!-- <view class="item">
1 month ago
<image src="@/static/yuyin-05.png"></image>{{isSucess == 2?'等待中':'立即进入'}}
3 weeks ago
</view> -->
1 month ago
</view>
<!-- <view class="tongcheng-video">
3 months ago
<view class="other"></view>
<view class="content"></view>
1 month ago
</view> -->
3 months ago
</view>
</template>
<script>
1 month ago
let timer = null;
3 months ago
export default {
data() {
return {
1 month ago
info: {},
3 weeks ago
count: 5,
1 month ago
userInfo: {},
isJieshou: false,
3 months ago
title: "视频速配",
isShexiangtou: true,
isMakefeng: true,
isYangshengqi: true,
1 month ago
isSucess: 1,
3 months ago
background: {
// 导航栏背景图
1 month ago
background: 'url(https://api.lyiyuan.cn/profile/upload/static/yuyin-bg.png) center top no-repeat',
3 months ago
// 还可以设置背景图size属性
backgroundSize: '100 auto',
},
};
3 months ago
},
1 month ago
onLoad() {
this.userInfo = uni.getStorageSync("userInfo");
3 weeks ago
this.count = Math.floor(Math.random() * (5 - 1 + 1)) + 1;
1 month ago
this.toPage(1)
},
onReady() {
this.watchSocket();
},
3 months ago
methods: {
1 month ago
watchSocket() {
const that = this;
4 weeks ago
uni.$on("jiantingTiaozhuan",function (obj) {
1 month ago
console.log("watchSocket",obj)
if(obj.topic == 'message'){
if(obj.type>= 8){
if(uni.getStorageSync("userInfo").id == obj.sellerId){
if(obj.type == 10){
1 month ago
setTimeout(()=>{that.toPage(2,obj.userId)},500)
1 month ago
}else if(obj.type == 11){
that.isSucess = 1
that.toPage(1);
}
}
}
4 weeks ago
1 month ago
}
});
},
toBack() {
clearInterval(timer);
uni.navigateBack({
delta: 1
})
},
toPage(index,id){
const that = this;
if(index == 1){
that.isSucess = 1;
clearInterval(timer);
timer = setInterval(()=>{
if(that.count == 0){
clearInterval(timer);
that.count = Math.floor(Math.random() * (10 - 1 + 1)) + 1;
that.userSpeedDating();
}else{
that.count --
}
},1000)
}else if(index == 2){
this.toChat(id);
}else if(index == 3){
that.isSucess = 1;
that.count = Math.floor(Math.random() * (10 - 1 + 1)) + 1;
}
},
//去视频聊天
async toChat(id) {
console.log("toChat",uni.getStorageSync("userInfo").id , id)
4 weeks ago
uni.navigateTo({
1 month ago
url: "/pages/pipei/shipin/detail?type=2&id="+id
})
},
async userSpeedDating() {
const { code, data, msg } = await this.$api.userSpeedDating({
userId: uni.getStorageSync("userInfo").id,
1 month ago
type: 2,
1 month ago
lat: uni.getStorageSync("jingweiInfo").latitude,
lon: uni.getStorageSync("jingweiInfo").longitude,
city: uni.getStorageSync("jingweiInfo").new_city?uni.getStorageSync("jingweiInfo").new_city:uni.getStorageSync("jingweiInfo").city,
})
if(code == 200){
this.isSucess = 2;
this.info = data
uni.sendSocketMessage({data:JSON.stringify({
"userId": uni.getStorageSync("userInfo").id,
sellerId: data.id,
type: 9,
"topic":"message"
})})
}else{
this.isSucess = 1;
uni.showToast({
title: msg,
position: "bottom",
icon: "none",
})
}
},
3 months ago
toggleMenu(index){
if(index == 1){
this.isMakefeng = !this.isMakefeng
}else if(index == 2){
this.isYangshengqi = !this.isYangshengqi
}else if(index == 3){
this.isJieshou = !this.isJieshou
this.title = (this.isJieshou == false?"视频速配":'00:59')
}else if(index == 4){
uni.navigateBack({
delta: 1
})
}else if(index == 6){
this.isShexiangtou = !this.isShexiangtou
}
},
3 months ago
}
}
</script>
<style scoped lang="scss">
.tongcheng{
1 month ago
background: #0d0b15 url(https://api.lyiyuan.cn/profile/upload/static/yuyin-bg.png) center top no-repeat;
3 months ago
background-size: 100% auto;
overflow: hidden;
min-height: 100vh;
3 months ago
&-video{
width: 100%;
height: 100%;
position: absolute;
left: 0;
top: 0;
z-index: 20;
background-color: #000;
.other{
width: 280rpx;
height: 340rpx;
position: absolute;
right: 25rpx;
top: 200rpx;
z-index: 2;
background: #FFFFFF;
border-radius: 20rpx;
}
}
3 months ago
&-content{
text-align: center;
.title{
font-weight: 500;
font-size: 48rpx;
color: #FFFFFF;
margin-top: 120rpx;
}
.desc{
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
margin-top: 30rpx;
}
3 months ago
.desc1{
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
margin-top: 120rpx;
}
3 months ago
.dian{
3 months ago
width: 648rpx;
height: 648rpx;
background: url(@/static/yuyin-bg2.png) center top no-repeat;
3 months ago
background-size: 100% auto;
margin: 0 auto;
3 months ago
margin-top: 50rpx;
3 months ago
display: flex;
align-items: center;
justify-content: center;
.user{
display: flex;
3 months ago
align-items: center;
3 months ago
justify-content: space-between;
margin-top: -10rpx;
margin-left: 20rpx;
.items{
3 months ago
width: 290rpx;
position: relative;
z-index: 5;
3 months ago
image{
3 months ago
width: 290rpx;
height: 86rpx;
3 months ago
}
}
.item{
3 months ago
width: 180rpx;
position: relative;
height: 180rpx;
3 months ago
.avatar{
3 months ago
width: 180rpx;
height: 180rpx;
3 months ago
border-radius: 50%;
}
.txt{
font-weight: 500;
font-size: 28rpx;
color: #FFFFFF;
margin-top: 10rpx;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
overflow: hidden;
3 months ago
width: 180rpx;
3 months ago
}
3 months ago
.pic{
width: 180rpx;
position: relative;
left: -30rpx;
z-index: 2;
.avatar1{
width: 180rpx;
height: 180rpx;
border-radius: 50%;
opacity: 0.5;
position: absolute;
left: 0;
top: 0;
z-index: 3;
3 months ago
}
3 months ago
.avatar2{
width: 180rpx;
height: 180rpx;
border-radius: 50%;
opacity: 0.3;
position: absolute;
left: 30rpx;
top: 0;
z-index: 2;
3 months ago
}
}
3 months ago
}
}
}
.dian-on{
width: 648rpx;
min-height: 648rpx;
background: url(@/static/yuyin-bg2.png) center top no-repeat;
background-size: 100% auto;
margin: 0 auto;
margin-top: 150rpx;
.tag{
width: 660rpx;
height: 330rpx;
background: rgba(35, 32, 48, 0.36);
border-radius: 20rpx;
margin: 0 auto;
padding: 30rpx;
box-sizing: border-box;
text-align: left;
margin-top: 30rpx;
.titles{
font-weight: bold;
font-size: 30rpx;
color: #FFFFFF;
}
.descs{
line-height: 45rpx;
font-weight: 400;
font-size: 24rpx;
color: #B8B7BC;
margin-top: 20rpx;
3 months ago
}
}
.info{
3 months ago
width: 100%;
3 months ago
text-align: center;
3 months ago
overflow: hidden;
3 months ago
image{
width: 180rpx;
height: 180rpx;
border-radius: 50%;
}
3 months ago
.name{
3 months ago
font-weight: 500;
3 months ago
font-size: 28rpx;
3 months ago
color: #FFFFFF;
margin-top: 10rpx;
3 months ago
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
overflow: hidden;
text-align: center;
margin-top: 10rpx;
}
.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;
}
.txt{
font-weight: 500;
font-size: 26rpx;
color: #FFFFFF;
margin-top: 20rpx;
opacity: 0.3;
3 months ago
}
}
}
}
&-start{
3 months ago
width: 100%;
3 months ago
position: absolute;
3 months ago
left: 0;
bottom: 130rpx;
3 months ago
z-index: 21;
3 months ago
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
.item{
width: 33.3%;
font-weight: 500;
font-size: 24rpx;
color: rgba(255, 255, 255, 0.4);
text-align: center;
image{
width: 130rpx;
height: 130rpx;
display: block;
margin: 0 auto;
border-radius: 50%;
margin-bottom: 20rpx;
}
1 month ago
font-size: 30rpx;
color: #FFFFFF;
3 months ago
}
.items{
width: 33.3%;
display: flex;
margin-top: 70rpx;
position: relative;
image{
width: 130rpx;
height: 130rpx;
display: block;
margin: 0 auto;
margin-bottom: 20rpx;
}
.off{
width: 49rpx;
height: 44rpx;
position: absolute;
left: 260rpx;
top: 50%;
margin-top: -28rpx;
z-index: 2;
}
}
3 months ago
}
&-end{
width: 100%;
position: absolute;
left: 0;
3 months ago
bottom: 140rpx;
3 months ago
z-index: 21;
.send{
3 months ago
width: 100%;
3 months ago
text-align: center;
font-weight: 500;
font-size: 30rpx;
color: #FFFFFF;
}
.todo{
3 months ago
width: 100%;
3 months ago
text-align: center;
3 months ago
margin-top: 30rpx;
image{
width: 60rpx;
height: 60rpx;
}
3 months ago
}
}
}
</style>