|
|
@@ -2,18 +2,15 @@
|
|
|
import { h } from 'vue';
|
|
|
import { tryOnBeforeMount } from '@vueuse/core';
|
|
|
|
|
|
-import { CloseOutlined } from '@ant-design/icons-vue';
|
|
|
-import { Welcome, type WelcomeProps } from 'ant-design-x-vue';
|
|
|
import type { NavBarProps } from 'vant';
|
|
|
|
|
|
import { useRequest } from 'alova/client';
|
|
|
import { guideChatMethod, guideRecordSavaMethod, guideRegisterSessionMethod } from '@/request/api';
|
|
|
import { getGuideRoleLabel, useGuideStore } from '@/stores';
|
|
|
-import { getBackReferrerUrl, getClientURL, getURLSearchParams, isWechat } from '@/tools';
|
|
|
+import { getBackReferrerUrl, getURLSearchParams, isWechat } from '@/tools';
|
|
|
|
|
|
import { useMessages } from '@/modules/chat/composables';
|
|
|
|
|
|
-import RobotUrl from '@/assets/images/chat-robot.png?url';
|
|
|
import ChartMessages from '@/modules/chat/components/Messages.vue';
|
|
|
import AnalysisHealthSender from '@/modules/chat/renderer/AnalysisHealthSender.vue';
|
|
|
import BasicInfoSender from '@/modules/chat/renderer/BasicInfoSender.vue';
|
|
|
@@ -26,16 +23,6 @@ const navProps = reactive<Partial<NavBarProps> & { show: boolean }>({
|
|
|
show: false,
|
|
|
title: route.meta.title,
|
|
|
});
|
|
|
-const welcomeProps = reactive<WelcomeProps & { show?: boolean }>({
|
|
|
- show: true,
|
|
|
- icon: getClientURL(RobotUrl),
|
|
|
- title: `你好,我是智能导诊机器人`,
|
|
|
- description: `我可以帮您推荐合适的医生`,
|
|
|
- style: {
|
|
|
- backgroundImage: 'linear-gradient(97deg, rgba(90,196,255,0.12) 0%, rgba(174,136,255,0.12) 100%)',
|
|
|
- borderStartStartRadius: 4,
|
|
|
- },
|
|
|
-});
|
|
|
|
|
|
tryOnBeforeMount(() => {
|
|
|
const searchParams = getURLSearchParams();
|
|
|
@@ -81,7 +68,7 @@ const { append, messages } = useMessages(Guide.messages, {
|
|
|
const sendBasicInfoMessage = () => {
|
|
|
const message = {
|
|
|
role: 'chat',
|
|
|
- content: `请问您是为自己还是为他人咨询?`,
|
|
|
+ content: `你好,我是智能导诊机器人,我可以帮您推荐合适的医生,请问您是为自己还是为他人咨询?`,
|
|
|
sender: {
|
|
|
template: '#BasicInfoSender',
|
|
|
props: {
|
|
|
@@ -139,15 +126,7 @@ const { send: register } = useRequest(guideRegisterSessionMethod, { immediate: f
|
|
|
<template>
|
|
|
<chart-messages class="hospital-guide-wrapper" ref="chat-messages">
|
|
|
<template #chat-header>
|
|
|
- <van-nav-bar v-if="navProps.show" v-bind="navProps" @click-left="back()" />
|
|
|
- <Welcome class="welcome-container" v-if="welcomeProps.show" v-bind="welcomeProps">
|
|
|
- <template #extra>
|
|
|
- <a-space>
|
|
|
- <a-button type="text" :icon="h(CloseOutlined)" @click="welcomeProps.show = false"></a-button>
|
|
|
- </a-space>
|
|
|
- </template>
|
|
|
- </Welcome>
|
|
|
- <van-nav-bar v-else-if="!navProps.show" v-bind="navProps" @click-left="back()" />
|
|
|
+ <van-nav-bar v-bind="navProps" @click-left="back()" />
|
|
|
</template>
|
|
|
</chart-messages>
|
|
|
</template>
|