feat:公告

This commit is contained in:
hzm
2026-02-06 08:25:16 +08:00
parent 2a5206bbc2
commit b3b837623d
3 changed files with 19 additions and 6 deletions

4
app/assets/github.svg Normal file
View File

@@ -0,0 +1,4 @@
<?xml version="1.0" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg t="1770335913293" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1562" xmlns:xlink="http://www.w3.org/1999/xlink" width="200" height="200">
<path d="M512 85.333333C276.266667 85.333333 85.333333 276.266667 85.333333 512a426.410667 426.410667 0 0 0 291.754667 404.821333c21.333333 3.712 29.312-9.088 29.312-20.309333 0-10.112-0.554667-43.690667-0.554667-79.445333-107.178667 19.754667-134.912-26.112-143.445333-50.133334-4.821333-12.288-25.6-50.133333-43.733333-60.288-14.933333-7.978667-36.266667-27.733333-0.554667-28.245333 33.621333-0.554667 57.6 30.933333 65.621333 43.733333 38.4 64.512 99.754667 46.378667 124.245334 35.2 3.754667-27.733333 14.933333-46.378667 27.221333-57.045333-94.933333-10.666667-194.133333-47.488-194.133333-210.688 0-46.421333 16.512-84.778667 43.733333-114.688-4.266667-10.666667-19.2-54.4 4.266667-113.066667 0 0 35.712-11.178667 117.333333 43.776a395.946667 395.946667 0 0 1 106.666667-14.421333c36.266667 0 72.533333 4.778667 106.666666 14.378667 81.578667-55.466667 117.333333-43.690667 117.333334-43.690667 23.466667 58.666667 8.533333 102.4 4.266666 113.066667 27.178667 29.866667 43.733333 67.712 43.733334 114.645333 0 163.754667-99.712 200.021333-194.645334 210.688 15.445333 13.312 28.8 38.912 28.8 78.933333 0 57.045333-0.554667 102.912-0.554666 117.333334 0 11.178667 8.021333 24.490667 29.354666 20.224A427.349333 427.349333 0 0 0 938.666667 512c0-235.733333-190.933333-426.666667-426.666667-426.666667z" fill="#000000" p-id="1563"></path>
</svg>

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -3,7 +3,7 @@
import { useState, useEffect } from 'react'; import { useState, useEffect } from 'react';
import { motion, AnimatePresence } from 'framer-motion'; import { motion, AnimatePresence } from 'framer-motion';
const ANNOUNCEMENT_KEY = 'hasClosedAnnouncement_v4'; const ANNOUNCEMENT_KEY = 'hasClosedAnnouncement_v5';
export default function Announcement() { export default function Announcement() {
const [isVisible, setIsVisible] = useState(false); const [isVisible, setIsVisible] = useState(false);
@@ -65,8 +65,10 @@ export default function Announcement() {
<div style={{ color: 'var(--text)', lineHeight: '1.6', fontSize: '15px' }}> <div style={{ color: 'var(--text)', lineHeight: '1.6', fontSize: '15px' }}>
感谢大家反馈的需求现已增加如下功能 感谢大家反馈的需求现已增加如下功能
<p>1. 持仓金额</p> <p>1. 持仓金额录入支持按金额</p>
<p>2. 更新当日最新净值方便和估值数据作对比</p> <p>2. 排序支持升序降序</p>
<p>3. PC 端表格模式优化</p>
<p>4. 移动端表格模式删除按钮改为向左滑动</p>
以下功能会在下一个版本上线 以下功能会在下一个版本上线
<p>1. 减仓</p> <p>1. 减仓</p>
<p>2. 获取不到估值数据的基金能正常添加仅展示最新净值数据</p> <p>2. 获取不到估值数据的基金能正常添加仅展示最新净值数据</p>

View File

@@ -5,6 +5,7 @@ import { motion, AnimatePresence, Reorder } from 'framer-motion';
import Announcement from "./components/Announcement"; import Announcement from "./components/Announcement";
import zhifubaoImg from "./assets/zhifubao.jpg"; import zhifubaoImg from "./assets/zhifubao.jpg";
import weixinImg from "./assets/weixin.jpg"; import weixinImg from "./assets/weixin.jpg";
import githubImg from "./assets/github.svg";
function PlusIcon(props) { function PlusIcon(props) {
return ( return (
@@ -2609,7 +2610,7 @@ export default function HomePage() {
const saveSettings = (e) => { const saveSettings = (e) => {
e?.preventDefault?.(); e?.preventDefault?.();
const ms = Math.max(5, Number(tempSeconds)) * 1000; const ms = Math.max(10, Number(tempSeconds)) * 1000;
setRefreshMs(ms); setRefreshMs(ms);
localStorage.setItem('refreshMs', String(ms)); localStorage.setItem('refreshMs', String(ms));
setSettingsOpen(false); setSettingsOpen(false);
@@ -2829,6 +2830,7 @@ export default function HomePage() {
<span>基估宝</span> <span>基估宝</span>
</div> </div>
<div className="actions"> <div className="actions">
<img alt="项目Github地址" src={githubImg.src} style={{width:'30px',height: '30px', cursor: 'pointer'}} onClick={()=> window.open("https://github.com/hzm0321/real-time-fund")}/>
<div className="badge" title="当前刷新频率"> <div className="badge" title="当前刷新频率">
<span>刷新</span> <span>刷新</span>
<strong>{Math.round(refreshMs / 1000)}</strong> <strong>{Math.round(refreshMs / 1000)}</strong>
@@ -3845,12 +3847,17 @@ export default function HomePage() {
<input <input
className="input" className="input"
type="number" type="number"
min="5" min="10"
step="5" step="5"
value={tempSeconds} value={tempSeconds}
onChange={(e) => setTempSeconds(Number(e.target.value))} onChange={(e) => setTempSeconds(Number(e.target.value))}
placeholder="自定义秒数" placeholder="自定义秒数"
/> />
{tempSeconds < 10 && (
<div className="error-text" style={{ marginTop: 8 }}>
最小 10
</div>
)}
</div> </div>
<div className="form-group" style={{ marginBottom: 16 }}> <div className="form-group" style={{ marginBottom: 16 }}>
@@ -3877,7 +3884,7 @@ export default function HomePage() {
</div> </div>
<div className="row" style={{ justifyContent: 'flex-end', marginTop: 24 }}> <div className="row" style={{ justifyContent: 'flex-end', marginTop: 24 }}>
<button className="button" onClick={saveSettings}>保存并关闭</button> <button className="button" onClick={saveSettings} disabled={tempSeconds < 10}>保存并关闭</button>
</div> </div>
</div> </div>
</div> </div>