commit 72f5bc730658a95aebeef22ae3afce4c85faeea1 Author: super <2903208875@qq.com> Date: Mon Mar 16 09:43:24 2026 +0800 first commit diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..5ef6a52 --- /dev/null +++ b/.gitignore @@ -0,0 +1,41 @@ +# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. + +# dependencies +/node_modules +/.pnp +.pnp.* +.yarn/* +!.yarn/patches +!.yarn/plugins +!.yarn/releases +!.yarn/versions + +# testing +/coverage + +# next.js +/.next/ +/out/ + +# production +/build + +# misc +.DS_Store +*.pem + +# debug +npm-debug.log* +yarn-debug.log* +yarn-error.log* +.pnpm-debug.log* + +# env files (can opt-in for committing if needed) +.env* + +# vercel +.vercel + +# typescript +*.tsbuildinfo +next-env.d.ts diff --git a/README.md b/README.md new file mode 100644 index 0000000..e215bc4 --- /dev/null +++ b/README.md @@ -0,0 +1,36 @@ +This is a [Next.js](https://nextjs.org) project bootstrapped with [`create-next-app`](https://nextjs.org/docs/app/api-reference/cli/create-next-app). + +## Getting Started + +First, run the development server: + +```bash +npm run dev +# or +yarn dev +# or +pnpm dev +# or +bun dev +``` + +Open [http://localhost:3000](http://localhost:3000) with your browser to see the result. + +You can start editing the page by modifying `app/page.tsx`. The page auto-updates as you edit the file. + +This project uses [`next/font`](https://nextjs.org/docs/app/building-your-application/optimizing/fonts) to automatically optimize and load [Geist](https://vercel.com/font), a new font family for Vercel. + +## Learn More + +To learn more about Next.js, take a look at the following resources: + +- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API. +- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial. + +You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js) - your feedback and contributions are welcome! + +## Deploy on Vercel + +The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js. + +Check out our [Next.js deployment documentation](https://nextjs.org/docs/app/building-your-application/deploying) for more details. diff --git a/app/(shell)/dashboard/page.tsx b/app/(shell)/dashboard/page.tsx new file mode 100644 index 0000000..f81cf21 --- /dev/null +++ b/app/(shell)/dashboard/page.tsx @@ -0,0 +1,31 @@ +export default function DashboardPage() { + return ( +
+

Dashboard

+

+ 这里会展示:今日推荐(集合竞价/午盘/盘后)、自选股摘要、模拟盘摘要。 +

+ +
+
+
集合竞价
+
+ 今日盘前关注 +
+
+
+
午盘精选
+
+ 盘中确认机会 +
+
+
+
盘后分析
+
+ 复盘与次日预案 +
+
+
+
+ ); +} diff --git a/app/(shell)/layout.tsx b/app/(shell)/layout.tsx new file mode 100644 index 0000000..779dfae --- /dev/null +++ b/app/(shell)/layout.tsx @@ -0,0 +1,61 @@ +import Link from "next/link"; +import type { ReactNode } from "react"; + +const navItems = [ + { href: "/dashboard", label: "Dashboard" }, + { href: "/watchlist", label: "自选股" }, + { href: "/recommendations", label: "每日推荐" }, + { href: "/trading", label: "模拟盘" }, + { href: "/settings", label: "设置" }, +]; + +const quickLinks = [ + { href: "/stocks/600519", label: "600519" }, +]; + +export default function ShellLayout({ children }: { children: ReactNode }) { + return ( +
+
+ + +
+ {children} +
+
+
+ ); +} diff --git a/app/(shell)/recommendations/page.tsx b/app/(shell)/recommendations/page.tsx new file mode 100644 index 0000000..a4b5390 --- /dev/null +++ b/app/(shell)/recommendations/page.tsx @@ -0,0 +1,214 @@ +"use client"; + +import { useEffect, useMemo } from "react"; + +import type { RecommendationSegment } from "@/src/recommendations/types"; +import { useImportedPoolStore } from "@/src/stores/importedPoolStore"; +import { useRecommendationsStore } from "@/src/stores/recommendationsStore"; + +const segmentOptions: { value: RecommendationSegment; label: string }[] = [ + { value: "OPEN_AUCTION", label: "集合竞价" }, + { value: "MIDDAY", label: "午盘精选" }, + { value: "AFTER_HOURS", label: "盘后分析" }, +]; + +export default function RecommendationsPage() { + const codesText = useImportedPoolStore((s) => s.codesText); + const poolLoading = useImportedPoolStore((s) => s.loading); + const poolError = useImportedPoolStore((s) => s.error); + const loadPool = useImportedPoolStore((s) => s.load); + const savePool = useImportedPoolStore((s) => s.save); + const setPoolDraft = useImportedPoolStore((s) => s.setDraft); + + const date = useRecommendationsStore((s) => s.date); + const segment = useRecommendationsStore((s) => s.segment); + const recLoading = useRecommendationsStore((s) => s.loading); + const recError = useRecommendationsStore((s) => s.error); + const snapshot = useRecommendationsStore((s) => s.snapshot); + const setDate = useRecommendationsStore((s) => s.setDate); + const setSegment = useRecommendationsStore((s) => s.setSegment); + const loadRec = useRecommendationsStore((s) => s.load); + const generate = useRecommendationsStore((s) => s.generate); + + useEffect(() => { + void loadPool(); + }, [loadPool]); + + useEffect(() => { + void loadRec(); + }, [date, segment, loadRec]); + + const selectedSegmentLabel = useMemo(() => { + return segmentOptions.find((x) => x.value === segment)?.label ?? segment; + }, [segment]); + + return ( +
+
+

每日推荐

+

+ MVP:自选股 + 导入池 作为 Universe,规则 v0.1(突破+均线趋势),每段 Top 10。 +

+
+ +
+
+ + + + +
+ +
+ +
+ +
+
+ + {(poolError || recError) ? ( +
+ {poolError ?? recError} +
+ ) : null} + + {(poolLoading || recLoading) ? ( +
加载中…
+ ) : null} +
+ +
+
导入池(Universe 扩展)
+

+ 每行一个代码:支持 600519 或 SH:600519 / SZ:000001 / BJ:8xxxxx。空行会忽略。 +

+ +