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

@@ -14,7 +14,7 @@
<el-menu-item index="2" @click="enterStart"
>开始</el-menu-item>
<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>
<!-- <el-sub-menu index="4">-->
@@ -234,7 +234,7 @@ const enterStart = () => {
}
const enterTemp=()=>{
alert("即将上线敬请期待请多攒一些钱钱吧最低入场需100钱钱哦")
router.push("/stock");
}
const enterShop=()=>{
router.push("/shop");

View File

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

View File

@@ -3,7 +3,7 @@
<!-- 顶部选择器区域 -->
<div class="stock-header">
<div class="title-area">
<h2 class="title">意社区股市</h2>
<h2 class="title">意社区股市v1.0 <span class="title-desc">本模块全部由AI 100% 调教生成</span></h2>
</div>
<div class="selector-area">
@@ -99,6 +99,18 @@
<!-- 股票图表 -->
<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">
<el-skeleton animated />
</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-source" v-if="currentNewsDetail.source">来源: {{ currentNewsDetail.source }}</span>
</div>
<div class="news-detail-content">{{ currentNewsDetail.content }}</div>
<div class="news-detail-content" style=" font-size: large">{{ currentNewsDetail.content }}</div>
</el-dialog>
</div>
</template>
@@ -561,6 +573,12 @@ onMounted(async () => {
// 加载用户信息
await loadUserInfo();
});
// 刷新股票图表
const refreshStockChart = async () => {
await fetchStockPriceRecords();
ElMessage.success('股票数据已刷新');
};
</script>
<style scoped>
@@ -608,6 +626,16 @@ onMounted(async () => {
color: #58a6ff;
text-shadow: 0 0 5px rgba(88, 166, 255, 0.3);
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 {
@@ -924,35 +952,33 @@ onMounted(async () => {
min-height: 60px;
}
.stock-dashboard :deep(.el-empty__image) {
:deep(.stock-dashboard .el-empty__image) {
width: 100px;
height: 100px;
}
.stock-dashboard :deep(.el-empty__description) {
:deep(.stock-dashboard .el-empty__description) {
margin-top: 5px;
font-size: 12px;
}
/* 新闻详情弹窗样式 */
.news-detail-dialog :deep(.el-dialog__header) {
:deep(.news-detail-dialog .el-dialog__header) {
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-weight: bold;
color: #ffffff !important;
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;
color: #e6edf3;
}
.news-detail-header {
display: flex;
justify-content: space-between;
@@ -963,9 +989,10 @@ onMounted(async () => {
font-size: 0.9em;
}
.news-detail-content {
.news-detail-dialog .news-detail-content {
line-height: 1.6;
white-space: pre-line;
font-size: large;
}
/* 修改Element弹窗适应深色主题 */
@@ -1013,4 +1040,25 @@ onMounted(async () => {
color: #7ee787;
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>