修复已知问题

This commit is contained in:
bobobobo
2026-02-06 01:12:04 +08:00
parent 2d503bab83
commit 3389a8eaa9
15 changed files with 2516 additions and 1824 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -11,7 +11,7 @@
{ name: '公司介绍', icon: 'company' },
{ name: '朋友圈', icon: 'circle' },
{ name: '线上商城', icon: 'mall' },
{ name: '我的拼团伙伴', icon: 'team' },
{ name: '购买记录', icon: 'team' },
{ name: '项目入口', icon: 'project' },
{ name: '直播列表', icon: 'liveStream' }
]

View File

@@ -160,7 +160,10 @@
})
onLoad(async e => {
// groupId
groupId.value = e?.groupId || ''
console.log(e?.groupId, '===')
formData.startGroup = !!e?.groupId
await getData(e.productId)
})
</script>
@@ -267,6 +270,7 @@
</view>
<view
v-if="groupId"
class="pay-way-item"
@click="formData.startGroup = !formData.startGroup"
>

View File

@@ -184,7 +184,7 @@
"
/>
</view>
<button
<!-- <button
v-if="item.showDate"
@click="
navigateTo('/pages/mall/confirm-order', {
@@ -194,7 +194,7 @@
"
>
去拼单
</button>
</button> -->
</view>
</view>
</view>

View File

@@ -12,9 +12,11 @@
} from '@/api/my-index'
import { useUI } from '@/utils/use-ui'
import { useAuthUser } from '@/composables/useAuthUser'
import { useUserStore } from '../../stores/user'
const { showToast, showDialog } = useUI()
const { integralData } = useAuthUser()
const { getIntegral } = useUserStore()
const tixian = ref(null)
const popup = ref(null)
@@ -120,6 +122,7 @@
}
tixian.value.close()
await addUserWithdraw(data)
await getIntegral()
await showToast(`提现成功`, 'success')
navigateBack()
} catch (error) {

402
pages/room/incom.vue Normal file
View File

@@ -0,0 +1,402 @@
<script setup>
import * as CallLib from '@/uni_modules/RongCloud-CallWrapper/lib/index'
import { ref, watch } from 'vue'
import { onLoad } from '@dcloudio/uni-app'
import { TUIUserService } from '@tencentcloud/chat-uikit-engine-lite'
import { useUI } from '../../utils/use-ui'
import { navigateBack } from '../../utils/router'
CallLib.init({})
const { showLoading, hideLoading } = useUI()
const callBackground = ref('/static/images/public/random2.png')
/** 呼叫用户信息 */
const callerInfo = ref({})
/** 通话状态 */
const isRinging = ref(true)
/** 控制按钮状态 */
const activeBtn = ref(null)
/**
* 拨打状态
* call: 发起呼叫
* answer: 接听
* dialogue: 对话中
*/
const callState = ref('')
CallLib.onCallReceived(res => {
console.log(
'Engine:OnCallReceived=>' + '监听通话呼入, 目标id=>',
res.data.targetId
)
})
CallLib.onCallOutgoing(res => {
console.log(
'主叫端拨出电话后,通过回调 onCallOutgoing通知当前 call 的详细信息',
res
)
})
CallLib.onCallConnected(res => {
console.log(res)
console.log(
'Engine:OnCallConnected=>' +
'已建立通话通话接通时,通过回调 onCallConnected 通知当前 call 的详细信息',
res
)
})
CallLib.onRemoteUserJoined(res => {
console.log(
'Engine:OnRemoteUserJoined=>' +
'主叫端拨出电话被叫端收到请求后加入通话被叫端Id为=>',
res.data.userId
)
})
/** 挂断电话 */
const isDisconnected = ref(true)
CallLib.onCallDisconnected(res => {
console.log(
'Engine:OnCallDisconnected=>' + '挂断成功, 挂断原因=>',
res.data.reason
)
isDisconnected.value = false
})
watch(
() => isDisconnected.value,
v => {
navigateBack()
}
)
CallLib.onRemoteUserRinging(res => {
console.log(
'主叫端拨出电话被叫端收到请求发出振铃响应时触发对端Id为=>',
res.data.userId
)
})
CallLib.onError(res => {
console.log('通话过程中,发生异常,异常原因=>', res.data.reason)
})
/** 按钮状态 */
const cutFn = show => {
if (show) {
// 接听电话 dialogue
CallLib.enableMicrophone(true)
CallLib.accept()
callState.value = 'dialogue'
} else {
//取消接听,返回上一页
CallLib.hangup()
navigateBack()
}
}
onLoad(async e => {
callState.value = e.type
console.log(e.type)
showLoading()
const res = await TUIUserService.getUserProfile({
userIDList: [e.userID]
})
hideLoading()
callerInfo.value = res.data[0]
if (e.type === 'call') {
CallLib.enableMicrophone(true)
CallLib.startSingleCall(callerInfo.value.userID, 0, 'answer')
}
console.log('===好友信息', res)
})
</script>
<template>
<!-- 来电接听界面 -->
<view class="incoming-call">
<!-- 背景模糊层 -->
<view class="blur-background" v-if="callBackground">
<image
:src="callBackground"
mode="aspectFill"
class="bg-image"
></image>
<view class="bg-overlay"></view>
</view>
<!-- 主内容区 -->
<view class="caller-info">
<view class="caller-avatar-container">
<view class="caller-avatar" :class="{ 'avatar-ring': isRinging }">
<image
v-if="callerInfo?.avatar"
:src="callerInfo?.avatar"
class="avatar-image"
></image>
<uni-icons
v-else
type="contact-filled"
size="50"
color="#fff"
></uni-icons>
</view>
</view>
<text class="caller-name">
{{ callerInfo?.nick || callerInfo?.userID }}
</text>
<text class="call-type">
{{ callState === 'call' ? '语音呼叫中...' : '对话中...' }}
</text>
<!-- <text class="call-status">未接听</text> -->
</view>
<!-- 控制按钮 -->
<view class="incoming-controls">
<view class="incoming-control" @click="cutFn(false)">
<view
class="call-btn decline-btn"
:class="{ 'btn-active': activeBtn === 'decline' }"
>
<uni-icons type="closeempty" size="32" color="#fff"></uni-icons>
</view>
<text class="btn-text">拒绝</text>
</view>
<view
v-if="callState === 'answer'"
class="incoming-control"
@click="cutFn(true)"
>
<view
class="call-btn accept-btn"
:class="{ 'btn-active': activeBtn === 'accept' }"
>
<uni-icons
type="checkmarkempty"
size="28"
color="#fff"
></uni-icons>
</view>
<text class="btn-text">接听</text>
</view>
</view>
</view>
</template>
<style lang="scss" scoped>
.incoming-call {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 9999;
display: flex;
flex-direction: column;
justify-content: space-between;
background-color: #000;
.blur-background {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
z-index: 0;
.bg-image {
width: 100%;
height: 100%;
filter: blur(20px);
opacity: 0.6;
}
.bg-overlay {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.5);
}
}
.caller-info {
flex: 1;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 100rpx;
z-index: 1;
.caller-avatar-container {
position: relative;
margin-bottom: 40rpx;
.caller-avatar {
width: 180rpx;
height: 180rpx;
border-radius: 50%;
background: linear-gradient(135deg, #1aad19, #129611);
display: flex;
align-items: center;
justify-content: center;
overflow: hidden;
.avatar-image {
width: 100%;
height: 100%;
}
&.avatar-ring {
animation: ringPulse 1.5s infinite;
}
}
}
.caller-name {
font-size: 48rpx;
color: #fff;
font-weight: 500;
margin-bottom: 20rpx;
}
.call-type {
font-size: 32rpx;
color: rgba(255, 255, 255, 0.9);
margin-bottom: 10rpx;
}
.call-status {
font-size: 28rpx;
color: rgba(255, 255, 255, 0.7);
}
.call-timer {
margin-top: 30rpx;
padding: 10rpx 30rpx;
background: rgba(255, 255, 255, 0.1);
border-radius: 30rpx;
.timer-text {
font-size: 32rpx;
color: #fff;
font-weight: 500;
}
}
}
.incoming-controls {
display: flex;
justify-content: space-around;
padding: 80rpx 100rpx 120rpx;
z-index: 1;
.incoming-control {
display: flex;
flex-direction: column;
align-items: center;
.call-btn {
width: 120rpx;
height: 120rpx;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
transition: all 0.2s;
&.decline-btn {
background-color: #f43f3b;
&.btn-active {
transform: scale(0.9);
background-color: #d93632;
}
}
&.accept-btn {
background-color: #07c160;
&.btn-active {
transform: scale(0.9);
background-color: #06ad56;
}
}
}
.btn-text {
font-size: 28rpx;
color: #fff;
}
}
}
.action-bar {
position: absolute;
bottom: 60rpx;
left: 0;
width: 100%;
display: flex;
justify-content: space-around;
padding: 0 60rpx;
z-index: 1;
.action-item {
display: flex;
flex-direction: column;
align-items: center;
.action-icon {
width: 100rpx;
height: 100rpx;
border-radius: 50%;
background-color: rgba(255, 255, 255, 0.2);
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 20rpx;
transition: all 0.3s;
&.active {
background-color: rgba(255, 255, 255, 0.4);
}
}
.action-text {
font-size: 24rpx;
color: #fff;
}
}
}
}
@keyframes ringPulse {
0% {
box-shadow: 0 0 0 0 rgba(26, 173, 25, 0.4);
}
70% {
box-shadow: 0 0 0 30rpx rgba(26, 173, 25, 0);
}
100% {
box-shadow: 0 0 0 0 rgba(26, 173, 25, 0);
}
}
/* 响应式调整 */
@media (max-height: 600px) {
.incoming-controls {
padding: 40rpx 100rpx 80rpx !important;
}
.action-bar {
bottom: 40rpx !important;
}
}
</style>

View File

@@ -1,119 +1,102 @@
<template>
<view class="content">
<!-- 单人视频 -->
<view v-if="users.length<=2">
<RongCloud-Call-RCUniCallView class="bigVideoView"
:style="{width:windowWidth+'px',height:windowHeight+'px'}" ref="bigVideoView">
</RongCloud-Call-RCUniCallView>
<RongCloud-Call-RCUniCallView class="smallVideoView" :style="{width:200+'upx',height:200+'upx'}"
ref="smallVideoView">
</RongCloud-Call-RCUniCallView>
</view>
<!-- 多人视频 -->
<view v-else>
<RongCloud-Call-RCUniCallView class="bigVideoView" :style="{width:windowWidth+'px',height:300+'px'}"
ref="bigVideoView">
</RongCloud-Call-RCUniCallView>
<view class="smallViews">
<RongCloud-Call-RCUniCallView v-for="(item,index) in viewArr" :key="item.userId" class="smallView"
:ref="item.userId">
</RongCloud-Call-RCUniCallView>
</view>
</view>
<view class="nav">
<text class="nav-com" v-if="callWay === 1" @click="isMark=true">
邀请
</text>
<text class="nav-com" @click="closeCameraCur">
{{curCamera?'关闭':'开启'}}摄像头
</text>
<text class="nav-com" @click="switchCamera">
切换摄像头
</text>
<text class="nav-com" @click="microphone">
{{isMicrophone?'关闭':'开启'}}麦克风
</text>
<text class="nav-com" @click="enableSpeaker">
{{isEnableSpeaker?'关闭':'开启'}}扬声器
</text>
<text class="nav-com" v-if="mediaTypeCur === 'video'" @click.stop="isBeauty=!isBeauty">
美颜
</text>
</view>
<view class="container" :style="{width:windowWidth+'px'}">
<text class="hangup" @click="hangup">挂断 </text>
<text v-if="mediaTypeCur === 'video' " class="hangup" @click="changeMediaType">切换语音 </text>
</view>
<view class="box-mark" v-if="isMark" :style="{width:windowWidth+'px',height:windowHeight+'px'}" @click.stop="">
<view class="box-cen">
<text class="box-des">被邀请者ID:</text>
<view class="box-bot">
<input v-model="inviteUsersIds" ref="inviteInput" class="box-input" type="text"
placeholder="请输入被邀请者ID">
<text class="box-tit">必填需加入群后方可收到邀请多个userId用英文半角逗号分开</text>
</view>
<view class="box-btns">
<button class="box-btn" type="default" @click="inviteUsers(false)">取消</button>
<button class="box-btn" type="default" @click="inviteUsers(true)">确定</button>
</view>
</view>
<view v-if="users.length <= 2">
<RongCloud-Call-RCUniCallView
class="bigVideoView"
:style="{
width: windowWidth + 'px',
height: windowHeight + 'px'
}"
ref="bigVideoView"
></RongCloud-Call-RCUniCallView>
<RongCloud-Call-RCUniCallView
class="smallVideoView"
:style="{ width: 200 + 'upx', height: 200 + 'upx' }"
ref="smallVideoView"
></RongCloud-Call-RCUniCallView>
</view>
<view class="beauty" v-if="isBeauty" :style="{width:windowWidth+'px'}" @click.stop="">
<view class="beauty-btn">
<view class="change-btn">
<text class="ch-tit">美颜</text><text class="switch-btn"
@click="switchChange">{{isChecked?'开启':'关闭'}}</text>
</view>
<view class="close-btn">
<text class="close-tit" @click="isBeauty=false">X</text>
</view>
</view>
<view class="beauty-view">
<view v-if="curIndex === '0'" class="beauty-tab filte-view">
<view class="tab-item" v-for="(item) in filteArr" :key="item.id" @click="cutFilte(item.id)"
:class="{current: item.id === curFilte}">
<text>{{item.name}}</text>
<!-- 底部按钮 -->
<view class="nav-box">
<view class="control-row">
<view class="icon-item" @click="microphone">
<view class="control-icon">
<uni-icons
:type="isMicrophone ? 'mic' : 'micoff'"
size="24"
color="#fff"
></uni-icons>
</view>
<text class="btn-text">
{{ isMicrophone ? '关闭' : '开启' }}麦克风
</text>
</view>
<!-- 美白 -->
<view v-if="curIndex === '1'" class="white-view com-view">
<slider :value="whiteVal" min="0" max="9" @change="whiteChange" show-value />
<view class="icon-item" @click="closeCameraCur">
<view class="control-icon">
<uni-icons
:type="curCamera ? 'eye' : 'eye-slash'"
size="24"
color="#fff"
></uni-icons>
</view>
<text class="btn-text">
{{ curCamera ? '关闭' : '开启' }}摄像头
</text>
</view>
<!-- 红润 -->
<view v-if="curIndex === '2'" class="ruddy-view com-view">
<slider :value="ruddyVal" min="0" max="9" @change="ruddyChange" show-value />
</view>
<!-- 磨皮 -->
<view v-if="curIndex === '3'" class="buffing-view com-view">
<slider :value="buffingVal" min="0" max="9" @change="buffingChange" show-value />
</view>
<!-- 亮度 -->
<view v-if="curIndex === '4'" class="brightness-view com-view">
<slider :value="brightnessVal" min="0" max="9" @change="brightnessChange" show-value />
<view class="icon-item" @click="enableSpeaker">
<view class="control-icon">
<uni-icons
:type="isEnableSpeaker ? 'sound' : 'sound'"
size="24"
color="#fff"
></uni-icons>
</view>
<text class="btn-text">
{{ isEnableSpeaker ? '关闭' : '开启' }}扬声器
</text>
</view>
</view>
<view class="beauty-tab">
<view class="tab-item" v-for="(item) in tabArr" :key="item.id" @click="curIndex = item.id"
:class="{current: item.id === curIndex}">
<text>{{item.text}}</text>
<view class="control-row" :style="{ width: windowWidth + 'px' }">
<view class="icon-item" @click="changeMediaType">
<view class="control-icon">
<uni-icons
:type="mediaTypeCur === 'video' ? 'phone' : 'videocam'"
size="24"
color="#fff"
></uni-icons>
</view>
<text class="btn-text">
{{ mediaTypeCur === 'video' ? '切换语音' : '切换视频' }}
</text>
</view>
<view class="hangup-btn icon-item" @click="hangup">
<view class="hangup-icon control-icon">
<uni-icons type="phone" size="28" color="#fff"></uni-icons>
</view>
<text class="hangup-text">挂断</text>
</view>
<view class="icon-item" @click="switchCamera">
<view class="control-icon">
<uni-icons type="refresh" size="24" color="#fff"></uni-icons>
</view>
<text class="btn-text">翻转</text>
</view>
</view>
</view>
</view>
</template>
<script>
import * as call from "@/uni_modules/RongCloud-CallWrapper/lib/index"
import * as call from '@/uni_modules/RongCloud-CallWrapper/lib/index'
// import * as im from "@/uni_modules/RongCloud-IMWrapper/js_sdk/index"
// import RCBeautyEngine from "@/uni_modules/RongCloud-BeautyWrapper/lib/RCBeautyEngine"
export default {
data() {
return {
mediaType: "video",
callType: "out",
mediaType: 'video',
callType: 'out',
callWay: 0, //呼叫方式 0 单聊 1 群聊
targetId: "",
targetId: '',
bottomHeight: 0,
isConnected: false,
isSelf: false,
@@ -134,44 +117,6 @@
inviteUsersIds: '',
mediaTypeCur: 'audio',
isBeauty: false,
tabArr: [{
id: '0',
text: '滤镜'
},
{
id: '1',
text: '美白'
},
{
id: '2',
text: '红润'
},
{
id: '3',
text: '磨皮'
},
{
id: '4',
text: '亮度'
},
],
filteArr: [{
id: 0,
name: '原画'
},
{
id: 1,
name: '唯美'
},
{
id: 2,
name: '清新'
},
{
id: 3,
name: '浪漫'
}
],
curIndex: '0',
curFilte: 0,
whiteVal: 0,
@@ -181,201 +126,272 @@
isChecked: false
}
},
onLoad: function() {
console.log("来room页面了");
var _this = this;
onLoad: function () {
var _this = this
uni.getStorage({
key: "room-parameters",
success: (res) => {
this.mediaType = res.data.mediaType;
this.callType = res.data.callType ? res.data.callType : 'in';
this.groupId = res.data.groupId ? res.data.groupId : '';
this.userIds = res.data.userIds ? res.data.userIds : '';
key: 'room-parameters',
success: res => {
this.mediaType = res.data.mediaType
this.callType = res.data.callType ? res.data.callType : 'in'
this.groupId = res.data.groupId ? res.data.groupId : ''
this.userIds = res.data.userIds ? res.data.userIds : ''
if (this.callType === 'out') {
console.log('呼出out')
this.targetId = res.data.targetId;
this.startCall();
this.targetId = res.data.targetId
this.startCall()
} else {
console.log('呼入接受')
this.accept();
this.accept()
}
}
});
})
uni.getSystemInfo({
success: function(res) {
_this.windowWidth = res.windowWidth;
_this.windowHeight = res.windowHeight;
success: function (res) {
_this.windowWidth = res.windowWidth
_this.windowHeight = res.windowHeight
}
})
uni.$on('OnCallConnected', this.onCallConnected)
uni.$on('OnCallDisconnected', this.onCallDisconnected)
// this.initBeautyOpton();
this.initBeautyOpton()
},
beforeDestroy() {
uni.$off('OnCallDisconnected');
uni.$off('OnCallConnected');
uni.$off('OnCallDisconnected')
uni.$off('OnCallConnected')
},
onUnload() {
call.hangup();
call.hangup()
},
onHide() {
const session = call.getCurrentCallSession();
const session = call.getCurrentCallSession()
if (session) {
call.hangup();
call.hangup()
}
},
methods: {
changeMediaType() {
this.mediaTypeCur = 'audio';
call.changeMediaType(0);
if (this.mediaTypeCur == 'video') {
this.mediaTypeCur = 'audio'
} else {
this.mediaTypeCur = 'video'
}
call.changeMediaType(0)
},
inviteUsers(flag) {
if (flag) {
if (this.inviteUsersIds === '') {
uni.showToast({
title: "请输入被邀请者ID",
icon: "error",
title: '请输入被邀请者ID',
icon: 'error',
duration: 2000
})
return;
return
}
let userIdsArr = this.inviteUsersIds.split(',');
call.inviteUsers(userIdsArr, []);
let userIdsArr = this.inviteUsersIds.split(',')
call.inviteUsers(userIdsArr, [])
}
this.$refs.inviteInput.blur();
this.isMark = false;
this.$refs.inviteInput.blur()
this.isMark = false
},
switchVideo() {
this.isMe = !this.isMe;
let session = call.getCurrentCallSession();
this.isMe = !this.isMe
let session = call.getCurrentCallSession()
if (this.isMe) {
switch (uni.getSystemInfoSync().platform) {
case 'android':
call.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0, false);
call.setVideoView(session.mine.userId, this.$refs.smallVideoView.ref, 0, true);
break;
call.setVideoView(
session.targetId,
this.$refs.bigVideoView.ref,
0,
false
)
call.setVideoView(
session.mine.userId,
this.$refs.smallVideoView.ref,
0,
true
)
break
case 'ios':
call.setVideoView(session.targetId, this.$refs.bigVideoView.ref, 0);
call.setVideoView(session.mine.userId, this.$refs.smallVideoView.ref, 0);
break;
call.setVideoView(
session.targetId,
this.$refs.bigVideoView.ref,
0
)
call.setVideoView(
session.mine.userId,
this.$refs.smallVideoView.ref,
0
)
break
default:
console.log('运行在开发者工具上')
break;
break
}
} else {
switch (uni.getSystemInfoSync().platform) {
case 'android':
call.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0, false);
call.setVideoView(session.targetId, this.$refs.smallVideoView.ref, 0, true);
break;
call.setVideoView(
session.mine.userId,
this.$refs.bigVideoView.ref,
0,
false
)
call.setVideoView(
session.targetId,
this.$refs.smallVideoView.ref,
0,
true
)
break
case 'ios':
call.setVideoView(session.mine.userId, this.$refs.bigVideoView.ref, 0);
call.setVideoView(session.targetId, this.$refs.smallVideoView.ref, 0);
break;
call.setVideoView(
session.mine.userId,
this.$refs.bigVideoView.ref,
0
)
call.setVideoView(
session.targetId,
this.$refs.smallVideoView.ref,
0
)
break
default:
console.log('运行在开发者工具上')
break;
break
}
}
},
closeCameraCur() {
this.curCamera = !this.curCamera;
let camera = call.currentCamera();
this.curCamera = !this.curCamera
let camera = call.currentCamera()
call.enableCamera(this.curCamera, camera)
},
closeCameraBack() {
this.backCamera = !this.backCamera;
this.backCamera = !this.backCamera
call.enableCamera(this.backCamera, 1)
},
switchCamera() {
call.switchCamera();
call.switchCamera()
},
microphone() {
this.isMicrophone = !this.isMicrophone;
call.enableMicrophone(this.isMicrophone);
this.isMicrophone = !this.isMicrophone
call.enableMicrophone(this.isMicrophone)
},
enableSpeaker() {
this.isEnableSpeaker = !this.isEnableSpeaker;
call.enableSpeaker(this.isEnableSpeaker);
this.isEnableSpeaker = !this.isEnableSpeaker
call.enableSpeaker(this.isEnableSpeaker)
},
hangup() {
this.isSelf = true;
// RCBeautyEngine.resetBeauty();
call.hangup();
this.isSelf = true
call.hangup()
uni.navigateBack({
delta: 1
})
},
accept() {
call.accept();
call.accept()
},
startCall() {
const type = this.mediaType === 'audio' ? 0 : 1;
this.mediaTypeCur = this.mediaType;
const type = this.mediaType === 'audio' ? 0 : 1
this.mediaTypeCur = this.mediaType
if (this.targetId.length > 0) {
call.enableSpeaker(true);
call.startSingleCall(this.targetId, type, null);
this.currentCallSession = call.getCurrentCallSession();
this.users = this.currentCallSession.users ? this.currentCallSession.users : [];
call.enableSpeaker(true)
call.startSingleCall(this.targetId, type, null)
this.currentCallSession = call.getCurrentCallSession()
this.users = this.currentCallSession.users
? this.currentCallSession.users
: []
} else {
call.startGroupCall(this.groupId, this.userIds, [], type, '');
this.users = this.userIds;
call.startGroupCall(this.groupId, this.userIds, [], type, '')
this.users = this.userIds
console.log(this.users);
this.currentCallSession = call.getCurrentCallSession();
this.users = this.currentCallSession.users ? this.currentCallSession.users : [];
console.log(this.users)
this.currentCallSession = call.getCurrentCallSession()
this.users = this.currentCallSession.users
? this.currentCallSession.users
: []
}
let _this = this;
let _this = this
// im.getCurrentUserId(function(result){
// _this.systemInfoSync(result.userId,_this.$refs.bigVideoView.ref,false);
// })
if (this.currentCallSession) {
this.systemInfoSync(this.currentCallSession.mine.userId, this.$refs.bigVideoView.ref, false);
this.systemInfoSync(
this.currentCallSession.mine.userId,
this.$refs.bigVideoView.ref,
false
)
}
},
onCallConnected() {
let context = this;
console.log('oncallconnected接收了');
this.mediaTypeCur = this.mediaType;
call.enableSpeaker(true);
this.currentCallSession = call.getCurrentCallSession();
this.callWay = this.currentCallSession.callType;
this.users = this.currentCallSession.users ? this.currentCallSession.users : [];
let isHasMine = this.users.findIndex((item) => {
return item.userId === this.currentCallSession.mine.userId;
});
let context = this
console.log('oncallconnected接收了')
this.mediaTypeCur = this.mediaType
call.enableSpeaker(true)
this.currentCallSession = call.getCurrentCallSession()
this.callWay = this.currentCallSession.callType
this.users = this.currentCallSession.users
? this.currentCallSession.users
: []
let isHasMine = this.users.findIndex(item => {
return item.userId === this.currentCallSession.mine.userId
})
if (isHasMine === -1) {
this.users.push(this.currentCallSession.mine);
this.users.push(this.currentCallSession.mine)
}
if (this.currentCallSession && this.currentCallSession.users.length > 0) {
if (
this.currentCallSession &&
this.currentCallSession.users.length > 0
) {
//视频是两个的时候
if (this.currentCallSession.users.length <= 2) {
setTimeout(() => {
this.systemInfoSync(this.currentCallSession.mine.userId, this.$refs.smallVideoView.ref,
true);
this.viewArr = this.currentCallSession.users.filter((item) => {
return item.userId !== this.currentCallSession.mine.userId;
});
this.viewArr.forEach((itm) => {
this.targetId = itm.userId;
this.systemInfoSync(itm.userId, this.$refs.bigVideoView.ref, false);
});
}, 100);
this.systemInfoSync(
this.currentCallSession.mine.userId,
this.$refs.smallVideoView.ref,
true
)
this.viewArr = this.currentCallSession.users.filter(
item => {
return (
item.userId !== this.currentCallSession.mine.userId
)
}
)
this.viewArr.forEach(itm => {
this.targetId = itm.userId
this.systemInfoSync(
itm.userId,
this.$refs.bigVideoView.ref,
false
)
})
}, 100)
} else {
// 视频超过三个
this.$nextTick(() => {
this.systemInfoSync(this.currentCallSession.mine.userId, this.$refs.bigVideoView.ref,
false);
this.viewArr = this.currentCallSession.users.filter((item) => {
return item.userId !== this.currentCallSession.mine.userId;
});
this.systemInfoSync(
this.currentCallSession.mine.userId,
this.$refs.bigVideoView.ref,
false
)
this.viewArr = this.currentCallSession.users.filter(
item => {
return (
item.userId !== this.currentCallSession.mine.userId
)
}
)
setTimeout(() => {
this.viewArr.forEach((itm) => {
this.systemInfoSync(itm.userId, this.$refs[itm.userId][0].ref,
false);
});
this.viewArr.forEach(itm => {
this.systemInfoSync(
itm.userId,
this.$refs[itm.userId][0].ref,
false
)
})
}, 100)
})
}
@@ -384,18 +400,18 @@
systemInfoSync(userId, ref, isZOrderOnTop) {
switch (uni.getSystemInfoSync().platform) {
case 'android':
call.setVideoView(userId, ref, 0, isZOrderOnTop);
break;
call.setVideoView(userId, ref, 0, isZOrderOnTop)
break
case 'ios':
call.setVideoView(userId, ref, 0);
break;
call.setVideoView(userId, ref, 0)
break
default:
console.log('运行在开发者工具上')
break;
break
}
},
onCallDisconnected() {
this.isMe = true;
this.isMe = true
if (!this.isSelf) {
uni.navigateBack({
delta: 1
@@ -403,103 +419,89 @@
}
},
switchChange() {
this.isChecked = !this.isChecked;
this.isChecked = !this.isChecked
if (!this.isChecked) {
this.reset();
this.reset()
} else {
this.setBeautyOption();
this.setBeautyOption()
}
},
//设置美颜
setBeautyOption() {
let option = {
whitenessLevel: this.whiteVal,
ruddyLevel: this.ruddyVal,
smoothLevel: this.buffingVal,
brightLevel: this.brightnessVal
}
if (this.isChecked) { //开启
console.log('设置美颜')
// RCBeautyEngine.setBeautyOptions(this.isChecked, option);
}
},
//切换滤镜
cutFilte(id) {
//切换滤镜打开美颜
if (!this.isChecked) {
this.isChecked = true;
}
let option = {
whitenessLevel: this.whiteVal,
ruddyLevel: this.ruddyVal,
smoothLevel: this.buffingVal,
brightLevel: this.brightnessVal
}
//打开滤镜
this.curFilte = id;
// this.isChecked ? RCBeautyEngine.setBeautyOptions(this.isChecked, option) : '';
// RCBeautyEngine.setBeautyFilter(this.curFilte);
},
//美白
whiteChange(e) {
console.log('美白', e.detail.value);
//打开美颜
if (!this.isChecked) {
this.isChecked = true;
}
this.whiteVal = e.detail.value;
this.setBeautyOption();
},
//红润
ruddyChange(e) {
console.log('红润', e.detail.value);
//打开美颜
if (!this.isChecked) {
this.isChecked = true;
}
this.ruddyVal = e.detail.value;
this.setBeautyOption();
},
//磨皮
buffingChange(e) {
console.log('磨皮', e.detail.value);
//打开美颜
if (!this.isChecked) {
this.isChecked = true;
}
this.buffingVal = e.detail.value;
this.setBeautyOption();
},
//亮度
brightnessChange(e) {
console.log('亮度', e.detail.value);
//打开美颜
if (!this.isChecked) {
this.isChecked = true;
}
this.brightnessVal = e.detail.value;
this.setBeautyOption();
},
//重置
reset() {
// RCBeautyEngine.resetBeauty();
// this.initBeautyOpton();
},
// initBeautyOpton() {
// //初始化滤镜
// this.curFilte = RCBeautyEngine.getCurrentBeautyFilter();
// //初始化美颜参数
// let beautyOption = RCBeautyEngine.getCurrentBeautyOptions();
// this.whiteVal = beautyOption.whitenessLevel;
// this.ruddyVal = beautyOption.ruddyLevel;
// this.buffingVal = beautyOption.smoothLevel;
// this.brightnessVal = beautyOption.brightLevel;
// }
}
}
}
</script>
<style scoped>
.nav-box {
position: fixed;
left: 0;
right: 0;
bottom: 0;
z-index: 99;
/* height: 220rpx; */
width: 750rpx;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-bottom: 60rpx;
}
.hangup-btn {
display: flex;
flex-direction: column;
align-items: center;
gap: 8rpx;
}
.hangup-icon {
width: 80rpx;
height: 80rpx;
background: #ff3b30 !important;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
}
.hangup-text {
font-size: 14rpx;
color: #fff;
font-weight: 500;
}
.btn-text {
font-size: 14rpx;
color: #fff;
}
.control-row {
display: flex;
justify-content: center;
gap: 40rpx;
/* width: 100%; */
flex-direction: row;
margin-bottom: 20rpx;
}
.icon-item {
display: flex;
flex-direction: column;
align-items: center;
gap: 8rpx;
margin: 10rpx;
}
.control-icon {
width: 80rpx;
height: 80rpx;
background: rgba(255, 255, 255, 0.3);
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10rpx;
}
.content {
flex: 1;
flex-direction: column;
@@ -539,12 +541,6 @@
justify-content: center;
}
.nav {
position: fixed;
bottom: 200upx;
right: 0;
}
.camera {
background: #ccc;
}
@@ -555,25 +551,13 @@
background: rgba(0, 0, 0, 0.5);
justify-content: center;
align-items: center;
}
.hangup {
width: 200upx;
height: 100upx;
color: #fff;
text-align: center;
line-height: 100upx;
background: red;
margin-right: 50upx;
border-radius: 50upx;
}
.box-mark {
position: fixed;
left: 0;
top: 0;
background: rgba(0, 0, 0, .5);
background: rgba(0, 0, 0, 0.5);
z-index: 9999;
justify-content: center;
align-items: center;
@@ -679,7 +663,6 @@
background: #ccc;
padding-left: 30upx;
padding-right: 30upx;
}
.beauty-tab {
@@ -693,7 +676,8 @@
padding-top: 40upx;
}
.filte-view {}
.filte-view {
}
.tab-item {
width: 100upx;
@@ -708,5 +692,6 @@
background: yellow;
}
.white-view {}
</style>
.white-view {
}
</style>