feat: 上线ai股市模块

This commit is contained in:
橙子
2025-03-15 00:58:10 +08:00
parent cec28faaf7
commit f7d9effa07
5 changed files with 73 additions and 20 deletions

View File

@@ -21,6 +21,7 @@
- 部分股票可能对某些新闻更敏感,价格会大幅度变化 - 部分股票可能对某些新闻更敏感,价格会大幅度变化
- 一天24小时下来整体价格变化的趋势应该比较连贯可以部分小时的价格大幅度变化 - 一天24小时下来整体价格变化的趋势应该比较连贯可以部分小时的价格大幅度变化
- 变化幅度可以大一些,为了更吸引用户 - 变化幅度可以大一些,为了更吸引用户
- 可能下跌,可能上涨
- 最低价值为1最高价值为100 - 最低价值为1最高价值为100
请确保数据格式正确,以便系统能够自动处理。 请确保数据格式正确,以便系统能够自动处理。

View File

@@ -1,15 +1,19 @@
基于以下最近的新闻背景,生成一条新的股市相关新闻。 基于以下最近的新闻背景,预测趋势生成一条其他新闻。
{{newsContext}} {{newsContext}}
请生成一条有关联性的新闻,包含以下要素: 包含以下要素:
1. 新闻标题:吸引人且简短,涉及不同行业 1. 新闻标题:吸引人且简短,涉及不同行业
2. 新闻内容:详细且符合逻辑的报道,篇幅适中,重点内容需要通俗易懂 2. 新闻内容:详细且符合逻辑的报道,篇幅不要太多,并且内容需要通俗易懂
3. 新闻简介:简明扼要的总结 3. 新闻简介:简明扼要的总结
4. 新闻来源:提供一个虚拟的媒体或机构名称 4. 新闻来源:提供一个虚拟的媒体或机构名称
注意: 注意:
- 新闻内容应当与前面的新闻可以有一定关联性 - 新闻内容需要以一件具体的事件为内容,可以是现实中发生的进行修改
- 内容应当暗示可能对不同行业公司产生某种影响(积极或消极) - 新闻内容不要以某公司为主题,应该是一件有趣的事件
- 内容应当暗示可能对不同行业公司产生某种影响(积极或消极),不能太过于明显
- 行业焦点可以包括娱乐、科技、金融、医疗、食品等多个领域 - 行业焦点可以包括娱乐、科技、金融、医疗、食品等多个领域
- 新闻有很小的概率造假,如果是造假的,新闻来源就得来自小的工作室
- 不要一直重复着一个公司、一个行业的新闻
- 可以加一些很离谱的元素增加新闻的趣味性
- 只需生成一次即可 - 只需生成一次即可

View File

@@ -14,7 +14,7 @@
<el-menu-item index="2" @click="enterStart" <el-menu-item index="2" @click="enterStart"
>开始</el-menu-item> >开始</el-menu-item>
<el-menu-item index="3" @click="enterTemp" style="color: red;font-weight: bolder;font-size: large;" <el-menu-item index="3" @click="enterTemp" style="color: red;font-weight: bolder;font-size: large;"
>Ai股</el-menu-item> >Ai</el-menu-item>
<el-menu-item index="4" @click="enterShop" <el-menu-item index="4" @click="enterShop"
>商城</el-menu-item> >商城</el-menu-item>
<!-- <el-sub-menu index="4">--> <!-- <el-sub-menu index="4">-->
@@ -234,7 +234,7 @@ const enterStart = () => {
} }
const enterTemp=()=>{ const enterTemp=()=>{
alert("即将上线敬请期待请多攒一些钱钱吧最低入场需100钱钱哦") router.push("/stock");
} }
const enterShop=()=>{ const enterShop=()=>{
router.push("/shop"); router.push("/shop");

View File

@@ -315,6 +315,7 @@ const activeList = [
{name: "商城", path: "/shop", icon: "ShoppingCart"}, {name: "商城", path: "/shop", icon: "ShoppingCart"},
{name: "数字藏品", path: "/dc", icon: "Trophy"}, {name: "数字藏品", path: "/dc", icon: "Trophy"},
{name: "面试宝典", path: "/book", icon: "Memo"}, {name: "面试宝典", path: "/book", icon: "Memo"},
{name: "AI炒股", path: "/stock", icon: "TrendCharts"},
// {name: "小程序", path: "/", icon: "Position"}, // {name: "小程序", path: "/", icon: "Position"},
// {name: "公众号", path: "/", icon: "ChatRound"}, // {name: "公众号", path: "/", icon: "ChatRound"},
]; ];
@@ -431,7 +432,6 @@ const registerLogOptins = computed(() => {
}); });
const onClickMoneyTop = () => { const onClickMoneyTop = () => {
router.push("/money"); router.push("/money");
}; };

View File

@@ -3,7 +3,7 @@
<!-- 顶部选择器区域 --> <!-- 顶部选择器区域 -->
<div class="stock-header"> <div class="stock-header">
<div class="title-area"> <div class="title-area">
<h2 class="title">意社区股市</h2> <h2 class="title">意社区股市v1.0 <span class="title-desc">本模块全部由AI 100% 调教生成</span></h2>
</div> </div>
<div class="selector-area"> <div class="selector-area">
@@ -99,6 +99,18 @@
<!-- 股票图表 --> <!-- 股票图表 -->
<div class="stock-chart"> <div class="stock-chart">
<div class="chart-header">
<el-button
type="primary"
circle
size="small"
class="refresh-button"
@click="refreshStockChart"
:loading="isLoadingChart"
>
<el-icon><Refresh /></el-icon>
</el-button>
</div>
<div v-if="isLoadingChart" class="loading-chart"> <div v-if="isLoadingChart" class="loading-chart">
<el-skeleton animated /> <el-skeleton animated />
</div> </div>
@@ -194,7 +206,7 @@
<span class="news-detail-time">{{ dayjs(currentNewsDetail.publishTime).format('YYYY-MM-DD HH:mm:ss') }}</span> <span class="news-detail-time">{{ dayjs(currentNewsDetail.publishTime).format('YYYY-MM-DD HH:mm:ss') }}</span>
<span class="news-detail-source" v-if="currentNewsDetail.source">来源: {{ currentNewsDetail.source }}</span> <span class="news-detail-source" v-if="currentNewsDetail.source">来源: {{ currentNewsDetail.source }}</span>
</div> </div>
<div class="news-detail-content">{{ currentNewsDetail.content }}</div> <div class="news-detail-content" style=" font-size: large">{{ currentNewsDetail.content }}</div>
</el-dialog> </el-dialog>
</div> </div>
</template> </template>
@@ -561,6 +573,12 @@ onMounted(async () => {
// 加载用户信息 // 加载用户信息
await loadUserInfo(); await loadUserInfo();
}); });
// 刷新股票图表
const refreshStockChart = async () => {
await fetchStockPriceRecords();
ElMessage.success('股票数据已刷新');
};
</script> </script>
<style scoped> <style scoped>
@@ -608,6 +626,16 @@ onMounted(async () => {
color: #58a6ff; color: #58a6ff;
text-shadow: 0 0 5px rgba(88, 166, 255, 0.3); text-shadow: 0 0 5px rgba(88, 166, 255, 0.3);
white-space: nowrap; white-space: nowrap;
display: flex;
align-items: center;
}
.title-desc {
font-size: 0.6em;
color: #8b949e;
font-style: italic;
margin-left: 10px;
font-weight: normal;
} }
.main-content { .main-content {
@@ -924,35 +952,33 @@ onMounted(async () => {
min-height: 60px; min-height: 60px;
} }
.stock-dashboard :deep(.el-empty__image) { :deep(.stock-dashboard .el-empty__image) {
width: 100px; width: 100px;
height: 100px; height: 100px;
} }
.stock-dashboard :deep(.el-empty__description) { :deep(.stock-dashboard .el-empty__description) {
margin-top: 5px; margin-top: 5px;
font-size: 12px; font-size: 12px;
} }
/* 新闻详情弹窗样式 */ /* 新闻详情弹窗样式 */
.news-detail-dialog :deep(.el-dialog__header) { :deep(.news-detail-dialog .el-dialog__header) {
padding: 15px 20px; padding: 15px 20px;
border-bottom: 1px solid #30363d;
} }
.news-detail-dialog :deep(.el-dialog__title) { :deep( .news-detail-dialog .el-dialog__title) {
font-size: 18px; font-size: 18px;
font-weight: bold; font-weight: bold;
color: #ffffff !important; color: #ffffff !important;
text-shadow: 0 0 3px rgba(255, 255, 255, 0.3); text-shadow: 0 0 3px rgba(255, 255, 255, 0.3);
} }
.news-detail-dialog :deep(.el-dialog__body) { :deep(.news-detail-dialog .el-dialog__body) {
padding: 20px; padding: 20px;
color: #e6edf3; color: #e6edf3;
} }
.news-detail-header { .news-detail-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
@@ -963,9 +989,10 @@ onMounted(async () => {
font-size: 0.9em; font-size: 0.9em;
} }
.news-detail-content { .news-detail-dialog .news-detail-content {
line-height: 1.6; line-height: 1.6;
white-space: pre-line; white-space: pre-line;
font-size: large;
} }
/* 修改Element弹窗适应深色主题 */ /* 修改Element弹窗适应深色主题 */
@@ -1013,4 +1040,25 @@ onMounted(async () => {
color: #7ee787; color: #7ee787;
margin-left: 4px; margin-left: 4px;
} }
.chart-header {
position: relative;
height: 0;
}
.refresh-button {
position: absolute;
top: 10px;
right: 10px;
z-index: 2;
background-color: #21262d;
border-color: #30363d;
transition: all 0.3s;
}
.refresh-button:hover {
background-color: #58a6ff;
border-color: #58a6ff;
transform: rotate(180deg);
}
</style> </style>