测试我的git提交

This commit is contained in:
田岩
2025-12-12 20:11:48 +08:00
parent 6f674a4df6
commit d740d679f3
2 changed files with 38 additions and 1 deletions
-1
View File
@@ -212,7 +212,6 @@
dataInfo.chaId = e.chaId ?? '';
dataInfo.traType = '02'; // 陪练类型 01-练习 02-考试
dataInfo.traInterTyp = e.traInterTyp ?? '02'; // 陪练交互类型 01 对话 02 语音 03 视频
// dataInfo.traInterType = '02'; // 陪练交互类型 01 对话 02 语音 03 视频
//#ifdef APP-PLUS
// 只有app才能打开摄像头
isVideo.value = dataInfo.traInterTyp === '03';
+38
View File
@@ -0,0 +1,38 @@
<template>
<view class="">
<view class="cssss">
<CameraPreview ref="CameraPreviewRef"></CameraPreview>
</view>
<view style="margin-top: 400rpx">
<button class="btn" @click="startPreview">开启摄像头预览</button>
<button class="btn" @click="stopPreview">关闭摄像头预览</button>
<button class="btn" @click="switchCamera">切换摄像头</button>
</view>
</view>
</template>
<script setup>
import CameraPreview from './CameraPreview';
import { onReady } from '@dcloudio/uni-app';
import { ref, getCurrentInstance } from 'vue';
const CameraPreviewRef = ref(null);
const instance = getCurrentInstance();
const componentProxy = instance.ctx;
const startPreview = () => {
CameraPreviewRef.value.startPreview();
};
const stopPreview = () => {
CameraPreviewRef.value.stopPreview();
};
const switchCamera = () => {
CameraPreviewRef.value.switchCamera();
};
onReady(() => {
CameraPreviewRef.value.init(componentProxy);
});
</script>
<style>
</style>