v1.2.99 - 稳定版
This commit is contained in:
parent
a862cf9272
commit
3fd1e677ee
|
|
@ -1 +1 @@
|
|||
1.2.98
|
||||
1.2.99
|
||||
|
|
|
|||
|
|
@ -7,6 +7,8 @@ from datetime import datetime, date
|
|||
|
||||
from app.core.database import get_db
|
||||
from app.core.auth import get_current_user
|
||||
from app.core.coolbot_db import coolbot_engine
|
||||
from sqlalchemy import text
|
||||
from app.models.models import User, Information, Collection
|
||||
|
||||
router = APIRouter(prefix="/api/information", tags=["资讯"])
|
||||
|
|
@ -182,6 +184,88 @@ def match_collections_count(db: Session, user_id: str, expect_number: str) -> in
|
|||
return count
|
||||
|
||||
|
||||
def match_collections_count_from_coolbot(expect_number: str) -> int:
|
||||
"""根据号码特征计算匹配藏品数量(从coolbot_data数据库)"""
|
||||
if not expect_number or len(expect_number) != 10:
|
||||
return 0
|
||||
if not expect_number.startswith('J0'):
|
||||
return 0
|
||||
pattern = expect_number[2:]
|
||||
if not pattern:
|
||||
return 0
|
||||
|
||||
query = text("""
|
||||
SELECT id, crown_code FROM collections
|
||||
WHERE crown_code IS NOT NULL
|
||||
AND crown_code != ''
|
||||
AND LENGTH(crown_code) >= 10
|
||||
AND crown_code LIKE 'J0%'
|
||||
""")
|
||||
|
||||
try:
|
||||
with coolbot_engine.connect() as conn:
|
||||
result = conn.execute(query)
|
||||
match_count = 0
|
||||
for row in result:
|
||||
crown_code = row[1]
|
||||
if crown_code and len(crown_code) >= 10:
|
||||
col_pattern = crown_code[2:10]
|
||||
if match_pattern(col_pattern, pattern):
|
||||
match_count += 1
|
||||
return match_count
|
||||
except Exception as e:
|
||||
print(f"Error querying coolbot_data: {e}")
|
||||
return 0
|
||||
|
||||
|
||||
def match_collections_list_from_coolbot(expect_number: str, limit: int = 20) -> List[dict]:
|
||||
"""获取匹配的藏品列表(从coolbot_data数据库)"""
|
||||
if not expect_number or len(expect_number) != 10:
|
||||
return []
|
||||
if not expect_number.startswith('J0'):
|
||||
return []
|
||||
pattern = expect_number[2:]
|
||||
if not pattern:
|
||||
return []
|
||||
|
||||
query = text("""
|
||||
SELECT id, name, category, crown_code, price, post_title, post_url, author, post_crawled_at
|
||||
FROM collections
|
||||
WHERE crown_code IS NOT NULL
|
||||
AND crown_code != ''
|
||||
AND LENGTH(crown_code) >= 10
|
||||
AND crown_code LIKE 'J0%'
|
||||
""")
|
||||
|
||||
try:
|
||||
with coolbot_engine.connect() as conn:
|
||||
result = conn.execute(query)
|
||||
matched = []
|
||||
for row in result:
|
||||
crown_code = row[3]
|
||||
if crown_code and len(crown_code) >= 10:
|
||||
col_pattern = crown_code[2:10]
|
||||
if match_pattern(col_pattern, pattern):
|
||||
matched.append({
|
||||
"id": row[0],
|
||||
"name": row[1],
|
||||
"category": row[2],
|
||||
"crown_code": crown_code,
|
||||
"price": float(row[4]) if row[4] else None,
|
||||
"post_title": row[5],
|
||||
"post_url": row[6],
|
||||
"author": row[7],
|
||||
"post_crawled_at": str(row[8]) if row[8] else None
|
||||
})
|
||||
if len(matched) >= limit:
|
||||
break
|
||||
return matched
|
||||
except Exception as e:
|
||||
print(f"Error querying coolbot_data: {e}")
|
||||
return []
|
||||
|
||||
|
||||
|
||||
def match_pattern(col_number: str, pattern: str) -> bool:
|
||||
"""匹配号码特征模式"""
|
||||
# X = 任意数字
|
||||
|
|
@ -891,3 +975,91 @@ def get_publisher_info(
|
|||
"contact": contact,
|
||||
"created_at": info.created_at.isoformat() if info.created_at else None
|
||||
}
|
||||
|
||||
|
||||
# 获取网络数据匹配列表
|
||||
@router.get("/seek/network-match/{info_id}")
|
||||
def get_network_match(
|
||||
info_id: str,
|
||||
limit: int = Query(20, ge=1, le=100),
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""获取一尘数据库中匹配的藏品列表"""
|
||||
info = db.query(Information).filter(
|
||||
Information.id == info_id,
|
||||
Information.info_type == "seek"
|
||||
).first()
|
||||
|
||||
if not info:
|
||||
raise HTTPException(status_code=404, detail="寻配号信息不存在")
|
||||
|
||||
if not info.expect_number:
|
||||
return {"matched_count": 0, "collections": []}
|
||||
|
||||
matched = match_collections_list_from_coolbot(info.expect_number, limit=limit)
|
||||
|
||||
return {
|
||||
"matched_count": len(matched),
|
||||
"collections": matched
|
||||
}
|
||||
|
||||
|
||||
# 获取所有seek列表(包含网络匹配数量)
|
||||
@router.get("/seek/list")
|
||||
def get_seek_list_all(
|
||||
status: str = Query("active"),
|
||||
user_id: Optional[str] = None,
|
||||
user_only: bool = Query(False),
|
||||
current_user: Optional[User] = Depends(get_current_user),
|
||||
db: Session = Depends(get_db)
|
||||
):
|
||||
"""获取寻配号列表(包含网络匹配数量)"""
|
||||
query = db.query(Information).filter(
|
||||
Information.info_type == "seek",
|
||||
Information.status == status
|
||||
)
|
||||
|
||||
if user_only and current_user:
|
||||
query = query.filter(Information.user_id == current_user.f99_90_id)
|
||||
|
||||
if user_id:
|
||||
query = query.filter(Information.user_id == user_id)
|
||||
|
||||
items = query.order_by(Information.created_at.desc()).all()
|
||||
|
||||
result = []
|
||||
for item in items:
|
||||
# 计算自有匹配数量
|
||||
matched_count = 0
|
||||
if item.expect_number:
|
||||
matched_count = match_collections_count(db, current_user.f99_90_id if current_user else "", item.expect_number)
|
||||
|
||||
# 计算网络匹配数量
|
||||
network_matched_count = 0
|
||||
if item.expect_number:
|
||||
network_matched_count = match_collections_count_from_coolbot(item.expect_number)
|
||||
|
||||
result.append({
|
||||
"id": item.id,
|
||||
"user_id": item.user_id,
|
||||
"title": item.title,
|
||||
"content": item.content,
|
||||
"expect_category": item.expect_category,
|
||||
"expect_version": item.expect_version,
|
||||
"expect_packaging": item.expect_packaging,
|
||||
"expect_number": item.expect_number,
|
||||
"expect_price_min": item.expect_price_min,
|
||||
"expect_price_max": item.expect_price_max,
|
||||
"status": item.status,
|
||||
"is_matched": item.is_matched,
|
||||
"matched_user_id": item.matched_user_id,
|
||||
"matched_contact": item.matched_contact,
|
||||
"view_count": item.view_count,
|
||||
"contact_count": item.contact_count,
|
||||
"created_at": item.created_at.isoformat() if item.created_at else None,
|
||||
"user_name": item.user.f01_01_name if item.user else None,
|
||||
"matched_count": matched_count,
|
||||
"network_matched_count": network_matched_count
|
||||
})
|
||||
|
||||
return result
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
1.2.98
|
||||
1.2.99
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<title>甲辰收藏 v=1.2.98</title>
|
||||
<title>甲辰收藏 v=1.2.99</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/png" href="/static/icons/favicon.png" />
|
||||
|
|
|
|||
|
|
@ -9,6 +9,9 @@ export default function Home() {
|
|||
const [seekStats, setSeekStats] = useState({ seekCount: 0, matchedCount: 0 })
|
||||
const [recentPosts, setRecentPosts] = useState([])
|
||||
const [dragonStats, setDragonStats] = useState({})
|
||||
const [dealVersion, setDealVersion] = useState('龙钞')
|
||||
const [dealCategoryStats, setDealCategoryStats] = useState([])
|
||||
const [dealInfoList, setDealInfoList] = useState([])
|
||||
const currentPath = window.location.hash.slice(1) || '/'
|
||||
|
||||
useEffect(() => {
|
||||
|
|
@ -78,8 +81,16 @@ export default function Home() {
|
|||
}).catch(() => {})
|
||||
|
||||
// 获取寻配号统计数据
|
||||
fetch('/api/information/seek/stats').then(res => res.json()).then(data => {
|
||||
setSeekStats(data || {})
|
||||
// 获取寻配号统计数据
|
||||
fetch('/api/seek/stats').then(res => res.json()).then(data => {
|
||||
setSeekStats({ seekCount: data.total || 0, userMatchedCount: data.matched || 0, totalMatchedCount: data.unmatched || 0 })
|
||||
}).catch(() => {})
|
||||
|
||||
// 获取成交行情分类统计(需要登录获取全部数据)
|
||||
const token = localStorage.getItem('token')
|
||||
const headers = token ? { 'Authorization': 'Bearer ' + token } : {}
|
||||
fetch('/api/deal/list?page_size=500', { headers }).then(res => res.json()).then(data => {
|
||||
setDealInfoList(Array.isArray(data) ? data : (data.items || []))
|
||||
}).catch(() => {})
|
||||
}, [])
|
||||
|
||||
|
|
@ -172,7 +183,7 @@ export default function Home() {
|
|||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>快捷操作</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(2, 1fr)', gap: '12px' }}>
|
||||
<div onClick={() => window.location.hash = '#/add?mode=ocr'} style={{
|
||||
background: 'linear-gradient(135deg, #22c55e 0%, #16a34a 100%)',
|
||||
background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', border: '1px solid rgba(255,255,255,0.08)',
|
||||
borderRadius: '12px',
|
||||
padding: '12px 16px',
|
||||
cursor: 'pointer',
|
||||
|
|
@ -186,7 +197,7 @@ export default function Home() {
|
|||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '10px', marginTop: '2px' }}>AI识别添加</div>
|
||||
</div>
|
||||
<div onClick={() => window.location.hash = '#/add?mode=deal'} style={{
|
||||
background: 'linear-gradient(135deg, #ec4899 0%, #db2777 100%)',
|
||||
background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', border: '1px solid rgba(255,255,255,0.08)',
|
||||
borderRadius: '12px',
|
||||
padding: '12px 16px',
|
||||
cursor: 'pointer',
|
||||
|
|
@ -200,7 +211,7 @@ export default function Home() {
|
|||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '10px', marginTop: '2px' }}>录入成交行情</div>
|
||||
</div>
|
||||
<div onClick={() => window.location.hash = '#/news?type=seek'} style={{
|
||||
background: 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)',
|
||||
background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', border: '1px solid rgba(255,255,255,0.08)',
|
||||
borderRadius: '12px',
|
||||
padding: '12px 16px',
|
||||
cursor: 'pointer',
|
||||
|
|
@ -214,7 +225,7 @@ export default function Home() {
|
|||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '10px', marginTop: '2px' }}>发布寻配需求</div>
|
||||
</div>
|
||||
<div onClick={() => window.location.hash = '#/add?mode=manual'} style={{
|
||||
background: 'linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)',
|
||||
background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', border: '1px solid rgba(255,255,255,0.08)',
|
||||
borderRadius: '12px',
|
||||
padding: '12px 16px',
|
||||
cursor: 'pointer',
|
||||
|
|
@ -258,31 +269,141 @@ export default function Home() {
|
|||
</div>
|
||||
</div>
|
||||
|
||||
{/* 成交行情信息 */}
|
||||
<div style={{ marginBottom: '20px' }}>
|
||||
{(() => {
|
||||
const versions = ['龙钞', '马钞', '蛇钞', '其他']
|
||||
const packagings = ['标百', '标十', '单张']
|
||||
const categories = ['带4号', '带7号', '永恒号', '永恒', '钻石号', '钻石', '如意号', '朦胧号', '朦胧王', '天马号', '金山号', '金马号', '天马王', '金山王', '金马王', '倒置号', '圆圆号', '通货', '无4']
|
||||
|
||||
const normalizeCat = (c) => {
|
||||
if (c === '通货') return '带4号'
|
||||
if (c === '无4') return '带7号'
|
||||
return c
|
||||
}
|
||||
|
||||
const filteredData = dealInfoList.filter(item => {
|
||||
const serial = (item.title || '').split('-')[0] || ''
|
||||
let version = '其他'
|
||||
if (serial.startsWith('J0')) version = '龙钞'
|
||||
else if (serial.startsWith('J1')) version = '马钞'
|
||||
else if (serial.startsWith('J3')) version = '蛇钞'
|
||||
if (version !== dealVersion) return false
|
||||
return true
|
||||
})
|
||||
|
||||
const calcAvg = (pkg, cat) => {
|
||||
const items = filteredData.filter(item => {
|
||||
const content = item.content || ''
|
||||
const p = content.includes('包装:') ? content.split('包装:')[1].split('\n')[0].trim() : (item.packaging || '')
|
||||
let c = content.includes('分类:') ? content.split('分类:')[1].split('\n')[0].trim() : (item.category || '')
|
||||
c = normalizeCat(c)
|
||||
return p === pkg && c === cat
|
||||
})
|
||||
if (items.length === 0) return null
|
||||
const sum = items.reduce((a, b) => a + (b.deal_price || 0), 0)
|
||||
return { avg: Math.round(sum / items.length), count: items.length, items }
|
||||
}
|
||||
|
||||
return (
|
||||
<div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>💰 龙钞成交数据分类汇总(均价)</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '16px', border: '1px solid rgba(255,255,255,0.08)' }}>
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<div style={{ display: 'flex', gap: '12px', flexWrap: 'wrap', marginBottom: '12px' }}>
|
||||
{versions.map(v => (
|
||||
<button key={v} onClick={() => setDealVersion(v)}
|
||||
style={{ padding: '6px 16px', borderRadius: '8px', border: 'none', cursor: 'pointer',
|
||||
background: dealVersion === v ? '#3b82f6' : 'rgba(255,255,255,0.1)',
|
||||
color: '#fff', fontSize: '13px', fontWeight: dealVersion === v ? '600' : '400' }}>
|
||||
{v}
|
||||
</button>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style={{ overflowX: 'auto' }}>
|
||||
<table style={{ width: '100%', borderCollapse: 'collapse', fontSize: '13px' }}>
|
||||
<thead>
|
||||
<tr>
|
||||
<th style={{ padding: '8px', textAlign: 'left', color: 'rgba(255,255,255,0.5)', borderBottom: '1px solid rgba(255,255,255,0.1)' }}></th>
|
||||
{packagings.map(p => (
|
||||
<th key={p} style={{ padding: '8px', textAlign: 'center', color: 'rgba(255,255,255,0.5)', borderBottom: '1px solid rgba(255,255,255,0.1)' }}>{p}</th>
|
||||
))}
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{(() => {
|
||||
const catAvg = categories.map(cat => {
|
||||
const prices = []
|
||||
packagings.forEach(pkg => {
|
||||
const d = calcAvg(pkg, cat)
|
||||
if (d) prices.push(d.avg)
|
||||
})
|
||||
const avg = prices.length > 0 ? Math.round(prices.reduce((a,b) => a+b, 0) / prices.length) : 0
|
||||
return { cat, avg }
|
||||
}).filter(c => c.avg > 0)
|
||||
|
||||
catAvg.sort((a, b) => a.avg - b.avg)
|
||||
const categoryOrder = ['带4号', '带7号', '永恒号', '天马号', '天马王', '金山号', '金山王', '钻石号', '朦胧号', '朦胧王', '金马号', '金马王', '倒置号', '圆圆号']
|
||||
const sortedCats = categoryOrder.filter(cat => catAvg.some(c => c.cat === cat))
|
||||
.concat(catAvg.filter(c => !categoryOrder.includes(c.cat)).map(c => c.cat))
|
||||
|
||||
return sortedCats.map(cat => {
|
||||
const rowData = packagings.map(pkg => calcAvg(pkg, cat))
|
||||
const hasData = rowData.some(d => d !== null)
|
||||
if (!hasData) return null
|
||||
return (
|
||||
<tr key={cat}>
|
||||
<td style={{ padding: '8px', color: '#fbbf24', fontWeight: '500', borderBottom: '1px solid rgba(255,255,255,0.05)' }}>{cat}</td>
|
||||
{rowData.map((d, i) => (
|
||||
<td key={i} style={{ padding: '8px', textAlign: 'center', borderBottom: '1px solid rgba(255,255,255,0.05)' }}>
|
||||
{d ? (
|
||||
<div style={{ color: '#22c55e', fontWeight: '600' }}>
|
||||
¥{d.avg.toLocaleString()}
|
||||
<span style={{ color: 'rgba(255,255,255,0.4)', fontSize: '11px', marginLeft: '4px' }}>({d.count})</span>
|
||||
</div>
|
||||
) : <span style={{ color: 'rgba(255,255,255,0.2)' }}>-</span>}
|
||||
</td>
|
||||
))}
|
||||
</tr>
|
||||
)
|
||||
})
|
||||
})()}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
})()}
|
||||
</div>
|
||||
|
||||
{/* 一尘今日数据 */}
|
||||
<div style={{ marginBottom: '20px' }}>
|
||||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>📊 一尘今日连体纪念钞数据</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: '8px' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(59,130,246,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#60a5fa', fontSize: '20px', fontWeight: '700' }}>{yichensStats.total || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>总帖子</div>
|
||||
</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(16,185,129,0.15) 0%, rgba(16,185,129,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(16,185,129,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#34d399', fontSize: '20px', fontWeight: '700' }}>{yichensStats.deals || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>出售</div>
|
||||
</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(245,158,11,0.15) 0%, rgba(245,158,11,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(245,158,11,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#fbbf24', fontSize: '20px', fontWeight: '700' }}>{yichensStats.wants || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>求购</div>
|
||||
</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(139,92,246,0.15) 0%, rgba(139,92,246,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(139,92,246,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#a78bfa', fontSize: '20px', fontWeight: '700' }}>{yichensStats.dragons || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>龙钞</div>
|
||||
</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(236,72,153,0.15) 0%, rgba(236,72,153,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(236,72,153,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#f472b6', fontSize: '20px', fontWeight: '700' }}>{yichensStats.horses || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>马钞</div>
|
||||
</div>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(20,184,166,0.15) 0%, rgba(20,184,166,0.05) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(20,184,166,0.2)', textAlign: 'center' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '12px 8px', border: '1px solid rgba(255,255,255,0.08)', textAlign: 'center' }}>
|
||||
<div style={{ color: '#2dd4bf', fontSize: '20px', fontWeight: '700' }}>{yichensStats.tianma || 0}</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '10px' }}>天马</div>
|
||||
</div>
|
||||
|
|
@ -292,43 +413,43 @@ export default function Home() {
|
|||
{/* 今日龙钞帖子数据统计 */}
|
||||
<div style={{ marginBottom: '20px' }}>
|
||||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', marginBottom: '12px', paddingLeft: '4px' }}>🐉 今日龙钞帖子数据统计</div>
|
||||
<div style={{ background: 'linear-gradient(180deg, rgba(99,102,241,0.15) 0%, rgba(99,102,241,0.05) 100%)', borderRadius: '12px', padding: '16px', border: '1px solid rgba(99,102,241,0.2)' }}>
|
||||
<div style={{ background: 'linear-gradient(135deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0.02) 100%)', borderRadius: '12px', padding: '16px', border: '1px solid rgba(255,255,255,0.08)' }}>
|
||||
{/* 表头 */}
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px', marginBottom: '8px' }}>
|
||||
<div></div>
|
||||
<div style={{ color: '#22c55e', fontSize: '14px', fontWeight: '600', textAlign: 'center' }}>出售</div>
|
||||
<div style={{ color: '#f97316', fontSize: '14px', fontWeight: '600', textAlign: 'center' }}>求购</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '600', textAlign: 'center' }}>出售</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '600', textAlign: 'center' }}>求购</div>
|
||||
<div style={{ color: 'rgba(255,255,255,0.7)', fontSize: '14px', fontWeight: '600', textAlign: 'center' }}>合计</div>
|
||||
</div>
|
||||
{/* 数据行 */}
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px', marginBottom: '6px' }}>
|
||||
<div style={{ color: '#ef4444', fontSize: '14px', fontWeight: '500' }}>带4</div>
|
||||
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.dai4?.deals || 0}</div>
|
||||
<div style={{ color: '#f97316', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.dai4?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '500' }}>带4</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.dai4?.deals || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.dai4?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{(dragonStats.dai4?.deals || 0) + (dragonStats.dai4?.wants || 0)}</div>
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px', marginBottom: '6px' }}>
|
||||
<div style={{ color: '#06b6d4', fontSize: '14px', fontWeight: '500' }}>带7号</div>
|
||||
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu4?.deals || 0}</div>
|
||||
<div style={{ color: '#f97316', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu4?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '500' }}>带7号</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu4?.deals || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu4?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{(dragonStats.wu4?.deals || 0) + (dragonStats.wu4?.wants || 0)}</div>
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px', marginBottom: '6px' }}>
|
||||
<div style={{ color: '#3b82f6', fontSize: '14px', fontWeight: '500' }}>无47</div>
|
||||
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu47?.deals || 0}</div>
|
||||
<div style={{ color: '#f97316', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu47?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '500' }}>无47</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu47?.deals || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu47?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{(dragonStats.wu47?.deals || 0) + (dragonStats.wu47?.wants || 0)}</div>
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px', marginBottom: '6px' }}>
|
||||
<div style={{ color: '#a855f7', fontSize: '14px', fontWeight: '500' }}>无247</div>
|
||||
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu247?.deals || 0}</div>
|
||||
<div style={{ color: '#f97316', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu247?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '500' }}>无247</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu247?.deals || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu247?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{(dragonStats.wu247?.deals || 0) + (dragonStats.wu247?.wants || 0)}</div>
|
||||
</div>
|
||||
<div style={{ display: 'grid', gridTemplateColumns: '60px 1fr 1fr 1fr', gap: '8px' }}>
|
||||
<div style={{ color: '#ec4899', fontSize: '14px', fontWeight: '500' }}>无347</div>
|
||||
<div style={{ color: '#22c55e', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu347?.deals || 0}</div>
|
||||
<div style={{ color: '#f97316', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu347?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '14px', fontWeight: '500' }}>无347</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu347?.deals || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{dragonStats.wu347?.wants || 0}</div>
|
||||
<div style={{ color: '#fff', fontSize: '18px', fontWeight: '700', textAlign: 'center' }}>{(dragonStats.wu347?.deals || 0) + (dragonStats.wu347?.wants || 0)}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@ export default function News() {
|
|||
let url = activeTab === 'yichen'
|
||||
? `${API_BASE}/api/information/list?info_type=${activeTab}`
|
||||
: activeTab === 'seek'
|
||||
? `${API_BASE}/api/seek/list`
|
||||
? `${API_BASE}/api/information/seek/list`
|
||||
: `${API_BASE}/api/deal/list`
|
||||
|
||||
// 成交行情和寻配号每页500条
|
||||
|
|
@ -303,7 +303,7 @@ export default function News() {
|
|||
const token = localStorage.getItem('token')
|
||||
if (!token) { alert('请先登录'); return }
|
||||
try {
|
||||
const res = await fetch(`${API_BASE}/api/seek/list`, {
|
||||
const res = await fetch(`${API_BASE}/api/information/seek/list`, {
|
||||
headers: { Authorization: `Bearer ${token}` }
|
||||
})
|
||||
const data = await res.json()
|
||||
|
|
@ -319,7 +319,7 @@ export default function News() {
|
|||
const token = localStorage.getItem('token')
|
||||
if (!token) { alert('请先登录'); return }
|
||||
try {
|
||||
const res = await fetch(`${API_BASE}/api/seek/list`, {
|
||||
const res = await fetch(`${API_BASE}/api/information/seek/list`, {
|
||||
headers: { Authorization: `Bearer ${token}` }
|
||||
})
|
||||
const data = await res.json()
|
||||
|
|
|
|||
Loading…
Reference in New Issue