Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7c332cb89d | ||
|
|
631336097f |
@@ -712,7 +712,7 @@ export const fetchFundHistory = async (code, range = '1m') => {
|
||||
};
|
||||
|
||||
export const parseFundTextWithLLM = async (text) => {
|
||||
const apiKey = 'sk-a72c4e279bc62a03cc105be6263d464c';
|
||||
const apiKey = 'sk-5b03d4e02ec22dd2ba233fb6d2dd549b';
|
||||
if (!apiKey || !text) return null;
|
||||
|
||||
try {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { motion, AnimatePresence } from 'framer-motion';
|
||||
|
||||
const ANNOUNCEMENT_KEY = 'hasClosedAnnouncement_v15';
|
||||
const ANNOUNCEMENT_KEY = 'hasClosedAnnouncement_v16';
|
||||
|
||||
export default function Announcement() {
|
||||
const [isVisible, setIsVisible] = useState(false);
|
||||
@@ -75,21 +75,19 @@ export default function Announcement() {
|
||||
<span>公告</span>
|
||||
</div>
|
||||
<div style={{ color: 'var(--text)', lineHeight: '1.6', fontSize: '15px', overflowY: 'auto', minHeight: 0, flex: 1, paddingRight: '4px' }}>
|
||||
<p>v0.2.4 版本更新内容如下:</p>
|
||||
<p>1. 调整设置持仓相关弹框样式。</p>
|
||||
<p>2. 基金详情弹框支持设置持仓相关参数。</p>
|
||||
<p>3. 添加基金到分组弹框展示持仓金额数据。</p>
|
||||
<p>4. 已登录用户新增手动同步按钮。</p>
|
||||
<p>v0.2.5 紧急更新:</p>
|
||||
<p>1. 修复拍照失败 key 过期问题。</p>
|
||||
<p>2. 设置持仓输入回滚问题。</p>
|
||||
<br/>
|
||||
<p>答疑:</p>
|
||||
<p>1. 因估值数据源问题,大部分海外基金估值数据不准或没有,暂时没有解决方案。</p>
|
||||
<p>2. 因交易日用户人数过多,为控制服务器免费额度上限,暂时减少数据自动同步频率,新增手动同步按钮。</p>
|
||||
<p>下周更新内容:</p>
|
||||
<p>1. 大盘数据。</p>
|
||||
<p>2. 关联板块。</p>
|
||||
<p>如有建议,欢迎进用户支持群反馈。</p>
|
||||
</div>
|
||||
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', marginTop: '8px' }}>
|
||||
<button
|
||||
className="button"
|
||||
<button
|
||||
className="button"
|
||||
onClick={handleClose}
|
||||
style={{ width: '100%', justifyContent: 'center', display: 'flex', alignItems: 'center' }}
|
||||
>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
'use client';
|
||||
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect, useMemo, useRef, useState } from 'react';
|
||||
import { CloseIcon, SettingsIcon } from './Icons';
|
||||
import {
|
||||
Dialog,
|
||||
@@ -12,12 +12,21 @@ export default function HoldingEditModal({ fund, holding, onClose, onSave }) {
|
||||
const [mode, setMode] = useState('amount'); // 'amount' | 'share'
|
||||
|
||||
const dwjz = fund?.dwjz || fund?.gsz || 0;
|
||||
const dwjzRef = useRef(dwjz);
|
||||
useEffect(() => {
|
||||
dwjzRef.current = dwjz;
|
||||
}, [dwjz]);
|
||||
|
||||
const [share, setShare] = useState('');
|
||||
const [cost, setCost] = useState('');
|
||||
const [amount, setAmount] = useState('');
|
||||
const [profit, setProfit] = useState('');
|
||||
|
||||
const holdingSig = useMemo(() => {
|
||||
if (!holding) return '';
|
||||
return `${holding.id ?? ''}|${holding.share ?? ''}|${holding.cost ?? ''}`;
|
||||
}, [holding]);
|
||||
|
||||
useEffect(() => {
|
||||
if (holding) {
|
||||
const s = holding.share || 0;
|
||||
@@ -25,14 +34,17 @@ export default function HoldingEditModal({ fund, holding, onClose, onSave }) {
|
||||
setShare(String(s));
|
||||
setCost(String(c));
|
||||
|
||||
if (dwjz > 0) {
|
||||
const a = s * dwjz;
|
||||
const p = (dwjz - c) * s;
|
||||
const price = dwjzRef.current;
|
||||
if (price > 0) {
|
||||
const a = s * price;
|
||||
const p = (price - c) * s;
|
||||
setAmount(a.toFixed(2));
|
||||
setProfit(p.toFixed(2));
|
||||
}
|
||||
}
|
||||
}, [holding, fund, dwjz]);
|
||||
// 只在“切换持仓/初次打开”时初始化,避免净值刷新覆盖用户输入
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [holdingSig]);
|
||||
|
||||
const handleModeChange = (newMode) => {
|
||||
if (newMode === mode) return;
|
||||
|
||||
4
package-lock.json
generated
4
package-lock.json
generated
@@ -1,12 +1,12 @@
|
||||
{
|
||||
"name": "real-time-fund",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "real-time-fund",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"dependencies": {
|
||||
"@dicebear/collection": "^9.3.1",
|
||||
"@dicebear/core": "^9.3.1",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "real-time-fund",
|
||||
"version": "0.2.4",
|
||||
"version": "0.2.5",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"dev": "next dev",
|
||||
|
||||
Reference in New Issue
Block a user