Compare commits

...

56 Commits

Author SHA1 Message Date
no99 b10e4a4ef6 手机样式修改 20 hours ago
宋杰 32ca961b16 Merge branch 'milestone-20250710-上线前优化' into dev 22 hours ago
宋杰 6a5cfd6552 解决情绪大模型对话重复问题。 23 hours ago
no99 cca76b390f 弹窗适配 24 hours ago
宋杰 a3e8f86c98 报错提示语修改。 24 hours ago
no99 389856661c 手机样式适配 24 hours ago
宋杰 c86e882ab0 解决情绪大模型对话重复问题。 24 hours ago
宋杰 426265cc1e Merge branch 'milestone-20250710-上线前优化' into dev 1 day ago
宋杰 52ae7f3255 解决图表报错问题。 1 day ago
宋杰 4c7564478d 解决情绪能量转化器报错问题。 1 day ago
宋杰 94bc5e6912 Merge branch 'milestone-20250710-上线前优化' into dev 1 day ago
宋杰 c988db2d62 情绪能量转化器换新图;情绪探底雷达y轴刻度值保留整数。 1 day ago
宋杰 5faf33f365 Merge branch 'milestone-20250710-上线前优化' into dev 1 day ago
no99 aa41246a9f Merge branch 'milestone-20250820-金币兑换Token' into dev 2 days ago
no99 f6a25d7bc7 提测准备 2 days ago
no99 4283b0c639 Merge branch 'milestone-20250820-金币兑换Token' into dev 2 days ago
no99 a8493ef3b7 app版充值金币+记录充值前选择的档位 2 days ago
宋杰 ba3d683f3c 解决结论先全部出现后打字机的问题。 2 days ago
宋杰 9fd9f02ac0 情绪大模型喇叭正位。 2 days ago
宋杰 3436b416a0 试运行期间的标语修改。 2 days ago
no99 409ed33ea8 Merge branch 'milestone-20250820-金币兑换Token' into dev 2 days ago
no99 2e0f2899ed pc版充值金币 2 days ago
宋杰 ca87637743 公告页中的返回首页按钮。 2 days ago
宋杰 0605f99c2f 金币兑换token域名修改。 2 days ago
宋杰 20f7f5a071 Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into milestone-20250710-上线前优化 2 days ago
no99 58f0e03f70 Merge branch 'milestone-20250820-金币兑换Token' into dev 2 days ago
no99 ebd6d23934 Merge branch 'hongxilin/feature-20250628153758-财神优化:字正确性,一致性等' into milestone-20250710-上线前优化 2 days ago
no99 5190be38d6 首页跳转优化 2 days ago
宋杰 b92e820cb9 修复情绪大模型历史记录和输入的对话框不一致问题。 3 days ago
宋杰 b29bbedd2d 俩模型对话框一致。 3 days ago
宋杰 bca5a27e28 情绪大模型取消请求前次数判断,由工作流接口进行判断。 3 days ago
no99 90f61e6552 对接接口,差app跳转 3 days ago
宋杰 d23741ee48 Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into songjie/feature-20250628160649-上线前优化 3 days ago
宋杰 be9fc1cb0f 情绪大模型第一个接口请求失败后触发自动滚动。 3 days ago
宋杰 1c86468b86 解决情绪大模型交互图表时触发自动滚动的问题。 3 days ago
宋杰 b1539082be 解决思考过程缺少问题。 3 days ago
宋杰 dac54e1029 Merge branch 'songjie/feature-20250628160649-上线前优化' into milestone-20250710-上线前优化 4 days ago
宋杰 d91325b01d 修改测试配置文件。 4 days ago
宋杰 d48a94646c Merge branch 'songjie/feature-20250628160649-上线前优化' into milestone-20250710-上线前优化 4 days ago
宋杰 2701f1e080 修改打包文件; 4 days ago
宋杰 37856fe2ea Merge branch 'songjie/feature-20250628160649-上线前优化' into milestone-20250710-上线前优化 4 days ago
宋杰 c309ec0ec6 根据环境判断是否取消打印。 4 days ago
宋杰 cb7f4bc674 Merge branch 'songjie/feature-20250628160649-上线前优化' into milestone-20250710-上线前优化 4 days ago
宋杰 53827f94f1 去空格。 4 days ago
no99 b721e9018e app端跳转充值 4 days ago
宋杰 1581cae71f Merge branch 'milestone-20250710-上线前优化' of http://39.101.133.168:8807/hongxilin/AIxiaocaishen into milestone-20250710-上线前优化 4 days ago
宋杰 fed205d04e 手机端样式调整; 4 days ago
no99 25bc10c3eb 手机端适配 4 days ago
宋杰 4f687c2346 电脑端样式修改; 4 days ago
no99 596d0775b3 接获取兑换列表的接口 4 days ago
no99 f4ebc2be89 延时优化,按钮状态优化,提示问题优化 4 days ago
no99 b155be7b6d 音频状态更改时机修改 4 days ago
no99 cdd78b368c 当接口报错时,把chatStore.firstAPICall打开。 4 days ago
no99 9b0c067f53 发送消息不能换行问题,消息过长时,不靠右的问题 4 days ago
no99 5b0c0353e2 chat页面data接口根据环境判断接口。 4 days ago
no99 98677be472 打开兑换Token弹窗 4 days ago
  1. 11
      .env.development
  2. 1
      .env.production
  3. 7
      build/vite/build.js
  4. 51
      src/api/AIxiaocaishen.js
  5. 1
      src/store/chat.js
  6. 15
      src/store/dataList.js
  7. 64
      src/store/emotion.ts
  8. 46
      src/views/AIchat.vue
  9. 231
      src/views/AiEmotion.vue
  10. 2
      src/views/Announcement.vue
  11. 5
      src/views/Selectmodel.vue
  12. 16
      src/views/components/HistoryRecord.vue
  13. 1451
      src/views/components/emoEnergyConverter.vue
  14. 44
      src/views/components/emotionDecod.vue
  15. 40
      src/views/components/emotionalBottomRadar.vue
  16. 39
      src/views/components/marketTemperature.vue
  17. 528
      src/views/homePage.vue

11
.env.development

@ -5,10 +5,15 @@ VITE_OUTPUT_DIR = 'dev'
VITE_PUBLIC_PATH = /aixiaocaishen
#新数据接口
VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link"
# VITE_APP_API_BASE_URL = "https://api.homilychart.com/link"
VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link"
# VITE_APP_API_BASE_URL = "http://39.101.133.168:8828/link"
#金币数据接口
VITE_APP_API_BASE_URL = "https://hwjb.homilychart.com"
# VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link"
# VITE_APP_API_BASE_CAZE_URL = "https://api.homilychart.com/link"
VITE_APP_API_BASE_CAZE_URL = "https://hwjb.homilychart.com"
VITE_APP_API_BASE_HW_URL = "https://hwjb.homilychart.com/hljw"
VITE_APP_IMG_API_BASE_URL = "http://39.101.133.168:8828/hljw/api/aws/upload"
#MJ API

1
.env.production

@ -14,6 +14,7 @@ VITE_APP_API_BASE_URL = https://api.homilychart.com/link
VITE_APP_API_BASE_CAZE_URL = "https://api.homilychart.com/link"
# VITE_APP_API_BASE_CAZE_URL = "http://39.101.133.168:8828/link"
VITE_APP_API_BASE_HW_URL = "https://api.homilychart.com/hljw"
VITE_APP_IMG_API_BASE_URL = "https://api.homilychart.com/hljw/api/aws/upload"
#MJ API

7
build/vite/build.js

@ -1,5 +1,6 @@
export function createBuild(viteEnv) {
const { VITE_OUTPUT_DIR } = viteEnv;
const { VITE_OUTPUT_DIR, VITE_ENV } = viteEnv;
const env = VITE_ENV;
return {
sourcemap: false, // 是否启用
outDir: VITE_OUTPUT_DIR,
@ -36,8 +37,8 @@ export function createBuild(viteEnv) {
// 压缩配置
terserOptions: {
compress: {
drop_console: true, // 生产环境移除console
drop_debugger: true // 生产环境移除debugger
drop_console: env == "production", // 生产环境移除console
drop_debugger: env == "production" // 生产环境移除debugger
}
}
};

51
src/api/AIxiaocaishen.js

@ -3,6 +3,7 @@ import request from "../utils/request";
const APIurl = import.meta.env.VITE_APP_API_BASE_URL;
const cozeAPIurl = import.meta.env.VITE_APP_API_BASE_CAZE_URL;
const MJAPIurl = import.meta.env.VITE_APP_MJ_API_BASE_URL;
const HWurl = import.meta.env.VITE_APP_API_BASE_HW_URL;
//各个模块权限code接口
export const pessionAPI = function (params) {
return request({
@ -303,3 +304,53 @@ export const clickRecordAPI = function (params) {
data: params,
});
};
// 8.18金币兑换Token start
export const showExchangeAPI = function (params) {
return request({
url: `${APIurl}/api/showExchange`,
method: "POST",
data: params,
headers: {
token: localStorage.getItem("localToken"),
},
});
};
export const godExchangeAPI = function (params) {
return request({
url: `${APIurl}/api/godExchange`,
method: "POST",
data: params,
headers: {
token: localStorage.getItem("localToken"),
},
});
};
export const exchangeAPI = function (params) {
return request({
url: `${APIurl}/api/exchange`,
method: "POST",
data: params,
});
};
export const getGoldCoinAPI = function (params) {
return request({
url: `${HWurl}/api/haiwai/user/getGoldCoin`,
method: "POST",
data: params,
});
};
export const getUserInfoAPI = function (params) {
return request({
url: `${HWurl}/api/v2/member/info`,
method: "POST",
data: params,
});
};
// 8.18金币兑换Token end

1
src/store/chat.js

@ -40,6 +40,7 @@ export const useChatStore = defineStore("chat", {
this.kLineData.push(data);
},
},
persist: {
key: "chat_messages",
storage: sessionStorage,

15
src/store/dataList.js

@ -2,7 +2,7 @@ import { defineStore } from "pinia";
import { ref, watch } from "vue";
import { useUserStore } from "./userPessionCode";
import { useLanguage } from "@/utils/languageService";
import { dataListAPI } from "@/api/AIxiaocaishen";
import { dataListAPI, getUserInfoAPI } from "@/api/AIxiaocaishen";
// import { useSkeletonStore } from '@/utils/skeletonLoader'
import { useRoute } from "vue-router";
// const skeletonStore = useSkeletonStore()
@ -25,6 +25,7 @@ export const useDataStore = defineStore("data", () => {
const klineData = ref(null);
const activeTabIndex = ref(null);
const isFeedback = ref(false); // 用于控制是否显示反馈页面的标志
const userInfo = ref({});
const setKlineData = (data) => {
klineData.value = data;
};
@ -64,7 +65,7 @@ export const useDataStore = defineStore("data", () => {
const market = ref(getQueryVariable("market"));
const code = ref(getQueryVariable("code"));
console.log(token.value); // 输出 token 的值,例如 "111"
const fetchChartData = async (market,code) => {
const fetchChartData = async (market, code) => {
const getTokenString = String(localStorage.getItem("localToken"));
// const getMarketString = String(localStorage.getItem("localMarket"));
// const getCodeString = String(localStorage.getItem("localCode"));
@ -155,6 +156,14 @@ export const useDataStore = defineStore("data", () => {
return "";
};
const getUserInfo = async () => {
const getTokenString = String(localStorage.getItem("localToken"));
const res = await getUserInfoAPI({
token: getTokenString || "",
});
userInfo.value = res.data;
};
const isLoading = ref(true);
const initData = async () => {
isLoading.value = true;
@ -214,5 +223,7 @@ export const useDataStore = defineStore("data", () => {
getQueryVariable,
setActiveTabIndex,
isFeedback,
userInfo,
getUserInfo,
};
});

64
src/store/emotion.ts

@ -38,18 +38,41 @@ export const useEmotionStore = defineStore('emotion', {
},
// 添加新股票
addStock(stockData: StockData) {
// 验证必要字段
if (!stockData.stockInfo?.code || !stockData.stockInfo?.market || !stockData.timestamp) {
console.error('股票数据不完整,无法添加:', stockData);
return false;
}
// 生成唯一标识
const uniqueId = this.generateStockUniqueId(stockData);
// 检查是否已存在相同的股票
const existingStock = this.stockList.find(stock => {
const existingId = this.generateStockUniqueId(stock);
return existingId === uniqueId;
});
if (existingStock) {
console.log('股票已存在,切换到现有股票:', stockData.stockInfo.name);
// 找到现有股票的索引并切换
const existingIndex = this.stockList.indexOf(existingStock);
this.switchStock(existingIndex);
return false; // 返回false表示没有添加新股票
}
// 添加唯一标识到股票数据中
const stockWithId = {
...stockData,
uniqueId: uniqueId
};
// 添加新股票并设为当前激活
this.stockList.push(stockData);
this.stockList.push(stockWithId);
this.activeStockIndex = this.stockList.length - 1;
// 同时添加到历史记录
// this.addHistory({
// queryText: stockData.queryText,
// stockInfo: stockData.stockInfo,
// apiData: stockData.apiData,
// conclusionData: stockData.conclusionData,
// timestamp: stockData.timestamp
// });
console.log('成功添加新股票:', stockData.stockInfo.name, 'ID:', uniqueId);
return true; // 返回true表示成功添加新股票
},
// 切换股票
switchStock(index: number) {
@ -141,6 +164,14 @@ export const useEmotionStore = defineStore('emotion', {
};
}
},
// 生成股票唯一标识
generateStockUniqueId(stockData: StockData): string {
if (!stockData.stockInfo?.code || !stockData.stockInfo?.market) {
throw new Error('股票代码和市场信息不能为空');
}
// 使用 code + market + timestamp 确保唯一性
return `${stockData.stockInfo.code}_${stockData.stockInfo.market}_${stockData.timestamp}`;
}
},
});
@ -159,15 +190,16 @@ interface HistoryItem {
// 定义股票数据的类型
interface StockData {
queryText: string; // 用户输入的查询文本
queryText: string;
stockInfo: {
name: string; // 股票名称
code: string; // 股票代码
market: string; // 市场
name: string;
code: string;
market: string;
};
apiData: any; // API返回的完整数据
conclusionData?: string; // 第二个工作流接口返回的结论数据
timestamp: string; // 数据获取时间
apiData: any;
conclusionData?: string;
timestamp: string;
uniqueId?: string; // 添加唯一标识字段
}
// 定义对话消息的类型

46
src/views/AIchat.vue

@ -747,7 +747,7 @@ const createTypingEffect = (message, content, speed) => {
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -881,7 +881,7 @@ const createTypingEffect = (message, content, speed) => {
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -915,7 +915,7 @@ const createTypingEffect = (message, content, speed) => {
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -1115,7 +1115,6 @@ watch(
chatStore.messages.push(newVal[newVal.length - 1]);
chatStore.currentUserIndex = chatStore.messages.length - 1;
chatStore.inputUserIndex = chatStore.messages.length - 1;
console.log(
"消息列表已更新,最新消息:",
chatStore.messages[chatStore.messages.length - 1],
@ -1160,12 +1159,12 @@ watch(
codeData.value.name
);
}
for (let i = chatStore.messages.length - 1; i >= 0; --i) {
if (chatStore.messages[i].sender == "user") {
chatStore.messages[i].audioStatus = true;
break;
}
}
// for (let i = chatStore.messages.length - 1; i >= 0; --i) {
// if (chatStore.messages[i].sender == "user") {
// chatStore.messages[i].audioStatus = true;
// break;
// }
// }
chatStore.messages.push({
// class: "ing",
// type: "ing",
@ -1229,7 +1228,7 @@ watch(
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -1261,8 +1260,9 @@ watch(
const env = import.meta.env.VITE_ENV;
const result20 = await dataListAPI({
token:
// "8Csj5VVX1UbIb4C3oxrnbZi0+fEeMx8pywnIlrmTm45Cb/EllzWACLto9J9+fCFsfdgBOvKvyY94FvqlvM0",
"8nkj4QBV1RPIb4CzoRTnbZi0+fEeMx8pywnIlrmTxdwROKkuwWqAWu9orpkpeXVqL98DPfeonNYpHv+mucA",
env == "development" || env == "test"
? "8Csj5VVX1UbIb4C3oxrnbZi0+fEeMx8pywnIlrmTm45Cb/EllzWACLto9J9+fCFsfdgBOvKvyY94FvqlvM0"
: "8nkj4QBV1RPIb4CzoRTnbZi0+fEeMx8pywnIlrmTxdwROKkuwWqAWu9orpkpeXVqL98DPfeonNYpHv+mucA",
market: codeData.value.market,
code: codeData.value.code,
language: "cn", //t.value.suoxie,
@ -1562,6 +1562,9 @@ watch(
audioPreloadStatus.one.url
);
if (chatStore.currentUserIndex == chatStore.inputUserIndex) {
chatStore.messages[
chatStore.inputUserIndex
].audioStatus = true;
addToAudioQueue(audioPreloadStatus.one.url, "API1-第一个");
} else {
chatStore.messages[
@ -1821,7 +1824,7 @@ watch(
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -1931,7 +1934,7 @@ watch(
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -2130,7 +2133,7 @@ watch(
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试1111",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -2275,7 +2278,7 @@ watch(
class: "ing",
type: "ing",
flag: false,
content: "工作流返回出错,请稍后重试",
content: "系统正在为您努力加载中,请稍后再试",
});
chatStore.isLoading = false;
chatStore.chatInput = false;
@ -2469,10 +2472,12 @@ watch(
});
chatStore.isLoading = false;
chatStore.chatInput = false;
chatStore.firstAPICall = false;
emit("enableInput");
}
} catch (e) {
console.error("请求失败:", e);
chatStore.firstAPICall = false;
hasValidData.value = false; //
// chatStore.messages.pop();
// chatStore.messages.push({
@ -4948,7 +4953,7 @@ p {
/* 用户消息容器样式 */
.user-message-container {
display: flex;
/* align-items: flex-start; */
align-items: flex-end;
margin: 10px 0px;
justify-content: flex-end;
gap: 10px;
@ -4958,6 +4963,8 @@ p {
.user-msg {
margin-left: auto;
display: flex;
flex-direction: column;
}
.user-content {
@ -4965,6 +4972,7 @@ p {
height: 100%;
align-items: center;
margin-right: 5px;
justify-content: flex-end;
}
.user-sendTime {
@ -5009,9 +5017,9 @@ p {
font-weight: bold;
border-radius: 10px;
margin: 0;
width: fit-content;
display: flex;
align-items: center;
word-break: break-word; /* 启用强制换行 */
}
.message-bubble.ai {

231
src/views/AiEmotion.vue

@ -538,35 +538,39 @@ const loadConversationsFromStockList = () => {
//
emotionStore.stockList.forEach((stock) => {
const stockKey = `${stock.stockInfo.code}_${stock.timestamp}`;
//
if (!stock?.stockInfo?.code || !stock?.timestamp || !stock?.queryText) {
console.warn('股票数据不完整,跳过添加:', stock);
return;
}
// 使
const stockKey = getStockUniqueId(stock);
if (!stockKey) {
console.warn('无法生成股票唯一标识,跳过添加:', stock);
return;
}
//
//
if (!addedStocks.value.has(stockKey)) {
// messages
const existingMessage = messages.value.find(
const existingInMessages = messages.value.find(
(msg) => msg.sender === "user" && msg.text === stock.queryText
);
// messages
if (!existingMessage) {
// AI
const userMessage = {
sender: "user",
text: stock.queryText,
};
messages.value.push(userMessage);
// emotion storestore
const storeConversations = emotionStore.getConversations();
const existingInStore = storeConversations.find(
(conv) => conv.sender === "user" && conv.text === stock.queryText
);
if (!existingInStore) {
emotionStore.addConversation(userMessage);
}
}
//
// if (!existingInMessages && !existingInStore) {
// const userMessage = {
// sender: "user",
// text: stock.queryText,
// };
// messages.value.push(userMessage);
// emotionStore.addConversation(userMessage);
// }
addedStocks.value.add(stockKey);
}
});
@ -584,6 +588,13 @@ const clearConversations = () => {
const addStock = (stockData) => {
console.log("AiEmotion组件接收到股票数据:", stockData);
//
if (!stockData || !stockData.stockInfo || !stockData.stockInfo.code) {
console.error('addStock: 股票数据不完整', stockData);
emit('enableInput');
return;
}
//
isHistoryMode.value = true;
isUserInitiated.value = false;
@ -694,9 +705,27 @@ const stockAudioStates = ref(new Map());
//
const getStockUniqueId = (stock) => {
//
if (!stock || typeof stock !== 'object') {
console.warn('getStockUniqueId: 无效的股票对象');
return null;
}
// 使uniqueId
if (stock.uniqueId) {
return stock.uniqueId;
}
//
const stockCode = stock.stockInfo?.code || stock.stockInfo?.symbol;
const timestamp = stock.timestamp;
return stockCode && timestamp ? `${stockCode}_${timestamp}` : stockCode;
if (!stockCode || !timestamp) {
console.warn('getStockUniqueId: 缺少必要字段', { stockCode, timestamp });
return null;
}
return `${stockCode}_${timestamp}`;
};
//
const currentOnCompleteCallback = ref(null);
@ -708,7 +737,10 @@ const isAudioPlaying = ref(false);
//
const getStockAudioState = (stock) => {
const stockUniqueId = getStockUniqueId(stock);
if (!stockUniqueId) return { isPlaying: false, isPaused: false };
if (!stockUniqueId) {
console.warn('getStockAudioState: 无法获取股票唯一标识');
return { isPlaying: false, isPaused: false };
}
return (
stockAudioStates.value.get(stockUniqueId) || {
@ -721,7 +753,15 @@ const getStockAudioState = (stock) => {
//
const setStockAudioState = (stock, state) => {
const stockUniqueId = getStockUniqueId(stock);
if (!stockUniqueId) return;
if (!stockUniqueId) {
console.warn('setStockAudioState: 无法获取股票唯一标识');
return;
}
if (!state || typeof state !== 'object') {
console.warn('setStockAudioState: 无效的状态对象');
return;
}
stockAudioStates.value.set(stockUniqueId, { ...state });
};
@ -870,21 +910,30 @@ const getStockConclusion = (stock) => {
//
const getStockTypewriterTexts = (stock) => {
const stockUniqueId = getStockUniqueId(stock);
if (!stockUniqueId) return null;
if (!stockUniqueId) {
console.warn('getStockTypewriterTexts: 无法获取股票唯一标识');
return null;
}
return stockTypewriterTexts.value.get(stockUniqueId) || null;
};
//
const getStockTypewriterVisibility = (stock) => {
const stockUniqueId = getStockUniqueId(stock);
if (!stockUniqueId) return null;
if (!stockUniqueId) {
console.warn('getStockTypewriterVisibility: 无法获取股票唯一标识');
return null;
}
return stockTypewriterVisibility.value.get(stockUniqueId) || null;
};
//
const isStockTypewriting = (stock) => {
const stockUniqueId = getStockUniqueId(stock);
if (!stockUniqueId) return false;
if (!stockUniqueId) {
console.warn('isStockTypewriting: 无法获取股票唯一标识');
return false;
}
return stockTypewriterShown.value.has(stockUniqueId) && !stockTypewriterTexts.value.has(stockUniqueId);
};
@ -943,7 +992,7 @@ watch(
hasTriggeredAudio.value = false;
hasTriggeredTypewriter.value = false;
//
// 使uniqueId
const stockUniqueId = getStockUniqueId(newStock);
// URL
@ -955,10 +1004,10 @@ watch(
? newStock.conclusionData
: JSON.parse(newStock.conclusionData);
//
if (stockUniqueId && stockTypewriterShown.value.has(stockUniqueId)) {
//
// URL
const shouldShowTypewriter = stockUniqueId && stockTypewriterTexts.value.has(stockUniqueId);
if (!shouldShowTypewriter) {
// URL
let voiceUrl = null;
// 使one1_urlURL
@ -2053,31 +2102,31 @@ async function handleSendMessage(input, onComplete) {
});
//
await chatStore.getUserCount(); //
if (chatStore.UserCount <= 0) {
const aiMessage = reactive({
sender: "ai",
text: "您的剩余次数为0,无法使用情绪大模型,请联系客服或购买服务包。",
});
messages.value.push(aiMessage);
// await chatStore.getUserCount(); //
// if (chatStore.UserCount <= 0) {
// const aiMessage = reactive({
// sender: "ai",
// text: "0使",
// });
// messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "您的剩余次数为0,无法使用情绪大模型,请联系客服或购买服务包。",
timestamp: new Date().toISOString(),
});
//
isRotating.value = false;
messages.value = [...previousMessages, ...messages.value];
//
if (onComplete && typeof onComplete === "function") {
onComplete();
//
currentOnCompleteCallback.value = null;
}
return;
}
// // AIemotion store
// emotionStore.addConversation({
// sender: "ai",
// text: "0使",
// timestamp: new Date().toISOString(),
// });
// //
// isRotating.value = false;
// messages.value = [...previousMessages, ...messages.value];
// //
// if (onComplete && typeof onComplete === "function") {
// onComplete();
// //
// currentOnCompleteCallback.value = null;
// }
// return;
// }
//
const thinkingMessageRef = await showThinkingProcess();
@ -2123,7 +2172,7 @@ async function handleSendMessage(input, onComplete) {
// refuse
// isLoading.value = false;
isPageLoaded.value = false;
const refuseMessage = response && response.msg ? response.msg : "接口返回数据异常,请重试";
const refuseMessage = response && response.msg ? response.msg : "系统正在为您努力加载中,请稍后再试";
const aiMessage = reactive({
sender: "ai",
text: processRefuseMessage(refuseMessage),
@ -2138,6 +2187,12 @@ async function handleSendMessage(input, onComplete) {
});
isRotating.value = false;
messages.value = [...previousMessages, ...messages.value];
//
nextTick(() => {
scrollToBottom();
});
//
if (onComplete && typeof onComplete === "function") {
onComplete();
@ -2152,7 +2207,7 @@ async function handleSendMessage(input, onComplete) {
if (thinkingMessageRef && parsedData.name) {
thinkingMessage3Ref = await continueThinkingProcess(
thinkingMessageRef,
// parsedData.name
parsedData.name
);
}
//
@ -2170,6 +2225,33 @@ async function handleSendMessage(input, onComplete) {
};
console.log("第二个接口参数:", conclusionParams);
// Promise.all
const stockUniqueId = `${parsedData.code}_${parsedData.market}_${new Date().toISOString()}`;
const isFirstTime = !stockTypewriterShown.value.has(stockUniqueId);
//
if (isFirstTime && isUserInitiated.value) {
//
console.log('预设股票为打字机模式:', parsedData.name);
stockTypewriterTexts.value.set(stockUniqueId, {
one1: "", one2: "", two: "", three: "", four: "", disclaimer: ""
});
stockTypewriterVisibility.value.set(stockUniqueId, {
one: false, two: false, three: false, four: false, disclaimer: false
});
} else {
//
console.log('预设股票为完整显示模式:', parsedData.name);
stockTypewriterTexts.value.delete(stockUniqueId);
stockTypewriterVisibility.value.delete(stockUniqueId);
//
if (isFirstTime) {
stockTypewriterShown.value.set(stockUniqueId, true);
stockAudioPlayed.value.set(stockUniqueId, true);
}
}
// fetchData
const [conclusionResult, fetchDataResult] = await Promise.all([
getConclusionAPI(conclusionParams),
@ -2178,7 +2260,8 @@ async function handleSendMessage(input, onComplete) {
parsedData.market,
parsedData.name || "未知股票",
input.trim(),
parsedData.stockId
parsedData.stockId,
stockUniqueId //
),
]);
@ -2196,7 +2279,7 @@ async function handleSendMessage(input, onComplete) {
}
// 使getConclusionAPImsg
const errorMsg = conclusionResponse.msg || "第二个接口请求失败";
const errorMsg = conclusionResponse.msg || "系统正在为您努力加载中,请稍后再试";
const aiMessage = reactive({
sender: "ai",
text: errorMsg,
@ -2327,7 +2410,7 @@ async function handleSendMessage(input, onComplete) {
if (!conclusionResponse || !conclusionResponse.data) {
const aiMessage = reactive({
sender: "ai",
text: "网络加载失败,请重试",
text: "系统正在为您努力加载中,请稍后再试",
});
messages.value.push(aiMessage);
}
@ -2430,7 +2513,7 @@ async function handleSendMessage(input, onComplete) {
}
//
async function fetchData(code, market, stockName, queryText, stockId) {
async function fetchData(code, market, stockName, queryText, stockId, presetUniqueId = null) {
try {
const stockDataParams = {
stockId: stockId,
@ -2486,14 +2569,14 @@ async function fetchData(code, market, stockName, queryText, stockId) {
const aiMessage = reactive({
sender: "ai",
text: `数据丢失了,请稍后重试。`,
text: `系统正在为您努力加载中,请稍后再试`,
});
messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "数据丢失了,请稍后重试。",
text: "系统正在为您努力加载中,请稍后再试",
timestamp: new Date().toISOString(),
});
return false; //
@ -2510,6 +2593,7 @@ async function fetchData(code, market, stockName, queryText, stockId) {
apiData: stockDataResponse.data,
conclusionData: conclusionData.value, //
timestamp: new Date().toISOString(),
uniqueId: presetUniqueId || `${code}_${market}_${new Date().toISOString()}`, //
};
// storeStockTabs
emotionStore.addStock(stockData);
@ -2546,14 +2630,14 @@ async function fetchData(code, market, stockName, queryText, stockId) {
const aiMessage = reactive({
sender: "ai",
text: "图表数据请求失败,请检查网络连接",
text: "系统正在为您努力加载中,请稍后再试",
});
messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "图表数据请求失败,请检查网络连接",
text: "系统正在为您努力加载中,请稍后再试",
timestamp: new Date().toISOString(),
});
return false; //
@ -2590,14 +2674,14 @@ async function fetchData(code, market, stockName, queryText, stockId) {
const aiMessage = reactive({
sender: "ai",
text: "图表数据请求失败,请检查网络连接",
text: "系统正在为您努力加载中,请稍后再试",
});
messages.value.push(aiMessage);
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "图表数据请求失败,请检查网络连接",
text: "系统正在为您努力加载中,请稍后再试",
timestamp: new Date().toISOString(),
});
return false; //
@ -2717,8 +2801,9 @@ async function renderChartsSequentially(clonedData, stockIndex = 0) {
if (typeof config.ref[config.method] === "function") {
try {
// DOM
await new Promise((resolve) => setTimeout(resolve, 100));
// 2
const delay = stockIndex === 0 ? 100 : 300 + (stockIndex * 100);
await new Promise((resolve) => setTimeout(resolve, delay));
config.ref[config.method](...config.params);
console.log(`${stockIndex}个股票的${config.name}图表渲染成功`);
@ -2875,7 +2960,7 @@ function renderCharts(data) {
// AIemotion store
emotionStore.addConversation({
sender: "ai",
text: "图表渲染失败,请重试",
text: "系统正在为您努力加载中,请稍后再试",
timestamp: new Date().toISOString(),
});
}
@ -4097,6 +4182,14 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat", "enabl
margin-right: 5px;
}
/* 确保历史记录模式下用户消息也能正确换行 */
.user-content .user-message {
white-space: pre-wrap;
word-wrap: break-word;
word-break: break-word;
overflow-wrap: break-word;
}
.user-message-speaker {
width: 32px;
height: 32px;
@ -4141,7 +4234,7 @@ const emit = defineEmits(["updateMessage", "sendMessage", "ensureAIchat", "enabl
font-weight: bold;
padding: 15px 20px;
border-radius: 15px;
max-width: 60%;
max-width: 80%;
text-align: left;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
margin: 0;

2
src/views/Announcement.vue

@ -114,7 +114,7 @@ onMounted(() => {
<div class="announcement">
<p class="announcementItem">各位AI小财神的用户,大家好!</p>
<p class="announcementItem">
试运行期间,用户可在AI小财神中查看全市场数据,每个市场可查看20只股票.
试运行期间,用户可在AI小财神中查看全市场数据,每个市场可查看一定数量的股票.
</p>
<p class="announcementItem">以下为各个市场可以查看的股票</p>
<!-- <p class="announcementItem">历软件云版静态市场一致!</p>

5
src/views/Selectmodel.vue

@ -34,8 +34,7 @@ import { onMounted, ref } from "vue";
import { useRouter } from "vue-router";
import { setHeight } from "@/utils/setHeight";
import { useDataStore } from "@/store/dataList.js";
const { getQueryVariable, setActiveTabIndex } = useDataStore();
const { getQueryVariable, setActiveTabIndex, getUserInfo } = useDataStore();
import robot from "@/assets/img/Selectmodel/机器人 拷贝.png";
const router = useRouter();
@ -59,6 +58,8 @@ onMounted(() => {
// "localToken",
// "pCtw6AYK0EHAaIexoFHsbZjtsfEAIhcmwkCFm6uKko8VPfMvyDiODL9v9c0veic9fIpQbvT8zN4sH/Si6Q"
// );
getUserInfo();
});
const goToDBQBmodel = () => {

16
src/views/components/HistoryRecord.vue

@ -16,7 +16,7 @@
<img
class="collapsed-toggle-btn"
@click="openHistory"
src="https://d31zlh4on95l9h.cloudfront.net/images/b2d784f8607ab65081f5289459581bfe.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/815e7ebfb1963eadca9435e82c3c4a8d.png"
alt="icon"
title="打开边栏"
/>
@ -30,7 +30,7 @@
>
<img
class="collapsed-bottom-announcement"
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/172be9b9c4d936f2f6b182ef7a4bed10.png"
alt="icon"
/>
</div>
@ -41,7 +41,7 @@
>
<img
class="collapsed-bottom-feedback"
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/ed88a0a7095c3cd1e0b51ffcca7f4068.png"
alt="icon"
/>
</div>
@ -62,7 +62,7 @@
<img
class="toggle-btn"
@click="closeHistory"
src="https://d31zlh4on95l9h.cloudfront.net/images/b2d784f8607ab65081f5289459581bfe.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/815e7ebfb1963eadca9435e82c3c4a8d.png"
alt="icon"
title="收起边栏"
/>
@ -184,14 +184,14 @@
<div class="bottom-btn" @click="handleAnnouncementClick" title="公告">
<img
class="bottom-announcement"
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/172be9b9c4d936f2f6b182ef7a4bed10.png"
alt="icon"
/>
</div>
<div class="bottom-btn" @click="handleFeedbackClick" title="用户反馈">
<img
class="bottom-feedback"
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/ed88a0a7095c3cd1e0b51ffcca7f4068.png"
alt="icon"
/>
</div>
@ -346,7 +346,7 @@
>
<img
class="mobile-bottom-announcement"
src="https://d31zlh4on95l9h.cloudfront.net/images/c51c7fbb68671729801fb10d65bd7789.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/172be9b9c4d936f2f6b182ef7a4bed10.png"
alt="icon"
/>
<div class="mobile-bottom-text">公告</div>
@ -358,7 +358,7 @@
>
<img
class="mobile-bottom-feedback"
src="https://d31zlh4on95l9h.cloudfront.net/images/41d6e25c19466718d462bcee2f050140.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/ed88a0a7095c3cd1e0b51ffcca7f4068.png"
alt="icon"
/>
<div class="mobile-bottom-text">用户反馈</div>

1451
src/views/components/emoEnergyConverter.vue
File diff suppressed because it is too large
View File

44
src/views/components/emotionDecod.vue

@ -406,6 +406,12 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
],
};
// DOM
if (!KlineCanvs.value) {
console.error('DOM元素未准备好,无法初始化ECharts');
return;
}
// echarts
if (KlineCanvsChart) {
KlineCanvsChart.dispose();
@ -413,6 +419,44 @@ function initQXNLZHEcharts(kline, qxnlzhqData) {
KlineCanvsChart = echarts.init(KlineCanvs.value);
KlineCanvsChart.setOption(KlineOption);
//
if (KlineCanvsChart) {
//
KlineCanvsChart.on('dataZoom', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
KlineCanvsChart.on('mousewheel', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
KlineCanvsChart.on('mousedown', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
KlineCanvsChart.on('mouseup', () => {
if (window.handleChartInteractionEnd) {
window.handleChartInteractionEnd();
}
});
//
KlineCanvsChart.on('click', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
}
// resize
const debounce = (func, wait) => {
let timeout;

40
src/views/components/emotionalBottomRadar.vue

@ -416,7 +416,7 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
color: 'white',
formatter: function (value, index) {
//
return value.toFixed(1);
return value.toFixed(0);
}
},
splitLine: {
@ -677,6 +677,44 @@ function initEmotionalBottomRadar(KlineData, barAndLineData) {
// 使
bottomRadarChart.setOption(option)
//
if (bottomRadarChart) {
//
bottomRadarChart.on('dataZoom', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
bottomRadarChart.on('mousewheel', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
bottomRadarChart.on('mousedown', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
bottomRadarChart.on('mouseup', () => {
if (window.handleChartInteractionEnd) {
window.handleChartInteractionEnd();
}
});
//
bottomRadarChart.on('click', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
}
//
if (bottomRadarRef.value) {
applyResponsiveStyles(bottomRadarRef.value);

39
src/views/components/marketTemperature.vue

@ -678,6 +678,45 @@ function initChart(raw, klineDataRawValue, WDRLValue) {
},
],
});
//
if (chartInstance) {
//
chartInstance.on('dataZoom', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
chartInstance.on('mousewheel', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
chartInstance.on('mousedown', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
//
chartInstance.on('mouseup', () => {
if (window.handleChartInteractionEnd) {
window.handleChartInteractionEnd();
}
});
//
chartInstance.on('click', () => {
if (window.handleChartInteractionStart) {
window.handleChartInteractionStart();
}
});
}
// resize
const debounce = (func, wait) => {
let timeout;

528
src/views/homePage.vue

@ -2,7 +2,13 @@
//
import { ref, computed, onMounted, watch, nextTick, onUnmounted, h } from "vue";
import { setHeight } from "../utils/setHeight";
import { getUserCountAPI } from "../api/AIxiaocaishen";
import {
getUserCountAPI,
showExchangeAPI,
godExchangeAPI,
exchangeAPI,
getGoldCoinAPI,
} from "../api/AIxiaocaishen";
import { ElMessage } from "element-plus";
import AIchat from "./AIchat.vue";
import AIfind from "./AIfind.vue";
@ -45,7 +51,7 @@ const aiEmotionRef = ref(null);
// ref
const historyRecordRef = ref(null);
// import { useUserStore } from "../store/userPessionCode.js";
const { getQueryVariable, setActiveTabIndex } = useDataStore();
const { getQueryVariable, setActiveTabIndex, getUserInfo } = useDataStore();
const dataStore = useDataStore();
const chatStore = useChatStore();
//
@ -348,17 +354,6 @@ const showFeedback = () => {
}
};
//
// ref
const dialogVisible = ref(false);
//
const showCount = () => {
console.log("显示剩余次数");
//
// dialogVisible.value = true;
console.log("dialogVisible 的值:", dialogVisible.value); //
};
//
const tabContentAIchat = ref(null);
@ -370,12 +365,14 @@ const aiEmotionHeightObserver = ref(null);
const isAiEmotionAutoScrollEnabled = ref(false);
const isAiEmotionUserScrolling = ref(false); //
const aiEmotionScrollTimer = ref(null); //
const isChartInteracting = ref(false); //
const chartInteractionTimer = ref(null); //
//
const getCurrentScrollContainer = () => {
if (activeTab.value === 'AIchat') {
if (activeTab.value === "AIchat") {
return tabContentAIchat.value;
} else if (activeTab.value === 'AiEmotion') {
} else if (activeTab.value === "AiEmotion") {
return tabContentAiEmotion.value;
}
return null;
@ -406,7 +403,12 @@ const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 300, {
// AiEmotion
const debouncedAiEmotionScrollToBottom = _.debounce(() => {
if (activeTab.value === 'AiEmotion' && isAiEmotionAutoScrollEnabled.value && !isAiEmotionUserScrolling.value) {
if (
activeTab.value === "AiEmotion" &&
isAiEmotionAutoScrollEnabled.value &&
!isAiEmotionUserScrolling.value &&
!isChartInteracting.value
) {
const container = tabContentAiEmotion.value;
if (container) {
container.scrollTop = container.scrollHeight - container.offsetHeight;
@ -423,7 +425,11 @@ const startAiEmotionHeightObserver = () => {
// ResizeObserver
aiEmotionHeightObserver.value = new ResizeObserver((entries) => {
if (isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') {
if (
isAiEmotionAutoScrollEnabled.value &&
activeTab.value === "AiEmotion" &&
!isChartInteracting.value
) {
debouncedAiEmotionScrollToBottom();
}
});
@ -454,7 +460,12 @@ const startAiEmotionHeightObserver = () => {
}
});
if (shouldScroll && isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') {
if (
shouldScroll &&
isAiEmotionAutoScrollEnabled.value &&
activeTab.value === "AiEmotion" &&
!isChartInteracting.value
) {
debouncedAiEmotionScrollToBottom();
}
});
@ -475,7 +486,9 @@ const startAiEmotionHeightObserver = () => {
// AiEmotion
if (aiEmotionContainer) {
aiEmotionContainer.addEventListener('scroll', handleAiEmotionUserScroll, { passive: true });
aiEmotionContainer.addEventListener("scroll", handleAiEmotionUserScroll, {
passive: true,
});
// 便
aiEmotionHeightObserver.value.scrollListener = handleAiEmotionUserScroll;
}
@ -500,9 +513,37 @@ const handleAiEmotionUserScroll = () => {
// }, 2000);
};
//
const handleChartInteractionStart = () => {
console.log("图表交互开始,临时禁用自动滚动");
isChartInteracting.value = true;
//
if (chartInteractionTimer.value) {
clearTimeout(chartInteractionTimer.value);
}
};
const handleChartInteractionEnd = () => {
//
if (chartInteractionTimer.value) {
clearTimeout(chartInteractionTimer.value);
}
// 1
chartInteractionTimer.value = setTimeout(() => {
isChartInteracting.value = false;
console.log("图表交互结束,恢复自动滚动");
}, 1000);
};
// 使
window.handleChartInteractionStart = handleChartInteractionStart;
window.handleChartInteractionEnd = handleChartInteractionEnd;
// AiEmotion
const handleAiEmotionScrollToBottom = () => {
if (activeTab.value === 'AiEmotion') {
if (activeTab.value === "AiEmotion") {
const container = tabContentAiEmotion.value;
if (container) {
// 使nextTickDOM
@ -536,8 +577,14 @@ const stopAiEmotionHeightObserver = () => {
}
//
if (aiEmotionHeightObserver.value.scrollListener && tabContentAiEmotion.value) {
tabContentAiEmotion.value.removeEventListener('scroll', aiEmotionHeightObserver.value.scrollListener);
if (
aiEmotionHeightObserver.value.scrollListener &&
tabContentAiEmotion.value
) {
tabContentAiEmotion.value.removeEventListener(
"scroll",
aiEmotionHeightObserver.value.scrollListener
);
aiEmotionHeightObserver.value.scrollListener = null;
}
@ -807,7 +854,8 @@ const touchmoveHandler = (e) => {
}
//
const currentContainer = getCurrentScrollContainer();
const isScrollableArea = currentContainer && currentContainer.contains(e.target);
const isScrollableArea =
currentContainer && currentContainer.contains(e.target);
//
if (!isScrollableArea) {
@ -875,12 +923,14 @@ const backToHome = () => {
if (env == "development" || env == "test") {
window.parent.location.href =
"http://121.89.234.155:8807/hljw/homepage?menu=999999991";
} else if (env == "product") {
window.parent.location.href =
"https://web.homilychart.com/product/hljw/homepage?menu=999999991";
} else if (env == "production") {
window.parent.location.href =
"https://web.homilychart.com/hljw/homepage?menu=999999991";
} else {
window.parent.postMessage(
{
type: "NAVIGATE_TO_HOMEPAGE",
menu: "999999991",
},
"*"
);
}
// window.parent.location.href = window.parent.document.referrer
}
@ -888,11 +938,14 @@ const backToHome = () => {
// 8.18Token start
const userInfo = ref({
username: "HomilyLink",
jwcode: "90042088",
img: " https://d31zlh4on95l9h.cloudfront.net/images/403ef762dd2f335df3b0c9e3fe488375.png",
nickname: "",
img: "",
jwcode: "",
});
const changeRule = ref({
gold: 1,
token: 1,
});
const changeRule = ref("1金币=1Token");
const changeLevelList = ref([
{ position: 10, calculatedPosition: 10 },
{ position: 20, calculatedPosition: 20 },
@ -905,12 +958,59 @@ const changeLevelList = ref([
const activeLevel = ref(
changeLevelList.value[0] || { position: 10, calculatedPosition: 10 }
);
const gold = ref(100);
const gold = ref(90);
//
// ref
const dialogVisible = ref(false);
const rechargeDialogVisible = ref(false);
const confirmDialogVisible = ref(false);
const changeSuccessDialogVisible = ref(false);
//
const handleImageError = (event) => {
console.error("图片加载失败:", event.target.src);
//
event.target.src =
"https://cdn.legu168.com/jtzy/Product/pcjingwang/images/userimg.png";
};
//
const showCount = async () => {
try {
if (
!dataStore.userInfo.img ||
!dataStore.userInfo.nickname ||
!dataStore.userInfo.jwcode
) {
console.log("缺少用户信息,调用方法");
await getUserInfo();
}
userInfo.value.nickname = dataStore.userInfo.nickname;
userInfo.value.img = dataStore.userInfo.img;
userInfo.value.jwcode = dataStore.userInfo.jwcode;
console.log("userInfo", userInfo.value);
const [res, res2] = await Promise.all([
showExchangeAPI(),
getGoldCoinAPI({
token: String(localStorage.getItem("localToken")),
}),
]);
changeLevelList.value = res.data;
activeLevel.value = changeLevelList.value[0];
changeRule.value.token = res.data[0].ratio;
gold.value = res2.data.total;
//
dialogVisible.value = true;
console.log("dialogVisible 的值:", dialogVisible.value); //
} catch (e) {
console.error("获取兑换列表出错", e);
}
};
const chooseLevel = (item) => {
activeLevel.value = item;
};
@ -925,37 +1025,65 @@ const changeToken = () => {
};
const goRecharge = () => {
console.log("执行前往充值方法");
sessionStorage.setItem("rechargeFlag", "1");
sessionStorage.setItem("activeLevel", JSON.stringify(activeLevel.value));
if (isMobile.value) {
console.log("用户是移动端");
uni.postMessage({
data: {
val: {
name: "JWopenView",
extra: {
data: {
type: 4,
},
},
},
},
});
} else {
console.log("用户是pc端");
const env = import.meta.env.VITE_ENV;
console.log("当前的环境为:", env);
if (env == "development" || env == "test") {
window.parent.location.href =
"http://192.168.1.24:8080/user/myGold?token=" +
localStorage.getItem("localToken") +
"&where=xiaocaishen&successUrl=http://192.168.1.5:3000/aixiaocaishen/homePage";
} else if (env == "product") {
// window.parent.location.href =
// 'https://web.homilychart.com/product/hljw/homepage?menu=999999991'
} else if (env == "production") {
// window.parent.location.href = 'https://web.homilychart.com/hljw/homepage?menu=999999991'
"http://121.89.234.155:8807/user/myGold?token=" +
encodeURIComponent(localStorage.getItem("localToken")) +
"&where=xiaocaishen&successUrl=https://hwjb.homilychart.com/aixiaocaishen/homePage";
// "&where=xiaocaishen&successUrl=http://192.168.1.5:3000/aixiaocaishen/homePage";
} else {
window.parent.location.href =
"https://web.homilychart.com/user/myGold?token=" +
encodeURIComponent(localStorage.getItem("localToken")) +
"&where=xiaocaishen&successUrl=https://mp.homilychart.com/aixiaocaishen/homePage";
}
// window.parent.location.href = window.parent.document.referrer
}
};
const goChange = () => {
const goChange = async () => {
try {
await exchangeAPI({
token: String(localStorage.getItem("localToken")),
num: activeLevel.value.position,
});
confirmDialogVisible.value = false;
dialogVisible.value = false;
changeSuccessDialogVisible.value = true;
setTimeout(() => {
changeSuccessDialogVisible.value = false;
}, 3000);
}, 2000);
//
await chatStore.getUserCount();
} catch (e) {
console.error("兑换失败", e);
}
};
// 8.18Token end
onMounted(async () => {
@ -984,12 +1112,39 @@ onMounted(async () => {
//
window.addEventListener("resize", throttledJudgeDevice);
if (getQueryVariable("successType") == "success") {
dialogVisible.value = true;
window.parent.location.href = window.parent.location.href.replace(
"successType=success",
""
);
window.receiveUniAppMessage = async function (messageData) {
console.log("收到 uni-app 消息:", messageData);
//
switch (messageData.type) {
case "paymentSuccess":
//
const [res1, res2] = await Promise.all([
godExchangeAPI({ state: 1 }),
getGoldCoinAPI({ token: String(localStorage.getItem("localToken")) }),
]);
gold.value = res2.data.total;
rechargeDialogVisible.value = false;
break;
default:
console.log("未知消息类型:", messageData.type);
}
};
if (
sessionStorage.getItem("rechargeFlag") == "1" &&
getQueryVariable("successType") == "success"
) {
await godExchangeAPI({ state: 1 });
await showCount();
activeLevel.value =
JSON.parse(sessionStorage.getItem("activeLevel")) ||
changeLevelList.value[0];
console.log("activeLevel", activeLevel.value);
sessionStorage.removeItem("activeLevel");
sessionStorage.setItem("rechargeFlag", "0");
}
});
@ -1001,6 +1156,19 @@ onUnmounted(() => {
}
// AiEmotion
stopAiEmotionHeightObserver();
delete window.receiveUniAppMessage;
//
if (chartInteractionTimer.value) {
clearTimeout(chartInteractionTimer.value);
}
if (window.handleChartInteractionStart) {
delete window.handleChartInteractionStart;
}
if (window.handleChartInteractionEnd) {
delete window.handleChartInteractionEnd;
}
});
</script>
@ -1055,7 +1223,7 @@ onUnmounted(() => {
</div>
<div class="backToHomeBtn" @click="backToHome()">
<img
src="https://d31zlh4on95l9h.cloudfront.net/images/d8b388e461423f79087ddbe016002217.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
alt="返回首页"
class="backImg"
/>
@ -1101,11 +1269,10 @@ onUnmounted(() => {
<div class="pc-count-number">{{ UserCount }}</div>
</div>
<div class="pc-clickGetCount">点击获取Token</div>
</div>
<div class="pc-backToHomeBtn" @click="backToHome()">
<img
src="https://d31zlh4on95l9h.cloudfront.net/images/d8b388e461423f79087ddbe016002217.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
alt="返回首页"
class="pc-backImg"
/>
@ -1263,7 +1430,7 @@ onUnmounted(() => {
</div>
<div class="backToHomeBtn" @click="backToHome()">
<img
src="https://d31zlh4on95l9h.cloudfront.net/images/d8b388e461423f79087ddbe016002217.png"
src="https://d31zlh4on95l9h.cloudfront.net/images/9cbc5b2eb2327bd04d015c19d8c3f1f9.png"
alt="返回首页"
class="backImg"
/>
@ -1289,19 +1456,26 @@ onUnmounted(() => {
</el-container>
<!-- 弹窗 -->
<!-- 新增弹窗组件 -->
<el-dialog v-model="dialogVisible" :width="isMobile ? '80%' : '60%'">
<el-dialog v-if="!isMobile" v-model="dialogVisible" width="48%">
<!-- 中间内容部分 -->
<div class="changeMsg">
<div class="changeInfo">
<div class="changeImg">
<img :src="userInfo.img" alt="头像" class="changeImgClass" />
<img
:src="userInfo.img"
alt="头像"
class="changeImgClass"
@error="handleImageError"
/>
</div>
<div class="changeContent">
<div class="changeUsername">{{ userInfo.username }}</div>
<div class="changeUsername">{{ userInfo.nickname }}</div>
<div class="changeJwcode">精网号{{ userInfo.jwcode }}</div>
</div>
</div>
<div class="changeRule">兑换规则{{ changeRule }}</div>
<div class="changeRule">
兑换规则{{ changeRule.gold }}金币={{ changeRule.token }}Token
</div>
</div>
<div class="changeLevel">
<div class="changeLevelTitle">兑换Token</div>
@ -1338,9 +1512,67 @@ onUnmounted(() => {
<div class="changeBtn" @click="changeToken">立即兑换</div>
</el-dialog>
<el-dialog v-else v-model="dialogVisible" width="80%">
<!-- 中间内容部分 -->
<div class="changeMsg">
<div class="changeInfo">
<div class="changeImg">
<img
:src="userInfo.img"
alt="头像"
class="changeImgClass"
@error="handleImageError"
/>
</div>
<div class="changeContent">
<div class="changeJwcode">精网号{{ userInfo.jwcode }}</div>
</div>
</div>
</div>
<div class="changeLevel">
<div class="changeLevelTitle">
兑换Token
<div class="changeRule">
(兑换规则{{ changeRule.gold }}金币={{ changeRule.token }}Token)
</div>
</div>
<div class="changeLevelContent">
<div
class="changeLevelItems"
v-for="item in changeLevelList"
:key="item"
:class="{
changeLevelItemsActive: item.position == activeLevel.position,
}"
@click="chooseLevel(item)"
>
<div class="changeLevelItem">
<div class="changeLevelItemToken">
<img
src="https://d31zlh4on95l9h.cloudfront.net/images/403ef762dd2f335df3b0c9e3fe488375.png"
alt="token"
class="changeLevelItemTokenImg"
/>
{{ item.calculatedPosition }}
</div>
<div class="changeLevelItemToken">{{ item.position }} 金币</div>
</div>
</div>
</div>
</div>
<div class="changeNow">
应付金额
<div class="changePay">{{ activeLevel.position }}</div>
(金币余额{{ gold }})
</div>
<div class="changeBtn" @click="changeToken">立即兑换</div>
</el-dialog>
<el-dialog
v-model="rechargeDialogVisible"
:width="isMobile ? '60%' : '40%'"
:width="isMobile ? '60%' : '30%'"
:show-close="false"
>
<div class="rechargeDialogTitle">温馨提示</div>
@ -1361,7 +1593,7 @@ onUnmounted(() => {
<el-dialog
v-model="confirmDialogVisible"
:width="isMobile ? '60%' : '40%'"
:width="isMobile ? '60%' : '30%'"
:show-close="false"
>
<div class="confirmDialogTitle">兑换</div>
@ -1380,13 +1612,13 @@ onUnmounted(() => {
<el-dialog
v-model="changeSuccessDialogVisible"
:width="isMobile ? '60%' : '40%'"
:width="isMobile ? '60%' : '30%'"
:show-close="false"
class="changeSuccessDialog"
>
<div class="changeSuccessDialogTitle">兑换成功</div>
<div class="changeSuccessDialogContent">
尊敬的用户恭喜您成功兑换{{ activeLevel.calculatedPosition }}Token
尊敬的用户恭喜您成功兑换{{ activeLevel.calculatedPosition }} Token
</div>
</el-dialog>
</div>
@ -1650,10 +1882,15 @@ body {
flex-direction: column;
justify-content: center;
align-items: center;
cursor: pointer;
}
.backToHomeBtn:hover {
transform: scale(1.05);
}
.backImg {
width: 100%;
width: 60%;
height: auto;
}
@ -1677,6 +1914,7 @@ body {
width: 65%;
height: 100%;
position: relative;
cursor: pointer;
}
.pc-countBtn:hover {
@ -1715,6 +1953,7 @@ body {
display: flex;
flex-direction: column;
align-items: center;
cursor: pointer;
}
.pc-backImg {
width: auto;
@ -1946,22 +2185,6 @@ body {
z-index: 6;
}
@media (max-width: 768px) {
.action-btn {
height: 21px;
}
.footer-second-line {
padding: 5px 10px 10px;
}
.msg-input {
/* min-height: 44px; */
/* height: 44px; */
font-size: 16px;
}
}
.changeMsg {
display: flex;
width: 100%;
@ -1988,6 +2211,8 @@ body {
}
.changeImgClass {
width: 50px;
height: auto;
}
.changeContent {
@ -2031,6 +2256,8 @@ body {
display: flex;
background-color: #f8f8f8;
width: 20%;
min-width: 70px;
max-width: 150px;
justify-content: center;
align-items: center;
flex-direction: column;
@ -2081,6 +2308,7 @@ body {
.changeBtn {
width: 40%;
max-width: 350px;
background-color: #4e86fe;
color: white;
display: flex;
@ -2122,8 +2350,9 @@ body {
padding: 10px 20px;
border-radius: 13px;
cursor: pointer;
width: 20%;
min-width: 20%;
text-align: center;
white-space: nowrap;
}
.recharge:hover {
@ -2135,7 +2364,7 @@ body {
padding: 10px 20px;
border-radius: 13px;
cursor: pointer;
width: 20%;
min-width: 20%;
text-align: center;
}
@ -2170,7 +2399,7 @@ body {
padding: 10px 20px;
border-radius: 13px;
cursor: pointer;
width: 20%;
min-width: 20%;
text-align: center;
}
@ -2183,7 +2412,7 @@ body {
padding: 10px 20px;
border-radius: 13px;
cursor: pointer;
width: 20%;
min-width: 20%;
text-align: center;
}
@ -2207,6 +2436,135 @@ body {
font-weight: bold;
text-align: center;
}
@media (max-width: 768px) {
.action-btn {
height: 21px;
}
.footer-second-line {
padding: 5px 10px 10px;
}
.msg-input {
/* min-height: 44px; */
/* height: 44px; */
font-size: 16px;
}
/* .changeImg {
width: 30px;
height: 30px;
} */
.changeLevel {
flex-direction: horizontal;
}
.changeLevelContent {
display: flex;
/* justify-content: center; */
}
.changeLevelItems {
flex: 0 0 calc(33% - 20px);
/* margin-right: auto; */
}
.changeLevelTitle {
align-items: center;
display: flex;
}
.changeRule {
margin-left: 10px;
width: 0%;
background-color: white;
}
.changeMsg {
gap: 10px 20px;
margin-bottom: 10px;
}
.changeImgClass {
width: 30px;
height: 30px;
}
/* .changeContent {
font-size: 0.5rem;
} */
.changeLevelItems {
font-size: 0.7rem;
min-width: 0px;
}
.changeLevelItemToken {
white-space: nowrap;
}
.changeLevelItemTokenImg {
width: 20px;
height: 20px;
}
.changeInfo {
margin: 0px auto;
}
.changeBtn {
margin: 0px auto;
}
.rechargeDialogTitle {
font-size: 1.3rem;
}
.rechargeDialogContent {
padding: 10px 0px;
font-size: 0.8rem;
}
.rechargeDialogBtnGroup {
font-size: 1rem;
}
.recharge {
padding: 5px 10px;
}
.rechargeDialogCancel {
padding: 5px 10px;
}
.confirmDialogTitle {
font-size: 1.3rem;
}
.confirmDialogContent {
padding: 10px 0px;
font-size: 0.8rem;
}
.confirmDialogBtnGroup {
font-size: 1rem;
}
.confirmDialogConfirm {
padding: 5px 10px;
}
.confirmDialogCancel {
padding: 5px 10px;
}
.changeSuccessDialogTitle {
font-size: 1.3rem;
}
.changeSuccessDialogContent {
font-size: 1rem;
}
}
</style>
<style>

Loading…
Cancel
Save