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 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
|
npm install --registry=https://registry.npmmirror.com
|
||||||
|
|
||||||
|
|||||||
@@ -99,7 +99,7 @@
|
|||||||
oneTimeRead()
|
oneTimeRead()
|
||||||
.then((res) => {
|
.then((res) => {
|
||||||
data_list.value.forEach((item) => {
|
data_list.value.forEach((item) => {
|
||||||
item.isRead = '02';
|
item.isMsg = 'N';
|
||||||
});
|
});
|
||||||
common.hideLoading();
|
common.hideLoading();
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
|
|||||||
+26
-19
@@ -19,11 +19,11 @@
|
|||||||
{{ dataInfo.sceneDesc }}
|
{{ dataInfo.sceneDesc }}
|
||||||
</view>
|
</view>
|
||||||
<view class="close-btn" @click="closeTalking"></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>
|
</view>
|
||||||
<talk-microphone ref="talkMicrophoneRef" @noPermission="microphoneNoPermission"></talk-microphone>
|
<talk-microphone ref="talkMicrophoneRef" @noPermission="microphoneNoPermission"></talk-microphone>
|
||||||
<talk-speaker ref="talkSpeakerRef" @playOver="playOver"></talk-speaker>
|
<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>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
const { initConnection, close, send, isRecording } = useWebSocket();
|
const { initConnection, close, send, isRecording } = useWebSocket();
|
||||||
const isVideo = ref(false);
|
const isVideo = ref(false);
|
||||||
const isVideoStyle = computed(() => dataInfo.traInterTyp === '03');
|
const isVideoStyle = computed(() => dataInfo.traInterTyp === '03');
|
||||||
const context = uni.createCanvasContext('firstCanvas');
|
// const context = uni.createCanvasContext('firstCanvas');
|
||||||
const dataInfo = reactive({
|
const dataInfo = reactive({
|
||||||
traId: '',
|
traId: '',
|
||||||
chaId: '',
|
chaId: '',
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
});
|
});
|
||||||
};
|
};
|
||||||
const test = () => {
|
const test = () => {
|
||||||
// isVideo.value && talkCameraRef.value.switchCamera();
|
isVideo.value && talkCameraRef.value.switchCamera();
|
||||||
};
|
};
|
||||||
const clearAutomaticEndTimeTimer = () => {
|
const clearAutomaticEndTimeTimer = () => {
|
||||||
if (automaticEndTimeTimer){
|
if (automaticEndTimeTimer){
|
||||||
@@ -83,7 +83,7 @@
|
|||||||
const destroy = (type = 0) => {
|
const destroy = (type = 0) => {
|
||||||
clearAutomaticEndTimeTimer()
|
clearAutomaticEndTimeTimer()
|
||||||
if (type <= 0) {
|
if (type <= 0) {
|
||||||
// isVideo.value && talkCameraRef.value.stopPreview();
|
isVideo.value && talkCameraRef.value.stopPreview();
|
||||||
talkMicrophoneRef.value.stop();
|
talkMicrophoneRef.value.stop();
|
||||||
talkSpeakerRef.value.close();
|
talkSpeakerRef.value.close();
|
||||||
}
|
}
|
||||||
@@ -165,11 +165,12 @@
|
|||||||
// 当ws连接成功时候
|
// 当ws连接成功时候
|
||||||
console.log('连接成功开始' + dataInfo.traInterTypDesc);
|
console.log('连接成功开始' + dataInfo.traInterTypDesc);
|
||||||
isRecording.value = true;
|
isRecording.value = true;
|
||||||
// isVideo.value && talkCameraRef.value.startPreview();
|
isVideo.value && talkCameraRef.value.startPreview();
|
||||||
if (timer) clearInterval(timer); // 清除旧的定时器,避免多个定时器叠加
|
if (timer) clearInterval(timer); // 清除旧的定时器,避免多个定时器叠加
|
||||||
timer = setInterval(updateRemaining, 400);
|
timer = setInterval(updateRemaining, 400);
|
||||||
// 立即执行一次
|
// 立即执行一次
|
||||||
updateRemaining();
|
updateRemaining();
|
||||||
|
startAutomaticEndTimeTimer()
|
||||||
talkMicrophoneRef.value.start({
|
talkMicrophoneRef.value.start({
|
||||||
sampleRate: 16000,
|
sampleRate: 16000,
|
||||||
frameSize: 1024,
|
frameSize: 1024,
|
||||||
@@ -188,13 +189,19 @@
|
|||||||
lock: id
|
lock: id
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
// 打开一个计时器,时间到了就中断
|
startAutomaticEndTimeTimer()
|
||||||
automaticEndTimeTimer = setTimeout(() => {
|
|
||||||
destroy();
|
|
||||||
}, automaticEndTime);
|
|
||||||
}, 300);
|
}, 300);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// 启动没人说话定时器
|
||||||
|
const startAutomaticEndTimeTimer = () => {
|
||||||
|
// 打开一个计时器,时间到了就中断
|
||||||
|
|
||||||
|
automaticEndTimeTimer = setTimeout(() => {
|
||||||
|
destroy();
|
||||||
|
}, automaticEndTime);
|
||||||
|
}
|
||||||
const onError = (error) => {
|
const onError = (error) => {
|
||||||
// websocket错误处理
|
// websocket错误处理
|
||||||
console.log('websocket错误处理', error.code);
|
console.log('websocket错误处理', error.code);
|
||||||
@@ -270,16 +277,16 @@
|
|||||||
onReady(() => {
|
onReady(() => {
|
||||||
if (isVideo.value) {
|
if (isVideo.value) {
|
||||||
// const context = uni.createCanvasContext('firstCanvas');
|
// const context = uni.createCanvasContext('firstCanvas');
|
||||||
startCameraPreview((base64) => {
|
// startCameraPreview((base64) => {
|
||||||
context.drawImage(base64, 0, 0, 176, 144);
|
// context.drawImage(base64, 0, 0, 176, 144);
|
||||||
context.draw(true);
|
// context.draw(true);
|
||||||
})
|
// })
|
||||||
|
|
||||||
// const instance = getCurrentInstance();
|
const instance = getCurrentInstance();
|
||||||
// const componentProxy = instance.ctx;
|
const componentProxy = instance.ctx;
|
||||||
// nextTick(() => {
|
nextTick(() => {
|
||||||
// talkCameraRef.value.init(componentProxy);
|
talkCameraRef.value.init(componentProxy);
|
||||||
// });
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
onUnmounted(() => {
|
onUnmounted(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user