|
@ -3,6 +3,7 @@ |
|
|
import { ref, computed, onMounted, watch, nextTick } from "vue"; |
|
|
import { ref, computed, onMounted, watch, nextTick } from "vue"; |
|
|
import { setHeight } from "../utils/setHeight"; |
|
|
import { setHeight } from "../utils/setHeight"; |
|
|
import { getUserCountAPI } from "../api/AIxiaocaishen"; |
|
|
import { getUserCountAPI } from "../api/AIxiaocaishen"; |
|
|
|
|
|
import { ElMessage } from 'element-plus' |
|
|
import AIchat from "./AIchat.vue"; |
|
|
import AIchat from "./AIchat.vue"; |
|
|
import AIfind from "./AIfind.vue"; |
|
|
import AIfind from "./AIfind.vue"; |
|
|
import { useAppBridge } from '../assets/js/useAppBridge.js' |
|
|
import { useAppBridge } from '../assets/js/useAppBridge.js' |
|
@ -10,9 +11,25 @@ import { useDataStore } from '@/store/dataList.js' |
|
|
import { useChatStore } from '../store/chat' |
|
|
import { useChatStore } from '../store/chat' |
|
|
import { useAudioStore } from '../store/audio' |
|
|
import { useAudioStore } from '../store/audio' |
|
|
import _ from "lodash"; |
|
|
import _ from "lodash"; |
|
|
|
|
|
|
|
|
|
|
|
import logo from "../assets/img/homePage/logo.png"; |
|
|
|
|
|
import madeInHL from "../assets/img/homePage/madeInHL.png"; |
|
|
|
|
|
import getCountAll from "../assets/img/homePage/get-count-all.png"; |
|
|
|
|
|
import announcementBtn from "../assets/img/homePage/announcement.png"; |
|
|
|
|
|
import thinkActive from "../assets/img/homePage/tail/think-active.png"; |
|
|
|
|
|
import thinkNoActive from "../assets/img/homePage/tail/think-no-active.png"; |
|
|
|
|
|
import languageBtn from "../assets/img/homePage/tail/language.png"; |
|
|
|
|
|
import voice from "../assets/img/homePage/tail/voice.png"; |
|
|
|
|
|
import voiceNoActive from "../assets/img/homePage/tail/voice-no-active.png"; |
|
|
|
|
|
import sendBtn from "../assets/img/homePage/tail/send.png"; |
|
|
|
|
|
import msgBtn from "../assets/img/homePage/tail/msg.png"; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// import { useUserStore } from "../store/userPessionCode.js"; |
|
|
// import { useUserStore } from "../store/userPessionCode.js"; |
|
|
const { getQueryVariable } = useDataStore() |
|
|
const { getQueryVariable } = useDataStore() |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 变量 |
|
|
// 变量 |
|
|
// 音频管理 |
|
|
// 音频管理 |
|
|
const audioStore = useAudioStore() |
|
|
const audioStore = useAudioStore() |
|
@ -101,6 +118,10 @@ const updateMessage = (title) => { |
|
|
// console.log("updateMessage 的值:", title); |
|
|
// console.log("updateMessage 的值:", title); |
|
|
}; |
|
|
}; |
|
|
const sendMessage = async () => { |
|
|
const sendMessage = async () => { |
|
|
|
|
|
if (localStorage.getItem('localToken') == null||localStorage.getItem('localToken') == '') { |
|
|
|
|
|
ElMessage.error('请先登录'); |
|
|
|
|
|
return ; |
|
|
|
|
|
} |
|
|
isScrolling.value = false; |
|
|
isScrolling.value = false; |
|
|
// 调用 ensureAIchat 确保跳转到 AIchat 页面 |
|
|
// 调用 ensureAIchat 确保跳转到 AIchat 页面 |
|
|
ensureAIchat(); |
|
|
ensureAIchat(); |
|
@ -318,17 +339,16 @@ onMounted(async () => { |
|
|
<el-header class="homepage-head"> |
|
|
<el-header class="homepage-head"> |
|
|
<!-- logo --> |
|
|
<!-- logo --> |
|
|
<div class="homepage-logo"> |
|
|
<div class="homepage-logo"> |
|
|
<img src="src\assets\img\homePage\logo.png" alt="图片加载失败" class="logo1" /> |
|
|
|
|
|
<img src="src\assets\img\homePage\madeInHL.png" alt="图片加载失败" class="logo2" /> |
|
|
|
|
|
|
|
|
<img :src="logo" alt="图片加载失败" class="logo1" /> |
|
|
|
|
|
<img :src="madeInHL" alt="图片加载失败" class="logo2" /> |
|
|
</div> |
|
|
</div> |
|
|
|
|
|
|
|
|
<div class="homepage-right-group"> |
|
|
<div class="homepage-right-group"> |
|
|
<div class="count-badge" @click="showCount"> |
|
|
<div class="count-badge" @click="showCount"> |
|
|
<img src="src\assets\img\homePage\get-count-all.png" class="action-btn" /> |
|
|
|
|
|
|
|
|
<img :src="getCountAll" class="action-btn" /> |
|
|
<div class="count-number">{{ UserCount }}次</div> |
|
|
<div class="count-number">{{ UserCount }}次</div> |
|
|
</div> |
|
|
</div> |
|
|
<img src="src\assets\img\homePage\announcement.png" class="announcement-btn action-btn" |
|
|
|
|
|
@click="showAnnouncement" /> |
|
|
|
|
|
|
|
|
<img :src="announcementBtn" class="announcement-btn action-btn" @click="showAnnouncement" /> |
|
|
</div> |
|
|
</div> |
|
|
</el-header> |
|
|
</el-header> |
|
|
<!-- 主体部分:小人 问题轮询图 对话内容 --> |
|
|
<!-- 主体部分:小人 问题轮询图 对话内容 --> |
|
@ -353,17 +373,13 @@ onMounted(async () => { |
|
|
<!-- 第一行按钮 --> |
|
|
<!-- 第一行按钮 --> |
|
|
<div class="footer-first-line"> |
|
|
<div class="footer-first-line"> |
|
|
<div class="left-group"> |
|
|
<div class="left-group"> |
|
|
<img v-if="isThinking" src="src\assets\img\homePage\tail\think-active.png" @click="toggleThink" |
|
|
|
|
|
class="action-btn" /> |
|
|
|
|
|
<img v-else src="src\assets\img\homePage\tail\think-no-active.png" @click="toggleThink" |
|
|
|
|
|
class="action-btn" /> |
|
|
|
|
|
<img src="src\assets\img\homePage\tail\language.png" @click="changeLanguage" class="action-btn" /> |
|
|
|
|
|
<img v-if="isVoice" src="src\assets\img\homePage\tail\voice.png" @click="toggleVoice" class="action-btn" /> |
|
|
|
|
|
<img v-else src="src\assets\img\homePage\tail\voice-no-active.png" @click="toggleVoice" |
|
|
|
|
|
class="action-btn" /> |
|
|
|
|
|
|
|
|
<img v-if="isThinking" :src="thinkActive" @click="toggleThink" class="action-btn" /> |
|
|
|
|
|
<img v-else :src="thinkNoActive" @click="toggleThink" class="action-btn" /> |
|
|
|
|
|
<img :src="languageBtn" @click="changeLanguage" class="action-btn" /> |
|
|
|
|
|
<img v-if="isVoice" :src="voice" @click="toggleVoice" class="action-btn" /> |
|
|
|
|
|
<img v-else :src="voiceNoActive" @click="toggleVoice" class="action-btn" /> |
|
|
</div> |
|
|
</div> |
|
|
<img v-if="!chatStore.isLoading" src="src\assets\img\homePage\tail\send.png" @click="sendMessage" |
|
|
|
|
|
class="action-btn send-btn" /> |
|
|
|
|
|
|
|
|
<img v-if="!chatStore.isLoading" :src="sendBtn" @click="sendMessage" class="action-btn send-btn" /> |
|
|
<div v-else> |
|
|
<div v-else> |
|
|
<el-icon class="is-loading"> |
|
|
<el-icon class="is-loading"> |
|
|
<Loading /> |
|
|
<Loading /> |
|
@ -373,7 +389,7 @@ onMounted(async () => { |
|
|
|
|
|
|
|
|
<!-- 第二行输入框 --> |
|
|
<!-- 第二行输入框 --> |
|
|
<div class="footer-second-line"> |
|
|
<div class="footer-second-line"> |
|
|
<img src="src\assets\img\homePage\tail\msg.png" class="msg-icon" /> |
|
|
|
|
|
|
|
|
<img :src="msgBtn" class="msg-icon" /> |
|
|
<el-input type="textarea" v-model="message" :autosize="{ minRows: 1, maxRows: 4 }" placeholder="给AI小财神发消息..." |
|
|
<el-input type="textarea" v-model="message" :autosize="{ minRows: 1, maxRows: 4 }" placeholder="给AI小财神发消息..." |
|
|
class="msg-input" @keydown.enter.exact.prevent="isLoading ? null : sendMessage()" resize="none"> |
|
|
class="msg-input" @keydown.enter.exact.prevent="isLoading ? null : sendMessage()" resize="none"> |
|
|
</el-input> |
|
|
</el-input> |
|
|