2025-06-30 16:09:43 +08:00
|
|
|
|
<template>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<view class="home-container">
|
|
|
|
|
<view class="header">
|
|
|
|
|
<div class="header-left">
|
|
|
|
|
<u-icon
|
|
|
|
|
class="header-left-icon"
|
|
|
|
|
name="list"
|
|
|
|
|
@click="handleLeftClick"
|
|
|
|
|
></u-icon>
|
|
|
|
|
</div>
|
|
|
|
|
<text class="header-title">源小新</text>
|
2025-07-04 15:30:23 +08:00
|
|
|
|
<div class="header-right"></div>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 首页 -->
|
|
|
|
|
<view class="content" v-if="!isChat">
|
|
|
|
|
<view class="welcome-message">
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="avatar"
|
|
|
|
|
src="/static/common/images/images_logo.png"
|
|
|
|
|
></image>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
<text class="message-text"
|
2025-07-10 10:48:28 +08:00
|
|
|
|
>Hi~
|
|
|
|
|
我是源小新,你们的AI校园助手,非常高兴认识您,我可以为你答疑解惑。</text
|
2025-07-02 17:07:33 +08:00
|
|
|
|
>
|
|
|
|
|
</view>
|
|
|
|
|
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<!-- <view class="qa-section">
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<view class="qa-header">
|
|
|
|
|
<text class="qa-title">大家都在问</text>
|
|
|
|
|
<view class="more-link">
|
|
|
|
|
<text class="more-text">换一批</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="qa-list">
|
|
|
|
|
<view
|
|
|
|
|
class="qa-item"
|
|
|
|
|
v-for="(item, index) in questionList"
|
|
|
|
|
:key="index"
|
|
|
|
|
>
|
|
|
|
|
<text class="qa-question">{{ item }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<button class="chat-button" @click="isChat = true">
|
|
|
|
|
<image
|
|
|
|
|
class="chat-icon"
|
2025-07-04 13:35:43 +08:00
|
|
|
|
src="/static/common/images/icon_chat.png"
|
|
|
|
|
></image>
|
|
|
|
|
<text class="chat-text">开启对话</text>
|
|
|
|
|
</button>
|
|
|
|
|
</view> -->
|
|
|
|
|
|
|
|
|
|
<view class="start-chat">
|
|
|
|
|
<button class="chat-button" @click="isChat = true">
|
|
|
|
|
<image
|
|
|
|
|
class="chat-icon"
|
|
|
|
|
src="/static/common/images/icon_chat.png"
|
2025-07-02 17:07:33 +08:00
|
|
|
|
></image>
|
|
|
|
|
<text class="chat-text">开启对话</text>
|
|
|
|
|
</button>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<view class="feature-grid">
|
|
|
|
|
<view
|
|
|
|
|
class="feature-item"
|
|
|
|
|
v-for="(item, index) in features"
|
|
|
|
|
:key="index"
|
2025-07-04 13:35:43 +08:00
|
|
|
|
@click="handleFeatureClick(item)"
|
2025-07-02 17:07:33 +08:00
|
|
|
|
>
|
|
|
|
|
<image :src="item.icon" class="feature-icon"></image>
|
|
|
|
|
<text class="feature-text">{{ item.title }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 对话 -->
|
|
|
|
|
<view class="chat-container" v-if="isChat">
|
|
|
|
|
<scroll-view
|
|
|
|
|
class="chat-scroll"
|
|
|
|
|
scroll-y
|
|
|
|
|
:scroll-into-view="scrollToView"
|
|
|
|
|
scroll-with-animation
|
|
|
|
|
:scroll-top="scrollTop"
|
|
|
|
|
:show-scrollbar="true"
|
|
|
|
|
@scrolltoupper="loadMoreMessages"
|
|
|
|
|
@scroll="onScroll"
|
|
|
|
|
>
|
|
|
|
|
<!-- 头部卡片 -->
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<!-- 后端让先注释 -->
|
|
|
|
|
<!-- <view class="chat-card">
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<view class="chat-card-title">源小新AI校园小助手</view>
|
|
|
|
|
<view class="chat-card-desc"
|
|
|
|
|
>我是你们的AI校园助手,我可以为您答疑解惑。</view
|
|
|
|
|
>
|
|
|
|
|
<view class="chat-card-questions">
|
|
|
|
|
<view class="question-item">学校哪些专业比较好?</view>
|
|
|
|
|
<view class="question-item">如何报考学校综合素质评价招生?</view>
|
|
|
|
|
<view class="question-item">学校有那些专业?</view>
|
|
|
|
|
<view class="question-item"
|
|
|
|
|
>学校在录取时有没有一些专业会有特殊...</view
|
|
|
|
|
>
|
|
|
|
|
<view class="question-item">我什么时候能够知道自己是否被录取?</view>
|
|
|
|
|
</view>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
</view> -->
|
2025-07-04 15:26:46 +08:00
|
|
|
|
<view class="chat-card">
|
|
|
|
|
<view class="chat-card-title">源小新AI校园小助手</view>
|
|
|
|
|
<view class="chat-card-desc"
|
|
|
|
|
>我是你们的AI校园助手,我可以为你答疑解惑。</view
|
|
|
|
|
>
|
|
|
|
|
</view>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
<!-- 对话内容区域 -->
|
|
|
|
|
<view class="chat-content">
|
|
|
|
|
<!-- 消息循环渲染 -->
|
|
|
|
|
<block
|
|
|
|
|
v-for="(group, groupIndex) in messageGroups"
|
|
|
|
|
:key="'group-' + groupIndex"
|
|
|
|
|
>
|
|
|
|
|
<!-- 时间 -->
|
|
|
|
|
<view class="message-time" v-if="group.time">{{ group.time }}</view>
|
|
|
|
|
|
|
|
|
|
<!-- 消息列表 -->
|
|
|
|
|
<block
|
|
|
|
|
v-for="(message, messageIndex) in group.messages"
|
|
|
|
|
:key="'msg-' + groupIndex + '-' + messageIndex"
|
|
|
|
|
>
|
|
|
|
|
<!-- 用户消息 -->
|
|
|
|
|
<view
|
|
|
|
|
class="message-right"
|
|
|
|
|
v-if="message.isUser"
|
|
|
|
|
:id="'msg-' + message.id"
|
|
|
|
|
>
|
|
|
|
|
<view class="message-content">
|
|
|
|
|
<text>{{ message.content }}</text>
|
|
|
|
|
</view>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="user-avatar"
|
|
|
|
|
src="/static/common/images/avatar.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- AI消息 -->
|
|
|
|
|
<view class="message-left" v-else :id="'msg-' + message.id">
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="ai-avatar"
|
|
|
|
|
src="/static/common/images/avatar_ai.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<view class="message-content">
|
2025-07-10 10:48:28 +08:00
|
|
|
|
<!-- <text space="nbsp" decode>{{ message.content }}</text> -->
|
|
|
|
|
<markdown-viewer :content="message.content" />
|
2025-07-02 17:07:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</block>
|
|
|
|
|
</block>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
|
|
<!-- 底部工具栏 -->
|
|
|
|
|
<view class="chat-footer">
|
|
|
|
|
<!-- 悬浮工具栏 -->
|
2025-07-04 15:26:46 +08:00
|
|
|
|
<!-- <view class="floating-tabs">
|
2025-07-04 14:59:56 +08:00
|
|
|
|
<view
|
|
|
|
|
class="tab-item"
|
|
|
|
|
@click="handleFeatureClick({ title: '招生在线' })"
|
|
|
|
|
>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="tab-icon"
|
|
|
|
|
src="/static/common/images/icon_admissions2.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
|
|
|
|
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<text>招生在线</text>
|
|
|
|
|
</view>
|
2025-07-04 14:59:56 +08:00
|
|
|
|
<view
|
|
|
|
|
class="tab-item"
|
|
|
|
|
@click="handleFeatureClick({ title: '留言板' })"
|
|
|
|
|
>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="tab-icon"
|
|
|
|
|
src="/static/common/images/icon_messageBoard2.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<text>留言板</text>
|
|
|
|
|
</view>
|
2025-07-04 14:59:56 +08:00
|
|
|
|
<view
|
|
|
|
|
class="tab-item"
|
|
|
|
|
@click="handleFeatureClick({ title: '电话咨询' })"
|
|
|
|
|
>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="tab-icon"
|
|
|
|
|
src="/static/common/images/icon_phone2.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
<text>电话咨询</text>
|
|
|
|
|
</view>
|
2025-07-04 15:26:46 +08:00
|
|
|
|
</view> -->
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
<view class="input-container">
|
|
|
|
|
<view class="input-area">
|
|
|
|
|
<input
|
2025-07-04 14:59:56 +08:00
|
|
|
|
v-model="messageValue"
|
2025-07-02 17:07:33 +08:00
|
|
|
|
type="text"
|
|
|
|
|
class="chat-input"
|
|
|
|
|
placeholder="请输入内容"
|
|
|
|
|
placeholder-style="color: #adadad;"
|
2025-07-04 14:59:56 +08:00
|
|
|
|
@confirm="sendMessageFn"
|
2025-07-02 17:07:33 +08:00
|
|
|
|
/>
|
2025-07-04 14:59:56 +08:00
|
|
|
|
<view class="send-btn" @click="sendMessageFn">
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<image
|
|
|
|
|
class="send-icon"
|
|
|
|
|
src="/static/common/images/icon_send.png"
|
|
|
|
|
mode="scaleToFill"
|
|
|
|
|
/>
|
2025-07-02 17:07:33 +08:00
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
|
|
|
|
|
<!-- 对话弹出层 -->
|
|
|
|
|
<u-popup v-model="popupShow" width="550rpx">
|
|
|
|
|
<view class="drawer-container">
|
|
|
|
|
<scroll-view scroll-y class="chat-history-list">
|
|
|
|
|
<view class="chat-day">
|
|
|
|
|
<text class="day-text">周三</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="chat-item"
|
|
|
|
|
v-for="(item, index) in chatHistoryList"
|
|
|
|
|
:key="index"
|
|
|
|
|
:class="{ 'chat-item-active': index === activeIndex }"
|
|
|
|
|
@click="selectChatItem(index)"
|
|
|
|
|
>
|
|
|
|
|
<text class="chat-text">{{ item.content }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="chat-day">
|
|
|
|
|
<text class="day-text">6/27</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view
|
|
|
|
|
class="chat-item"
|
|
|
|
|
v-for="(item, index) in chatHistoryList2"
|
|
|
|
|
:key="'history2-' + index"
|
|
|
|
|
:class="{
|
|
|
|
|
'chat-item-active':
|
|
|
|
|
index + chatHistoryList.length === activeIndex,
|
|
|
|
|
}"
|
|
|
|
|
@click="selectChatItem(index + chatHistoryList.length)"
|
|
|
|
|
>
|
|
|
|
|
<text class="chat-text">{{ item.content }}</text>
|
|
|
|
|
</view>
|
|
|
|
|
</scroll-view>
|
|
|
|
|
|
|
|
|
|
<view class="drawer-footer">
|
|
|
|
|
<view class="user-info">
|
|
|
|
|
<image
|
|
|
|
|
class="user-avatar"
|
|
|
|
|
src="/static/common/avatar/male.png"
|
|
|
|
|
></image>
|
|
|
|
|
<!-- <u-avatar
|
|
|
|
|
class="user-avatar"
|
|
|
|
|
src="/static/common/avatar/user-avatar.png"
|
|
|
|
|
></u-avatar> -->
|
|
|
|
|
<text class="user-name">晓德塔,</text>
|
|
|
|
|
</view>
|
|
|
|
|
<view class="settings">
|
|
|
|
|
<u-icon name="setting" size="40rpx" color="#999"></u-icon>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</view>
|
|
|
|
|
</u-popup>
|
2025-07-04 13:35:43 +08:00
|
|
|
|
|
2025-07-10 13:51:47 +08:00
|
|
|
|
<!-- 完善信息弹出层 -->
|
|
|
|
|
<perfect-info :show.sync="perfectInfoShow"></perfect-info>
|
|
|
|
|
|
2025-07-04 13:35:43 +08:00
|
|
|
|
<!-- 咨询电话弹出层 -->
|
|
|
|
|
<advice-phone :show.sync="advicePhoneShow"></advice-phone>
|
2025-07-04 14:59:56 +08:00
|
|
|
|
|
|
|
|
|
<!-- 提示 -->
|
|
|
|
|
<u-toast ref="uToast" />
|
2025-07-02 17:07:33 +08:00
|
|
|
|
</view>
|
2025-06-30 16:09:43 +08:00
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
2025-07-10 10:48:28 +08:00
|
|
|
|
import MarkdownViewer from "@/components/markdown-viewer/markdown-viewer";
|
2025-07-02 17:07:33 +08:00
|
|
|
|
import CustomTabBar from "@/components/custom-tab-bar/custom-tab-bar.vue";
|
2025-07-04 13:35:43 +08:00
|
|
|
|
import AdvicePhone from "@/components/AdvicePhone.vue";
|
2025-07-10 13:51:47 +08:00
|
|
|
|
import PerfectInfo from "@/components/PerfectInfo.vue";
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: {
|
|
|
|
|
CustomTabBar,
|
2025-07-04 13:35:43 +08:00
|
|
|
|
AdvicePhone,
|
2025-07-10 10:48:28 +08:00
|
|
|
|
MarkdownViewer,
|
2025-07-10 13:51:47 +08:00
|
|
|
|
PerfectInfo,
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
isChat: false,
|
2025-07-04 13:35:43 +08:00
|
|
|
|
advicePhoneShow: false,
|
2025-07-10 13:51:47 +08:00
|
|
|
|
perfectInfoShow: false,
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
questionList: [
|
|
|
|
|
"学习哪些专业比较好?",
|
|
|
|
|
"处于香港学校综合录取的城市招生?",
|
|
|
|
|
"学校有新华专业?",
|
|
|
|
|
"学校录取科目与有一些专业会有特殊...",
|
|
|
|
|
"我什么时候能推知道自己是否被录取?",
|
|
|
|
|
],
|
|
|
|
|
features: [
|
|
|
|
|
{
|
|
|
|
|
title: "招办在线",
|
2025-07-04 13:35:43 +08:00
|
|
|
|
icon: "/static/common/images/icon_admissions.png",
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "留言板",
|
2025-07-04 13:35:43 +08:00
|
|
|
|
icon: "/static/common/images/icon_messageBoard.png",
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: "电话咨询",
|
2025-07-04 13:35:43 +08:00
|
|
|
|
icon: "/static/common/images/icon_phone.png",
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
popupShow: false,
|
|
|
|
|
chatHistoryList: [
|
|
|
|
|
{ content: "学校哪些专业比较好?" },
|
|
|
|
|
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
],
|
|
|
|
|
chatHistoryList2: [
|
|
|
|
|
{ content: "学校哪些专业比较好?" },
|
|
|
|
|
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
|
|
|
|
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
|
|
|
|
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
|
|
|
|
{ content: "如何报考学校综合合录取评澳市评招生?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
{ content: "学校有新华专业?" },
|
|
|
|
|
],
|
|
|
|
|
activeIndex: 0,
|
|
|
|
|
commonQuestions: [
|
|
|
|
|
"新生报到流程",
|
|
|
|
|
"如何报考学校综合合录取评澳市评招生?",
|
|
|
|
|
"学校有新华专业?",
|
|
|
|
|
"学校录取科目与有一些专业会有特殊...",
|
|
|
|
|
"我什么时候能推知道自己是否被录取?",
|
|
|
|
|
],
|
|
|
|
|
scrollToView: "",
|
|
|
|
|
messageGroups: [
|
2025-07-04 14:59:56 +08:00
|
|
|
|
// {
|
|
|
|
|
// time: "2025-07-01 10:00:00",
|
|
|
|
|
// messages: [
|
|
|
|
|
// { id: 1, content: "学校哪些专业比较好?", isUser: true },
|
|
|
|
|
// {
|
|
|
|
|
// id: 2,
|
|
|
|
|
// content:
|
|
|
|
|
// "我校有多个优势学科,包括计算机科学与技术、电子信息工程、机械工程、生物医学工程等。这些专业在国内都有较高的学术声誉和就业率。如果您对某个具体专业感兴趣,可以进一步咨询更多详情。",
|
|
|
|
|
// isUser: false,
|
|
|
|
|
// },
|
|
|
|
|
// { id: 3, content: "计算机科学专业就业前景如何?", isUser: true },
|
|
|
|
|
// {
|
|
|
|
|
// id: 4,
|
|
|
|
|
// content:
|
|
|
|
|
// "计算机科学专业的就业前景非常好。根据最新数据,我校计算机专业毕业生就业率超过95%,平均起薪在全校名列前茅。主要就业方向包括互联网公司、IT企业、金融科技等领域,担任软件工程师、数据分析师、产品经理等职位。",
|
|
|
|
|
// isUser: false,
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
|
|
|
|
// {
|
|
|
|
|
// time: "2025-07-02 09:15:36",
|
|
|
|
|
// messages: [
|
|
|
|
|
// { id: 5, content: "新生报到流程", isUser: true },
|
|
|
|
|
// {
|
|
|
|
|
// id: 6,
|
|
|
|
|
// content:
|
|
|
|
|
// "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单",
|
|
|
|
|
// isUser: false,
|
|
|
|
|
// },
|
|
|
|
|
// { id: 7, content: "预报到需要准备哪些材料?", isUser: true },
|
|
|
|
|
// {
|
|
|
|
|
// id: 8,
|
|
|
|
|
// content:
|
|
|
|
|
// "预报到需要准备以下材料:\n1. 身份证原件及复印件\n2. 录取通知书原件\n3. 2寸蓝底证件照4张\n4. 学籍档案(密封)\n5. 党团关系材料(如有)\n\n建议提前准备齐全,以便快速完成报到流程。",
|
|
|
|
|
// isUser: false,
|
|
|
|
|
// },
|
|
|
|
|
// ],
|
|
|
|
|
// },
|
2025-07-02 17:07:33 +08:00
|
|
|
|
{
|
2025-07-04 14:59:56 +08:00
|
|
|
|
time: "",
|
2025-07-02 17:07:33 +08:00
|
|
|
|
messages: [
|
2025-07-04 15:26:46 +08:00
|
|
|
|
// { id: 5, content: "新生报到流程", isUser: true },
|
|
|
|
|
// {
|
|
|
|
|
// id: 6,
|
|
|
|
|
// content:
|
|
|
|
|
// "新生报到流程:个人信息完善 --预报到 -- 照片信息采集 --缴费 --入校验审 -- 人脸识别 --打印报到单",
|
|
|
|
|
// isUser: false,
|
|
|
|
|
// },
|
2025-07-02 17:07:33 +08:00
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
scrollTop: 0,
|
2025-07-04 14:59:56 +08:00
|
|
|
|
|
|
|
|
|
messageValue: "", // 输入框内容
|
2025-07-02 17:07:33 +08:00
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
watch: {
|
|
|
|
|
// 确保消息更新后自动滚动到底部
|
|
|
|
|
messageGroups: {
|
|
|
|
|
handler() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.scrollToBottom();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
2025-07-10 13:51:47 +08:00
|
|
|
|
|
|
|
|
|
vuex_user: {
|
|
|
|
|
handler(newValue) {
|
|
|
|
|
// console.log('vuex_user',newValue);
|
|
|
|
|
if (newValue && newValue.Sex === 2) {
|
|
|
|
|
// this.perfectInfoShow = true;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
immediate: true, // 这会使得组件创建时立即执行一次handler
|
|
|
|
|
deep: true,
|
|
|
|
|
},
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
onLoad() {},
|
|
|
|
|
mounted() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.scrollToBottom();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
updated() {
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
this.scrollToBottom();
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
methods: {
|
2025-07-10 10:48:28 +08:00
|
|
|
|
// 测试Markdown渲染效果(仅开发阶段使用)
|
|
|
|
|
testMarkdownRender() {
|
|
|
|
|
const markdownSample = `# 这是标题
|
|
|
|
|
|
|
|
|
|
## 这是二级标题
|
|
|
|
|
|
|
|
|
|
这是**加粗文本**和*斜体文本*
|
|
|
|
|
|
|
|
|
|
> 这是引用文本
|
|
|
|
|
|
|
|
|
|
- 列表项1
|
|
|
|
|
- 列表项2
|
|
|
|
|
- 列表项3
|
|
|
|
|
|
|
|
|
|
\`\`\`javascript
|
|
|
|
|
// 这是代码块
|
|
|
|
|
function hello() {
|
|
|
|
|
console.log('Hello World!');
|
|
|
|
|
}
|
|
|
|
|
\`\`\`
|
|
|
|
|
|
|
|
|
|
[这是链接](https://www.example.com)
|
|
|
|
|
|
|
|
|
|
| 表头1 | 表头2 |
|
|
|
|
|
| ----- | ----- |
|
|
|
|
|
| 内容1 | 内容2 |
|
|
|
|
|
| 内容3 | 内容4 |
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
this.messageGroups[0].messages.push({
|
|
|
|
|
id: this.messageGroups[0].messages.length + 1,
|
|
|
|
|
content: "测试Markdown渲染",
|
|
|
|
|
isUser: true,
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
setTimeout(() => {
|
|
|
|
|
this.messageGroups[0].messages.push({
|
|
|
|
|
id: `test-${Date.now()}`,
|
|
|
|
|
content: markdownSample,
|
|
|
|
|
isUser: false,
|
|
|
|
|
});
|
|
|
|
|
}, 500);
|
|
|
|
|
},
|
|
|
|
|
|
2025-07-02 17:07:33 +08:00
|
|
|
|
handleLeftClick() {
|
2025-07-04 14:59:56 +08:00
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
title: "暂未开放",
|
|
|
|
|
type: "warning",
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
return;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
this.popupShow = true;
|
|
|
|
|
},
|
|
|
|
|
selectChatItem(index) {
|
|
|
|
|
this.activeIndex = index;
|
|
|
|
|
},
|
|
|
|
|
loadMoreMessages() {
|
|
|
|
|
// 加载更多历史消息的实现
|
|
|
|
|
console.log("加载更多历史消息");
|
|
|
|
|
},
|
|
|
|
|
onScroll(event) {
|
|
|
|
|
// 滚动事件处理
|
|
|
|
|
},
|
|
|
|
|
scrollToBottom() {
|
|
|
|
|
// 使用nextTick确保DOM已更新
|
|
|
|
|
this.$nextTick(() => {
|
|
|
|
|
// 获取滚动区域的高度
|
|
|
|
|
const query = uni.createSelectorQuery().in(this);
|
|
|
|
|
query
|
|
|
|
|
.select(".chat-content")
|
|
|
|
|
.boundingClientRect((data) => {
|
|
|
|
|
if (data) {
|
|
|
|
|
// 计算滚动到底部的位置
|
|
|
|
|
const scrollHeight = data.height;
|
|
|
|
|
// 设置滚动位置,加100px确保滚动到底部
|
|
|
|
|
this.scrollTop = scrollHeight + 100;
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
.exec();
|
|
|
|
|
});
|
|
|
|
|
},
|
2025-07-04 13:35:43 +08:00
|
|
|
|
handleFeatureClick(item) {
|
|
|
|
|
if (item.title === "电话咨询") {
|
|
|
|
|
this.advicePhoneShow = true;
|
2025-07-10 13:51:47 +08:00
|
|
|
|
return;
|
2025-07-04 14:59:56 +08:00
|
|
|
|
} else {
|
|
|
|
|
this.$refs.uToast.show({
|
|
|
|
|
title: "暂未开放",
|
|
|
|
|
type: "warning",
|
2025-07-04 13:35:43 +08:00
|
|
|
|
});
|
2025-07-04 14:59:56 +08:00
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
sendMessageFn() {
|
|
|
|
|
if (!this.messageValue) {
|
|
|
|
|
return;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
}
|
2025-07-04 14:59:56 +08:00
|
|
|
|
|
|
|
|
|
const sendMessage = this.messageValue;
|
|
|
|
|
|
|
|
|
|
console.log("发送消息", sendMessage);
|
|
|
|
|
this.messageGroups[0].messages.push({
|
|
|
|
|
id: this.messageGroups[0].messages.length + 1,
|
|
|
|
|
content: sendMessage,
|
|
|
|
|
isUser: true,
|
|
|
|
|
});
|
|
|
|
|
this.messageValue = "";
|
|
|
|
|
|
|
|
|
|
this.$u.api
|
|
|
|
|
.SendMessageApi({
|
|
|
|
|
query: sendMessage,
|
|
|
|
|
conversationId: "",
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
console.log("res.....", res);
|
2025-07-10 10:48:28 +08:00
|
|
|
|
const data = res.data;
|
|
|
|
|
|
|
|
|
|
// 处理返回内容,确保Markdown格式正确
|
|
|
|
|
let content = data.content;
|
|
|
|
|
|
|
|
|
|
// 如果返回的内容没有明确的Markdown格式,可以根据需要进行一些简单处理
|
|
|
|
|
// 例如:将换行符转换为Markdown换行
|
|
|
|
|
// content = content.replace(/\n/g, "\n\n");
|
|
|
|
|
|
2025-07-04 14:59:56 +08:00
|
|
|
|
this.messageGroups[0].messages.push({
|
2025-07-10 10:48:28 +08:00
|
|
|
|
id: data.conversationId,
|
|
|
|
|
content: content,
|
2025-07-04 14:59:56 +08:00
|
|
|
|
isUser: false,
|
|
|
|
|
});
|
|
|
|
|
});
|
2025-07-04 13:35:43 +08:00
|
|
|
|
},
|
2025-07-02 17:07:33 +08:00
|
|
|
|
},
|
|
|
|
|
};
|
2025-06-30 16:09:43 +08:00
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
2025-07-04 14:59:56 +08:00
|
|
|
|
page {
|
2025-07-04 15:47:28 +08:00
|
|
|
|
height: 100vh;
|
2025-07-04 14:59:56 +08:00
|
|
|
|
background-image: url("/static/common/images/images_bg.png");
|
|
|
|
|
width: 100%;
|
|
|
|
|
background-repeat: no-repeat;
|
|
|
|
|
background-size: 100% 100%;
|
|
|
|
|
background-position: 0 88rpx;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-02 17:07:33 +08:00
|
|
|
|
.home-container {
|
2025-07-04 13:35:43 +08:00
|
|
|
|
height: 100vh;
|
|
|
|
|
// background-color: #f5f7fc;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
padding-bottom: calc(
|
|
|
|
|
112rpx + env(safe-area-inset-bottom)
|
|
|
|
|
); /* 为自定义tabBar预留空间 */
|
|
|
|
|
padding-top: 88rpx;
|
|
|
|
|
|
|
|
|
|
.header {
|
|
|
|
|
position: fixed;
|
|
|
|
|
top: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
height: 88rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
z-index: 99;
|
|
|
|
|
|
|
|
|
|
.header-left {
|
2025-07-04 15:30:23 +08:00
|
|
|
|
width: 40rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.header-title {
|
|
|
|
|
font-size: 36rpx;
|
2025-07-04 15:05:29 +08:00
|
|
|
|
font-weight: bold;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
2025-07-04 15:30:23 +08:00
|
|
|
|
|
|
|
|
|
.header-right {
|
|
|
|
|
width: 40rpx;
|
|
|
|
|
}
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.content {
|
|
|
|
|
padding: 30rpx;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
padding-top: 100rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
.welcome-message {
|
|
|
|
|
// display: inline-block;
|
|
|
|
|
// flex-wrap: wrap;
|
|
|
|
|
background-color: rgba(255, 255, 255, 0.8);
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 24rpx;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
margin-bottom: 32rpx;
|
|
|
|
|
// margin-bottom: 100rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
.avatar {
|
|
|
|
|
display: inline-block;
|
|
|
|
|
width: 42rpx;
|
|
|
|
|
height: 34rpx;
|
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-text {
|
2025-07-04 15:05:29 +08:00
|
|
|
|
font-size: 28rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
color: #333333;
|
|
|
|
|
font-family: PingFang SC;
|
|
|
|
|
vertical-align: super;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qa-section {
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 30rpx;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
margin-bottom: 32rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
|
|
|
|
|
.qa-header {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
|
|
|
|
|
.qa-title {
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
font-weight: 500;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.more-link {
|
|
|
|
|
.more-text {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #999;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.qa-list {
|
|
|
|
|
.qa-item {
|
|
|
|
|
margin-bottom: 24rpx;
|
|
|
|
|
|
|
|
|
|
.qa-question {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-button {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: #4377fe;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
height: 88rpx;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
|
|
.chat-icon {
|
2025-07-04 13:35:43 +08:00
|
|
|
|
width: 38rpx;
|
|
|
|
|
height: 32rpx;
|
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-text {
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
font-size: 32rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.start-chat {
|
|
|
|
|
.chat-button {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: #4377fe;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
height: 88rpx;
|
|
|
|
|
width: 100%;
|
|
|
|
|
margin-top: 30rpx;
|
|
|
|
|
border: none;
|
|
|
|
|
|
|
|
|
|
.chat-icon {
|
|
|
|
|
width: 38rpx;
|
|
|
|
|
height: 32rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-text {
|
|
|
|
|
color: #ffffff;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
font-size: 32rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feature-grid {
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
margin-top: 32rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
gap: 30rpx;
|
|
|
|
|
|
|
|
|
|
.feature-item {
|
|
|
|
|
height: 210rpx;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
background-color: #fafafc;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
// gap: 20rpx;
|
|
|
|
|
flex: 1;
|
|
|
|
|
|
|
|
|
|
.feature-icon {
|
|
|
|
|
width: 80rpx;
|
|
|
|
|
height: 80rpx;
|
2025-07-04 13:35:43 +08:00
|
|
|
|
margin-bottom: 12rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feature-text {
|
|
|
|
|
font-size: 26rpx;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.drawer-container {
|
|
|
|
|
padding: 32rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
height: 100vh;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
|
|
|
|
|
.chat-history-list {
|
|
|
|
|
flex: 1;
|
|
|
|
|
// padding: 30rpx 40rpx;
|
|
|
|
|
height: calc(100vh - 200rpx);
|
|
|
|
|
|
|
|
|
|
.chat-day {
|
|
|
|
|
display: flex;
|
|
|
|
|
margin: 20rpx 0 20rpx 30rpx;
|
|
|
|
|
|
|
|
|
|
.day-text {
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #999999;
|
|
|
|
|
font-family: PingFang SC;
|
|
|
|
|
margin-bottom: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-item {
|
|
|
|
|
padding: 24rpx 30rpx;
|
|
|
|
|
border-radius: 16rpx;
|
|
|
|
|
// margin-bottom: 30rpx;
|
|
|
|
|
|
|
|
|
|
.chat-text {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #303030;
|
|
|
|
|
font-family: PingFang SC;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
&-active {
|
|
|
|
|
background-color: #4f6aff;
|
|
|
|
|
|
|
|
|
|
.chat-text {
|
|
|
|
|
color: #fff;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.drawer-footer {
|
|
|
|
|
height: 130rpx;
|
|
|
|
|
border: 1rpx solid #eeeeee;
|
|
|
|
|
border-radius: 12rpx;
|
|
|
|
|
padding: 0 30rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: space-between;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.user-info {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
|
|
|
|
|
.user-avatar {
|
|
|
|
|
width: 56rpx;
|
|
|
|
|
height: 56rpx;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-right: 30rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.user-name {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-family: DouyinSans;
|
|
|
|
|
color: #333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.settings {
|
|
|
|
|
padding: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 响应式布局 - PC端样式 */
|
|
|
|
|
@media screen and (min-width: 768px) {
|
|
|
|
|
.home-container {
|
|
|
|
|
.content {
|
|
|
|
|
max-width: 1200rpx;
|
|
|
|
|
margin: 0 auto;
|
|
|
|
|
|
|
|
|
|
.qa-section {
|
|
|
|
|
.qa-list {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-wrap: wrap;
|
|
|
|
|
|
|
|
|
|
.qa-item {
|
|
|
|
|
width: 48%;
|
|
|
|
|
margin-right: 2%;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.feature-grid {
|
|
|
|
|
max-width: 1200rpx;
|
|
|
|
|
margin: 40rpx auto 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-container {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
padding: 30rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
.chat-scroll {
|
|
|
|
|
flex: 1;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
// overflow-y: auto; /* 使用auto而不是scroll */ // 添加这行会导致滚动条不见
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-10 10:48:28 +08:00
|
|
|
|
// 测试按钮样式
|
|
|
|
|
.test-button {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 180rpx;
|
|
|
|
|
right: 30rpx;
|
|
|
|
|
background-color: #4370fe;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
padding: 16rpx 24rpx;
|
|
|
|
|
border-radius: 10rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
z-index: 999;
|
|
|
|
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.2);
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-02 17:07:33 +08:00
|
|
|
|
.chat-card {
|
2025-07-04 15:26:46 +08:00
|
|
|
|
// background-color: #ffffff;
|
|
|
|
|
// border-radius: 16rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
padding: 30rpx;
|
|
|
|
|
margin-bottom: 30rpx;
|
|
|
|
|
|
|
|
|
|
.chat-card-title {
|
2025-07-04 15:26:46 +08:00
|
|
|
|
font-family: DouyinSans;
|
|
|
|
|
font-weight: bold;
|
|
|
|
|
font-size: 36rpx;
|
|
|
|
|
color: #5255e6;
|
|
|
|
|
// line-height: 24rpx;
|
|
|
|
|
background: linear-gradient(-56deg, #4d50dd 0%, #3e6aff 100%);
|
|
|
|
|
-webkit-background-clip: text;
|
|
|
|
|
-webkit-text-fill-color: transparent;
|
|
|
|
|
margin-bottom: 12rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-card-desc {
|
2025-07-04 15:26:46 +08:00
|
|
|
|
font-family: PingFang SC;
|
|
|
|
|
font-weight: 500;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
font-size: 24rpx;
|
2025-07-04 15:26:46 +08:00
|
|
|
|
color: #9ba5c7;
|
|
|
|
|
line-height: 24rpx;
|
|
|
|
|
margin-bottom: 12rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-card-questions {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: column;
|
|
|
|
|
gap: 16rpx;
|
|
|
|
|
|
|
|
|
|
.question-item {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333333;
|
|
|
|
|
line-height: 1.5;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-content {
|
|
|
|
|
flex: 1;
|
|
|
|
|
padding: 20rpx 0;
|
|
|
|
|
margin-bottom: 150rpx;
|
|
|
|
|
|
|
|
|
|
.message-time {
|
|
|
|
|
text-align: center;
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
color: #999999;
|
|
|
|
|
padding: 20rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-left,
|
|
|
|
|
.message-right {
|
|
|
|
|
display: flex;
|
2025-07-04 16:36:36 +08:00
|
|
|
|
margin-bottom: 40rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
align-items: flex-start;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-left {
|
2025-07-10 10:48:28 +08:00
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
|
2025-07-02 17:07:33 +08:00
|
|
|
|
.ai-avatar {
|
|
|
|
|
width: 64rpx;
|
|
|
|
|
height: 64rpx;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-right: 16rpx;
|
2025-07-10 10:48:28 +08:00
|
|
|
|
background-color: #f0f0f0;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-content {
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
max-width: 70%;
|
|
|
|
|
padding: 20rpx 24rpx;
|
|
|
|
|
border-radius: 0 16rpx 16rpx 16rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
line-height: 1.5;
|
2025-07-10 10:48:28 +08:00
|
|
|
|
|
|
|
|
|
/* Markdown内容样式调整 */
|
|
|
|
|
/deep/ .markdown-container {
|
|
|
|
|
padding: 0;
|
|
|
|
|
|
|
|
|
|
/* 覆盖默认的padding,避免额外空白 */
|
|
|
|
|
p {
|
|
|
|
|
margin: 0;
|
|
|
|
|
padding: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 确保代码块不会超出气泡 */
|
|
|
|
|
pre {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
overflow-x: auto;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 调整图片大小 */
|
|
|
|
|
img {
|
|
|
|
|
max-width: 100%;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* 调整表格样式 */
|
|
|
|
|
table {
|
|
|
|
|
font-size: 24rpx;
|
|
|
|
|
}
|
|
|
|
|
}
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-right {
|
|
|
|
|
justify-content: flex-end;
|
|
|
|
|
|
|
|
|
|
.user-avatar {
|
|
|
|
|
width: 64rpx;
|
|
|
|
|
height: 64rpx;
|
|
|
|
|
border-radius: 50%;
|
|
|
|
|
margin-left: 16rpx;
|
|
|
|
|
background-color: #f0f0f0;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.message-content {
|
|
|
|
|
background-color: #4370fe;
|
|
|
|
|
color: #ffffff;
|
|
|
|
|
max-width: 70%;
|
|
|
|
|
padding: 20rpx 24rpx;
|
|
|
|
|
border-radius: 16rpx 0 16rpx 16rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
line-height: 1.5;
|
2025-07-04 14:59:56 +08:00
|
|
|
|
text-align: left;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.chat-footer {
|
|
|
|
|
position: fixed;
|
|
|
|
|
bottom: 0;
|
|
|
|
|
left: 0;
|
|
|
|
|
right: 0;
|
|
|
|
|
|
|
|
|
|
.floating-tabs {
|
|
|
|
|
display: flex;
|
|
|
|
|
justify-content: flex-start;
|
|
|
|
|
margin: 0 0 20rpx 20rpx;
|
|
|
|
|
|
|
|
|
|
.tab-item {
|
|
|
|
|
display: flex;
|
|
|
|
|
flex-direction: row;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
background-color: #ffffff;
|
|
|
|
|
padding: 8rpx 24rpx;
|
|
|
|
|
border-radius: 50rpx;
|
|
|
|
|
box-shadow: 0 2rpx 10rpx rgba(0, 0, 0, 0.1);
|
|
|
|
|
margin-right: 12rpx;
|
|
|
|
|
|
|
|
|
|
.tab-icon {
|
2025-07-04 13:35:43 +08:00
|
|
|
|
width: 28rpx;
|
|
|
|
|
height: 28rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
margin-right: 10rpx;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
text {
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333333;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.input-container {
|
|
|
|
|
padding: 32rpx;
|
|
|
|
|
background-color: #fff;
|
|
|
|
|
box-shadow: 0 -2rpx 10rpx rgba(0, 0, 0, 0.05);
|
|
|
|
|
|
|
|
|
|
.input-area {
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
background-color: #f2f4f9;
|
|
|
|
|
border-radius: 20rpx;
|
|
|
|
|
padding: 16rpx 24rpx;
|
|
|
|
|
box-sizing: border-box;
|
|
|
|
|
|
|
|
|
|
.chat-input {
|
|
|
|
|
flex: 1;
|
|
|
|
|
height: 40rpx;
|
|
|
|
|
font-size: 28rpx;
|
|
|
|
|
color: #333;
|
|
|
|
|
background-color: transparent;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.send-btn {
|
|
|
|
|
width: 50rpx;
|
|
|
|
|
height: 50rpx;
|
|
|
|
|
display: flex;
|
|
|
|
|
align-items: center;
|
|
|
|
|
justify-content: center;
|
|
|
|
|
|
|
|
|
|
.send-icon {
|
2025-07-04 13:35:43 +08:00
|
|
|
|
width: 40rpx;
|
|
|
|
|
height: 46rpx;
|
2025-07-02 17:07:33 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
</style>
|