JLBA202505130001_关于吉林银行新建AI智能培训系统的需求_修改消息通知一件读取后红点不消失
This commit is contained in:
@@ -5,5 +5,7 @@ npm 淘宝源下载 :npm config set registry https://registry.npmmirror.com
|
||||
npm config set registry http://25.12.10.69:8081/repository/aliyun-npm/
|
||||
|
||||
|
||||
npm install @dcloudio/uni-uts-v1 http://25.12.10.69:8081/repository/npm/
|
||||
|
||||
npm install --registry=https://registry.npmmirror.com
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@
|
||||
oneTimeRead()
|
||||
.then((res) => {
|
||||
data_list.value.forEach((item) => {
|
||||
item.isRead = '02';
|
||||
item.isMsg = 'N';
|
||||
});
|
||||
common.hideLoading();
|
||||
setTimeout(() => {
|
||||
|
||||
+26
-19
@@ -19,11 +19,11 @@
|
||||
{{ dataInfo.sceneDesc }}
|
||||
</view>
|
||||
<view class="close-btn" @click="closeTalking"></view>
|
||||
<canvas canvas-id="firstCanvas" style="width: 176px; height: 144px;"></canvas>
|
||||
<!-- <canvas canvas-id="firstCanvas" style="width: 176px; height: 144px;"></canvas> -->
|
||||
</view>
|
||||
<talk-microphone ref="talkMicrophoneRef" @noPermission="microphoneNoPermission"></talk-microphone>
|
||||
<talk-speaker ref="talkSpeakerRef" @playOver="playOver"></talk-speaker>
|
||||
<!-- <talk-camera ref="talkCameraRef" v-if="isVideo"></talk-camera> -->
|
||||
<talk-camera ref="talkCameraRef" v-if="isVideo"></talk-camera>
|
||||
</view>
|
||||
</template>
|
||||
<script setup>
|
||||
@@ -43,7 +43,7 @@
|
||||
const { initConnection, close, send, isRecording } = useWebSocket();
|
||||
const isVideo = ref(false);
|
||||
const isVideoStyle = computed(() => dataInfo.traInterTyp === '03');
|
||||
const context = uni.createCanvasContext('firstCanvas');
|
||||
// const context = uni.createCanvasContext('firstCanvas');
|
||||
const dataInfo = reactive({
|
||||
traId: '',
|
||||
chaId: '',
|
||||
@@ -71,7 +71,7 @@
|
||||
});
|
||||
};
|
||||
const test = () => {
|
||||
// isVideo.value && talkCameraRef.value.switchCamera();
|
||||
isVideo.value && talkCameraRef.value.switchCamera();
|
||||
};
|
||||
const clearAutomaticEndTimeTimer = () => {
|
||||
if (automaticEndTimeTimer){
|
||||
@@ -83,7 +83,7 @@
|
||||
const destroy = (type = 0) => {
|
||||
clearAutomaticEndTimeTimer()
|
||||
if (type <= 0) {
|
||||
// isVideo.value && talkCameraRef.value.stopPreview();
|
||||
isVideo.value && talkCameraRef.value.stopPreview();
|
||||
talkMicrophoneRef.value.stop();
|
||||
talkSpeakerRef.value.close();
|
||||
}
|
||||
@@ -165,11 +165,12 @@
|
||||
// 当ws连接成功时候
|
||||
console.log('连接成功开始' + dataInfo.traInterTypDesc);
|
||||
isRecording.value = true;
|
||||
// isVideo.value && talkCameraRef.value.startPreview();
|
||||
isVideo.value && talkCameraRef.value.startPreview();
|
||||
if (timer) clearInterval(timer); // 清除旧的定时器,避免多个定时器叠加
|
||||
timer = setInterval(updateRemaining, 400);
|
||||
// 立即执行一次
|
||||
updateRemaining();
|
||||
startAutomaticEndTimeTimer()
|
||||
talkMicrophoneRef.value.start({
|
||||
sampleRate: 16000,
|
||||
frameSize: 1024,
|
||||
@@ -188,13 +189,19 @@
|
||||
lock: id
|
||||
})
|
||||
);
|
||||
// 打开一个计时器,时间到了就中断
|
||||
automaticEndTimeTimer = setTimeout(() => {
|
||||
destroy();
|
||||
}, automaticEndTime);
|
||||
startAutomaticEndTimeTimer()
|
||||
}, 300);
|
||||
}
|
||||
};
|
||||
|
||||
// 启动没人说话定时器
|
||||
const startAutomaticEndTimeTimer = () => {
|
||||
// 打开一个计时器,时间到了就中断
|
||||
|
||||
automaticEndTimeTimer = setTimeout(() => {
|
||||
destroy();
|
||||
}, automaticEndTime);
|
||||
}
|
||||
const onError = (error) => {
|
||||
// websocket错误处理
|
||||
console.log('websocket错误处理', error.code);
|
||||
@@ -270,16 +277,16 @@
|
||||
onReady(() => {
|
||||
if (isVideo.value) {
|
||||
// const context = uni.createCanvasContext('firstCanvas');
|
||||
startCameraPreview((base64) => {
|
||||
context.drawImage(base64, 0, 0, 176, 144);
|
||||
context.draw(true);
|
||||
})
|
||||
// startCameraPreview((base64) => {
|
||||
// context.drawImage(base64, 0, 0, 176, 144);
|
||||
// context.draw(true);
|
||||
// })
|
||||
|
||||
// const instance = getCurrentInstance();
|
||||
// const componentProxy = instance.ctx;
|
||||
// nextTick(() => {
|
||||
// talkCameraRef.value.init(componentProxy);
|
||||
// });
|
||||
const instance = getCurrentInstance();
|
||||
const componentProxy = instance.ctx;
|
||||
nextTick(() => {
|
||||
talkCameraRef.value.init(componentProxy);
|
||||
});
|
||||
}
|
||||
});
|
||||
onUnmounted(() => {
|
||||
|
||||
Reference in New Issue
Block a user