优化视频通话

This commit is contained in:
tangxinyue 2026-06-18 15:00:42 +08:00
parent 476acc7571
commit fe48026d19
10 changed files with 55 additions and 42 deletions

View File

@ -29,7 +29,7 @@ export function createApp() {
app.config.globalProperties.$system = plus.os.name; app.config.globalProperties.$system = plus.os.name;
// #endif // #endif
app.config.globalProperties.$systemInfo = systemInfo app.config.globalProperties.$systemInfo = systemInfo
uni.setStorageSync('version', '1.0.6.sp13') uni.setStorageSync('version', '1.0.6.sp15')
app.config.globalProperties.$version = uni.getStorageSync('version') app.config.globalProperties.$version = uni.getStorageSync('version')
app.use(globalMethods); app.use(globalMethods);
return { return {

View File

@ -1,4 +1,6 @@
<template> <template>
<view class="shadow-up"></view>
<view class="shadow-down"></view>
<!-- 水印 --> <!-- 水印 -->
<view v-if="$isVip()"> <view v-if="$isVip()">
<watermark dark="light" source="uni_alipay_other_videoChat" /> <watermark dark="light" source="uni_alipay_other_videoChat" />
@ -22,8 +24,8 @@
</view> </view>
<view class="top-view"> <view class="top-view">
<image style="height: 136rpx;width:136rpx;object-fit: cover;" :src="videoData.chat.other.avatar" <image style="height: 136rpx;width:136rpx;object-fit: cover;border-radius: 12rpx;"
mode="aspectFill"> :src="videoData.chat.other.avatar" mode="aspectFill">
</image> </image>
<text class="nickname">{{ videoData.chat.other.name }}</text> <text class="nickname">{{ videoData.chat.other.name }}</text>
<view class="dot-view"> <view class="dot-view">
@ -72,35 +74,27 @@
<!-- 麦克风 --> <!-- 麦克风 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')" <image class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')"
:src="videoData.micOn ? '/static/image/other/video-call/mic-on.png' : '/static/image/other/video-call/mic-off.png'"> :src="videoData.micOn ? '/static/image/other/video-call/mic-on.png' : '/static/image/other/video-call/unMic.png'">
</image> </image>
<!-- <view class="" :class="{ active: videoData.micOn }" >
</view> -->
<text class="control-label">{{ videoData.micOn ? '麦克风已开' : '麦克风已关' }}</text> <text class="control-label">{{ videoData.micOn ? '麦克风已开' : '麦克风已关' }}</text>
</view> </view>
<!-- 摄像头 --> <!-- 摄像头 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')" <image class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')"
:src="videoData.cameraOn ? '/static/image/other/video-call/camera-on.png' : '/static/image/other/video-call/camera-off.png'"> :src="videoData.cameraOn ? '/static/image/other/video-call/camera-on.png' : '/static/image/other/video-call/unCamera.png'">
</image> </image>
<!-- <view class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')">
</view> -->
<text class="control-label">{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }}</text> <text class="control-label">{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }}</text>
</view> </view>
<!-- 背景模糊 --> <!-- 背景模糊 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" style="background: #00000080;" <image class="control-btn" src="/static/image/other/video-call/xvnibeijing.png">
src="/static/image/other/video-call/xvnibeijing.png">
</image> </image>
<text class="control-label">背景模糊</text> <text class="control-label">背景模糊</text>
</view> </view>
<!-- 旋转摄像头 --> <!-- 旋转摄像头 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" style="background: #00000080;" <image class="control-btn" src="/static/image/other/video-call/xuanzhuan.png">
src="/static/image/other/video-call/xuanzhuan.png">
</image> </image>
<text class="control-label">翻转</text> <text class="control-label">翻转</text>
</view> </view>
@ -112,8 +106,8 @@
src="/static/image/other/video-call/hangup.png"> src="/static/image/other/video-call/hangup.png">
</image> </image>
<image class="hangup-btn" style="margin: 0; background: #00000080;" <image class="hangup-btn" style="margin: 0;" src="/static/image/other/video-call/jieting.png"
src="/static/image/other/video-call/jieting.png" @click="answerCall"> @click="answerCall">
</image> </image>
</view> </view>
</view> </view>
@ -224,7 +218,7 @@
<!-- 麦克风 --> <!-- 麦克风 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')" <image class="control-btn" :class="{ active: videoData.micOn }" @click="changeInfo('micOn')"
:src="videoData.micOn ? '/static/image/other/video-call/mic-on.png' : '/static/image/other/video-call/mic-off.png'"> :src="videoData.micOn ? '/static/image/other/video-call/mic-on.png' : '/static/image/other/video-call/unMic.png'">
</image> </image>
<!-- <view class="" :class="{ active: videoData.micOn }" > <!-- <view class="" :class="{ active: videoData.micOn }" >
@ -235,35 +229,27 @@
<!-- 扬声器 --> <!-- 扬声器 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')" <image class="control-btn" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')"
:src="videoData.speakerOn ? '/static/image/other/video-call/speaker-on.png' : '/static/image/other/video-call/speaker-off.png'"> :src="videoData.speakerOn ? '/static/image/other/video-call/speaker-on.png' : '/static/image/other/video-call/unSpeaker.png'">
</image> </image>
<!-- <view class="" :class="{ active: videoData.speakerOn }" @click="changeInfo('speakerOn')">
</view> -->
<text class="control-label">{{ videoData.speakerOn ? '扬声器已开' : '扬声器已关' }}</text> <text class="control-label">{{ videoData.speakerOn ? '扬声器已开' : '扬声器已关' }}</text>
</view> </view>
<!-- 摄像头 --> <!-- 摄像头 -->
<view class="control-item"> <view class="control-item">
<image class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')" <image class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')"
:src="videoData.cameraOn ? '/static/image/other/video-call/camera-on.png' : '/static/image/other/video-call/camera-off.png'"> :src="videoData.cameraOn ? '/static/image/other/video-call/camera-on.png' : '/static/image/other/video-call/unCamera.png'">
</image> </image>
<!-- <view class="control-btn" :class="{ active: videoData.cameraOn }" @click="changeInfo('cameraOn')">
</view> -->
<text class="control-label">{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }}</text> <text class="control-label">{{ videoData.cameraOn ? '摄像头已开' : '摄像头已关' }}</text>
</view> </view>
</view> </view>
<view class="control-buttons" style="margin-bottom: 0;"> <view class="control-buttons" style="margin-bottom: 0;">
<image class="hangup-btn" style="background: #00000080;" <image class="hangup-btn" src="/static/image/other/video-call/xvnibeijing.png">
src="/static/image/other/video-call/xvnibeijing.png">
</image> </image>
<!-- 挂断按钮 --> <!-- 挂断按钮 -->
<image class="hangup-btn" @click="hangup" src="/static/image/other/video-call/hangup.png"></image> <image class="hangup-btn" @click="hangup" src="/static/image/other/video-call/hangup.png"></image>
<image class="hangup-btn" style="background: #00000080;" <image class="hangup-btn" src="/static/image/other/video-call/xuanzhuan.png">
src="/static/image/other/video-call/xuanzhuan.png">
</image> </image>
</view> </view>
</view> </view>
@ -333,7 +319,7 @@
<view style="display: flex; align-items: center; justify-content: space-between;"> <view style="display: flex; align-items: center; justify-content: space-between;">
<text <text
style="font-size: 24rpx; color: #999; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 20rpx;">{{ style="font-size: 24rpx; color: #999; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 20rpx;">{{
videoData.chat.me.videoUrl }}</text> getFileName(videoData.chat.me.videoUrl) }}</text>
<button size="mini" style="margin: 0; background: #187AFF; color: #fff;" <button size="mini" style="margin: 0; background: #187AFF; color: #fff;"
@click="uploadMedia('me', 'video')">上传</button> @click="uploadMedia('me', 'video')">上传</button>
</view> </view>
@ -344,7 +330,7 @@
<view style="display: flex; align-items: center; justify-content: space-between;"> <view style="display: flex; align-items: center; justify-content: space-between;">
<text <text
style="font-size: 24rpx; color: #999; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 20rpx;">{{ style="font-size: 24rpx; color: #999; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 20rpx;">{{
videoData.chat.other.videoUrl }}</text> getFileName(videoData.chat.other.videoUrl) }}</text>
<button size="mini" style="margin: 0; background: #187AFF; color: #fff;" <button size="mini" style="margin: 0; background: #187AFF; color: #fff;"
@click="uploadMedia('other', 'video')">上传</button> @click="uploadMedia('other', 'video')">上传</button>
</view> </view>
@ -404,6 +390,13 @@ const getVideoUrl = (url) => {
return url return url
} }
//
const getFileName = (path) => {
if (!path) return ''
//
return path.split('/').pop().split('\\').pop()
}
const buttonGroup = computed(() => [ const buttonGroup = computed(() => [
{ {
name: "编辑时间", name: "编辑时间",
@ -1390,7 +1383,6 @@ const stopTimer = () => {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
background-color: #4a4a4a;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
@ -1604,6 +1596,7 @@ const stopTimer = () => {
width: 92rpx; width: 92rpx;
height: 92rpx; height: 92rpx;
position: absolute; position: absolute;
border-radius: 12rpx;
top: 50%; top: 50%;
left: 50%; left: 50%;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
@ -1673,4 +1666,26 @@ const stopTimer = () => {
height: 410rpx; height: 410rpx;
border-radius: 20rpx; border-radius: 20rpx;
} }
.shadow-up {
position: fixed;
top: 0;
left: 0;
width: 750rpx;
height: 240rpx;
background: linear-gradient(180deg, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
z-index: 2;
}
.shadow-down {
position: fixed;
bottom: 0;
left: 0;
width: 750rpx;
height: 240rpx;
background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.5) 100%);
border-radius: 0rpx 0rpx 0rpx 0rpx;
z-index: 2;
}
</style> </style>

View File

@ -1027,7 +1027,6 @@ const stopTimer = () => {
width: 120rpx; width: 120rpx;
height: 120rpx; height: 120rpx;
border-radius: 50%; border-radius: 50%;
background-color: #4a4a4a;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: center; justify-content: center;

View File

@ -9,7 +9,7 @@
</template> </template>
</nav-bar> </nav-bar>
<view class="content-box flex-column flex-cneter" @click="editPaymentInfo"> <view class="content-box flex-column flex-cneter" @click="editPaymentInfo">
<image v-if="paymetInfo.userImg" class="user-img" :src="paymetInfo.userImg"></image> <image v-if="paymetInfo.userImg" class="user-img" :src="paymetInfo.userImg" mode="aspectFill"></image>
<text class="product-name">{{ paymetInfo.productName }}</text> <text class="product-name">{{ paymetInfo.productName }}</text>
<view class="money flex wx-font-medium" :style="{ 'margin-top': paymetInfo.userImg ? '78rpx' : '46rpx' }"> <view class="money flex wx-font-medium" :style="{ 'margin-top': paymetInfo.userImg ? '78rpx' : '46rpx' }">
<image class="symbol" src="/static/image/other/payment-success/symbol-yuan.png"></image>{{ <image class="symbol" src="/static/image/other/payment-success/symbol-yuan.png"></image>{{
@ -140,13 +140,6 @@ const paymetInfo = ref({
}); });
onShow(() => { onShow(() => {
const cachedInfo = storage.get('wx_payment_success_info');
if (cachedInfo) {
paymetInfo.value = cachedInfo;
} else {
paymetInfo.value = { productName: '王者荣耀', money: 168 };
}
// #ifdef APP-PLUS&&!APP-HARMONY // #ifdef APP-PLUS&&!APP-HARMONY
util.setAndroidSystemBarColor('#FFFFFF') util.setAndroidSystemBarColor('#FFFFFF')
setTimeout(() => { setTimeout(() => {
@ -156,6 +149,12 @@ onShow(() => {
}) })
onLoad(async () => { onLoad(async () => {
const cachedInfo = storage.get('wx_payment_success_info');
if (cachedInfo) {
paymetInfo.value = cachedInfo;
} else {
paymetInfo.value = { productName: '王者荣耀', money: 168 };
}
// //
proxy.$apiUserEvent('all', { proxy.$apiUserEvent('all', {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.2 KiB

After

Width:  |  Height:  |  Size: 871 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

After

Width:  |  Height:  |  Size: 4.4 KiB