|
@@ -21,7 +21,7 @@
|
|
|
</div>
|
|
|
</el-scrollbar>
|
|
|
<Empty v-else />
|
|
|
- <el-button @click.stop="keepScroll" class="keep-scroll" title="回到底部" circle v-if="!isScrollBottom">
|
|
|
+ <el-button @click.stop="keepScroll" class="keep-scroll" title="回到底部" circle v-if="!isScrollBottom && !talkEnd">
|
|
|
<SvgIcon name="ele-ArrowDown" size="18px" />
|
|
|
</el-button>
|
|
|
<!-- 识别内容 通话结束才展示-->
|
|
@@ -105,14 +105,13 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</template>
|
|
|
-<script setup lang="ts">
|
|
|
-import { nextTick, onMounted, ref, watch } from 'vue';
|
|
|
+<script setup lang="ts" name="orderAcceptVoiceAssistant">
|
|
|
+import { nextTick, onActivated, onBeforeMount, onBeforeUnmount, onDeactivated, onMounted, onUnmounted, ref, watch } from 'vue';
|
|
|
import { ElMessageBox } from 'element-plus';
|
|
|
import { getImageUrl } from '@/utils/tools';
|
|
|
import axios from 'axios';
|
|
|
import { useRoute } from 'vue-router';
|
|
|
import { formatDate } from '@/utils/formatTime';
|
|
|
-import Empty from '@/components/Empty/index.vue';
|
|
|
const emit = defineEmits(['orderOverwrite']);
|
|
|
import mittBus from '@/utils/mitt';
|
|
|
// 消息列表
|
|
@@ -149,11 +148,15 @@ const recognizeList = ref<EmptyObjectType>({}); // 识别信息
|
|
|
onMounted(() => {
|
|
|
// 接受消息
|
|
|
mittBus.on('wsReceive', (message: any) => {
|
|
|
+ const data = JSON.parse(message.data);
|
|
|
+ console.log('wsReceive', data, route);
|
|
|
+
|
|
|
wsReceive(message);
|
|
|
});
|
|
|
});
|
|
|
const route = useRoute();
|
|
|
const talkEnd = ref(false); // 通话结束
|
|
|
+// data.body.content.callId === route.params.callId
|
|
|
const wsReceive = (message: any) => {
|
|
|
try {
|
|
|
const data = JSON.parse(message.data);
|
|
@@ -227,7 +230,8 @@ const scrollToBottom = async () => {
|
|
|
scrollbarRef.value?.setScrollTop(max);
|
|
|
isAutoScroll.value = true;
|
|
|
};
|
|
|
-watch(messageList.value, () => {
|
|
|
+watch(messageList.value, (val) => {
|
|
|
+ console.log('messageList', val);
|
|
|
scrollToBottom();
|
|
|
});
|
|
|
// 继续滚动
|
|
@@ -274,6 +278,13 @@ watch(
|
|
|
});
|
|
|
}
|
|
|
);
|
|
|
+onDeactivated(() => {
|
|
|
+ console.log('缓存离开');
|
|
|
+ mittBus.off('wsReceive');
|
|
|
+});
|
|
|
+onActivated(() => {
|
|
|
+ console.log('缓存进入');
|
|
|
+});
|
|
|
</script>
|
|
|
|
|
|
<style scoped lang="scss">
|