v0.1.1 - 认购功能优化(已结束群灰色显示、标题显示)

This commit is contained in:
甲辰生产 2026-04-29 21:23:33 +08:00
parent 1fef5177f3
commit 5a5ec0ee2c
2 changed files with 29 additions and 53 deletions

View File

@ -1,55 +1,22 @@
{ {
"version": "0.0.12", "version": "0.1.1",
"updated": "2026-04-24", "updated": "2026-04-29",
"modules": { "modules": {
"frontend": { "frontend": {
"version": "0.0.12", "version": "0.1.1",
"pages": { "pages": {
"Add": "0.0.1", "Home": "0.1.0",
"Admin": "0.0.1", "Purchase": "0.1.1"
"Detail": "0.0.1",
"Edit": "0.0.1",
"Home": "0.0.7",
"List": "0.0.1",
"Login": "0.0.1",
"News": "0.0.8",
"News_YichensBoard": "0.0.1",
"Settings": "0.0.1",
"Stats": "0.0.1",
"YichensBoard": "0.0.3"
},
"config": {
"version": "0.0.7"
} }
}, },
"backend": { "backend": {
"version": "0.0.12", "version": "0.1.1",
"routers": { "routers": {
"auth": "0.0.1", "purchase": "0.1.0"
"collections": "0.0.1",
"deal": "0.0.1",
"information": "0.0.2",
"news": "0.0.1",
"ocr": "0.0.1",
"operations": "0.0.1",
"seek": "0.0.9",
"users": "0.0.1",
"yichens": "0.0.1"
}, },
"app": { "models": {
"core": "0.0.1", "purchase": "0.1.0"
"models": "0.0.1",
"schemas": "0.0.1",
"services": "0.0.1",
"utils": "0.0.1"
} }
} }
},
"changelog": {
"0.0.9": [
"Home.jsx: 修复寻配号数据统计API",
"News.jsx: 寻配号功能稳定版(自有匹配+网络匹配缓存)",
"seek.py: 路由优化,留言功能迁移,缓存机制"
]
} }
} }

View File

@ -199,27 +199,35 @@ function Purchase() {
} }
// //
const renderGroupCard = (group, showJoin = false) => ( const renderGroupCard = (group, showJoin = false) => {
const isMyGroup = myGroups.some(g => g.id === group.id)
const isClosed = group.status === 'closed'
return (
<div <div
key={group.id} key={group.id}
onClick={() => viewGroupDetail(group.id)} onClick={() => viewGroupDetail(group.id)}
style={{ style={{
background: 'linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%)', background: isClosed ? 'rgba(80,80,80,0.3)' : isMyGroup ? 'linear-gradient(135deg, rgba(16,185,129,0.15) 0%, rgba(16,185,129,0.05) 100%)' : 'linear-gradient(135deg, rgba(59,130,246,0.15) 0%, rgba(59,130,246,0.05) 100%)',
borderRadius: '12px', borderRadius: '12px',
padding: '16px', padding: '16px',
border: '1px solid rgba(59,130,246,0.2)', border: isClosed ? '1px solid rgba(100,100,100,0.3)' : isMyGroup ? '1px solid rgba(16,185,129,0.2)' : '1px solid rgba(59,130,246,0.2)',
cursor: 'pointer', cursor: 'pointer',
marginBottom: '12px' marginBottom: '12px',
opacity: isClosed ? 0.7 : 1
}} }}
> >
<div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}> <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center' }}>
<div> <div>
<div style={{ color: '#fff', fontSize: '16px', fontWeight: 'bold' }}>{group.name}</div> <div style={{ color: isClosed ? '#999' : '#fff', fontSize: '16px', fontWeight: 'bold' }}>{group.name} {isClosed && '(已结束)'}</div>
<div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '12px', marginTop: '4px' }}> <div style={{ color: 'rgba(255,255,255,0.5)', fontSize: '12px', marginTop: '4px' }}>
群主: {group.creator_name} · {group.total_members}人参与 编码:{group.group_code} · 群主:{group.creator_name} · {group.total_members}人参与
</div> </div>
</div> </div>
{showJoin && ( {isClosed ? (
<div style={{ background: '#555', color: '#aaa', borderRadius: '6px', padding: '8px 12px', fontSize: '12px' }}>已结束</div>
) : isMyGroup ? (
<div style={{ background: '#10b981', color: '#fff', borderRadius: '6px', padding: '8px 16px', fontSize: '13px' }}>已加入</div>
) : showJoin && (
<button <button
onClick={(e) => { e.stopPropagation(); joinGroup(group.id) }} onClick={(e) => { e.stopPropagation(); joinGroup(group.id) }}
style={{ style={{
@ -242,7 +250,8 @@ function Purchase() {
<span>均价: {formatMoney(group.avg_price)}</span> <span>均价: {formatMoney(group.avg_price)}</span>
</div> </div>
</div> </div>
) )
}
// //
if (selectedGroup) { if (selectedGroup) {
@ -269,7 +278,7 @@ function Purchase() {
</button> </button>
<div style={{ flex: 1 }}> <div style={{ flex: 1 }}>
<div style={{ fontSize: '18px', fontWeight: 'bold' }}>{selectedGroup.name}</div> <div style={{ fontSize: '18px', fontWeight: 'bold' }}>{selectedGroup.name} {selectedGroup.status === 'closed' ? '(已结束)' : ''}</div>
<div style={{ fontSize: '12px', color: 'rgba(255,255,255,0.5)' }}> <div style={{ fontSize: '12px', color: 'rgba(255,255,255,0.5)' }}>
群主: {selectedGroup.creator_name} · {selectedGroup.status === 'active' ? '进行中' : '已结束'} 群主: {selectedGroup.creator_name} · {selectedGroup.status === 'active' ? '进行中' : '已结束'}
</div> </div>
@ -513,7 +522,7 @@ function Purchase() {
cursor: 'pointer' cursor: 'pointer'
}} }}
> >
参与({myGroups.length}) 认购 ({myGroups.length})
</button> </button>
<button <button
onClick={() => setActiveTab('all')} onClick={() => setActiveTab('all')}
@ -528,7 +537,7 @@ function Purchase() {
cursor: 'pointer' cursor: 'pointer'
}} }}
> >
所有认购群 ({allGroups.length}) 全部认购群 ({allGroups.length})
</button> </button>
</div> </div>