From 55839d332968aaad244aff1030df2dd1a21d5f8b Mon Sep 17 00:00:00 2001 From: ArvinLovegood Date: Wed, 25 Jun 2025 13:37:55 +0800 Subject: [PATCH] =?UTF-8?q?feat(frontend):=E4=BC=98=E5=8C=96=E7=83=AD?= =?UTF-8?q?=E9=97=A8=E8=82=A1=E7=A5=A8=E5=92=8C=E8=AF=9D=E9=A2=98=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 更新热门股票列表,增加更多图标和数据字段 - 改进热门话题组件,添加点击事件和额外信息展示 - 调整股票搜索功能,使用居中弹窗打开链接 - 更新 App.vue 中的图标和菜单项 - 修改后端 HotStock 函数,增加返回数据量 --- app_common.go | 2 +- frontend/src/App.vue | 36 +++++++++++++++++--- frontend/src/components/HotStockList.vue | 16 +++++++-- frontend/src/components/HotTopics.vue | 42 ++++++++++++++++++++---- frontend/src/components/stock.vue | 16 ++++++++- 5 files changed, 97 insertions(+), 15 deletions(-) diff --git a/app_common.go b/app_common.go index 587be55..7a9f6f0 100644 --- a/app_common.go +++ b/app_common.go @@ -33,7 +33,7 @@ func (a App) AnalyzeSentiment(text string) data.SentimentResult { } func (a App) HotStock(marketType string) *[]models.HotItem { - return data.NewMarketNewsApi().XUEQIUHotStock(50, marketType) + return data.NewMarketNewsApi().XUEQIUHotStock(100, marketType) } func (a App) HotEvent(size int) *[]models.HotEvent { diff --git a/frontend/src/App.vue b/frontend/src/App.vue index 930966c..b371eed 100644 --- a/frontend/src/App.vue +++ b/frontend/src/App.vue @@ -14,7 +14,7 @@ import {createDiscreteApi,darkTheme,lightTheme , NIcon, NText,dateZhCN,zhCN} fro import { AlarmOutline, AnalyticsOutline, - BarChartSharp, EaselSharp, + BarChartSharp, Bonfire, BonfireOutline, EaselSharp, ExpandOutline, Flag, Flame, FlameSharp, InformationOutline, LogoGithub, @@ -28,6 +28,11 @@ import { Wallet, WarningOutline, } from '@vicons/ionicons5' import {AnalyzeSentiment, GetConfig, GetGroupList} from "../wailsjs/go/main/App"; +import {Dragon, Fire, Gripfire} from "@vicons/fa"; +import {ReportSearch} from "@vicons/tabler"; +import {LocalFireDepartmentRound} from "@vicons/material"; +import {CommentNote20Filled} from "@vicons/fluent"; +import {FireFilled, FireOutlined, NotificationFilled, StockOutlined} from "@vicons/antd"; @@ -241,7 +246,7 @@ const menuOptions = ref([ {default: () => '龙虎榜',} ), key: 'market6', - icon: renderIcon(Skull), + icon: renderIcon(Dragon), }, { label: () => @@ -262,7 +267,7 @@ const menuOptions = ref([ {default: () => '个股研报',} ), key: 'market7', - icon: renderIcon(NewspaperSharp), + icon: renderIcon(StockOutlined), }, { label: () => @@ -283,7 +288,7 @@ const menuOptions = ref([ {default: () => '公司公告',} ), key: 'market8', - icon: renderIcon(NewspaperSharp), + icon: renderIcon(NotificationFilled), }, { label: () => @@ -304,7 +309,28 @@ const menuOptions = ref([ {default: () => '行业研究',} ), key: 'market9', - icon: renderIcon(NewspaperSharp), + icon: renderIcon(ReportSearch), + }, + { + label: () => + h( + RouterLink, + { + href: '#', + to: { + name: 'market', + query: { + name: "当前热门", + } + }, + onClick: () => { + EventsEmit("changeMarketTab", {ID: 0, name: '当前热门'}) + }, + }, + {default: () => '当前热门',} + ), + key: 'market10', + icon: renderIcon(Gripfire), }, ] }, diff --git a/frontend/src/components/HotStockList.vue b/frontend/src/components/HotStockList.vue index 5f978c5..9846deb 100644 --- a/frontend/src/components/HotStockList.vue +++ b/frontend/src/components/HotStockList.vue @@ -2,6 +2,7 @@ import {onBeforeMount, onUnmounted, ref} from 'vue' import {HotStock} from "../../wailsjs/go/main/App"; import KLineChart from "./KLineChart.vue"; +import {ArrowBack, ArrowDown, ArrowUp} from "@vicons/ionicons5"; const {marketType}=defineProps( { @@ -64,8 +65,19 @@ function getMarketCode(item) { {{item.percent}}% {{item.current}} {{item.value}} - {{item.increment}} - {{item.rank_change}} + + {{item.increment}} + + + + + + {{item.rank_change}} + + + + + diff --git a/frontend/src/components/HotTopics.vue b/frontend/src/components/HotTopics.vue index 6a3850f..e203788 100644 --- a/frontend/src/components/HotTopics.vue +++ b/frontend/src/components/HotTopics.vue @@ -13,26 +13,56 @@ onBeforeMount(async () => { onUnmounted(()=>{ clearInterval(task.value) }) + +function openCenteredWindow(url, width, height) { + const left = (window.screen.width - width) / 2; + const top = (window.screen.height - height) / 2; + + return window.open( + url, + 'centeredWindow', + `width=${width},height=${height},left=${left},top=${top}` + ); +} +function showPage(htid) { + openCenteredWindow(`https://gubatopic.eastmoney.com/topic_v3.html?htid=${htid}`, 1000, 600) +}