版本更新: v1.2.18 - 寻号发布功能优化版

This commit is contained in:
甲辰生产 2026-03-27 01:20:03 +08:00
parent f29629bfcc
commit 18b6cfbc1d
2 changed files with 48 additions and 13 deletions

View File

@ -4,7 +4,7 @@
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no"> <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"> <meta name="apple-mobile-web-app-capable" content="yes">
<title>甲辰收藏 v1.2.16</title> <title>甲辰收藏 v1.2.17</title>
<!-- Favicon --> <!-- Favicon -->
<link rel="icon" type="image/x-icon" href="/static/icons/favicon.ico" /> <link rel="icon" type="image/x-icon" href="/static/icons/favicon.ico" />

View File

@ -5,7 +5,7 @@ export default function News() {
const [activeTab, setActiveTab] = useState('deal') const [activeTab, setActiveTab] = useState('deal')
const [showSeekPublish, setShowSeekPublish] = useState(false) const [showSeekPublish, setShowSeekPublish] = useState(false)
const [seekForm, setSeekForm] = useState({ const [seekForm, setSeekForm] = useState({
edition: '龙钞', type: '标百', category: '寻号', price: '', matchType: '模糊', features: '', content: '', title: '', contact: '' edition: '龙钞', type: '标百', category: '寻号', price: '', matchType: '模糊', features: 'J0', content: '', title: '', contact: ''
}) })
const [infoList, setInfoList] = useState([]) const [infoList, setInfoList] = useState([])
const [loading, setLoading] = useState(false) const [loading, setLoading] = useState(false)
@ -19,7 +19,7 @@ export default function News() {
// //
useEffect(() => { useEffect(() => {
const title = `「寻号 ${seekForm.edition} ${seekForm.type} ${seekForm.features || '号码特征'} ${seekForm.matchType}` const title = `「寻号 ${seekForm.edition || '龙钞,马钞,蛇钞'} ${seekForm.type} ${seekForm.features || 'J0'} ${seekForm.matchType}`
setSeekForm(prev => ({...prev, title})) setSeekForm(prev => ({...prev, title}))
}, [seekForm.edition, seekForm.type, seekForm.features, seekForm.matchType]) }, [seekForm.edition, seekForm.type, seekForm.features, seekForm.matchType])
@ -53,7 +53,7 @@ export default function News() {
if (data.id || data.code === 0) { if (data.id || data.code === 0) {
alert('发布成功!') alert('发布成功!')
setShowSeekPublish(false) setShowSeekPublish(false)
setSeekForm({ edition: '龙钞', type: '标百', category: '寻号', price: '', matchType: '模糊', features: '', content: '', title: '', contact: '' }) setSeekForm({ edition: '龙钞', type: '标百', category: '寻号', price: '', matchType: '模糊', features: 'J0', content: '', title: '', contact: '' })
fetchInfoList() fetchInfoList()
} else { alert(data.message || '发布失败') } } else { alert(data.message || '发布失败') }
} catch (e) { alert('发布失败: ' + e.message) } } catch (e) { alert('发布失败: ' + e.message) }
@ -100,10 +100,22 @@ export default function News() {
<div style={{ background: '#1e293b', borderRadius: '12px', padding: '16px', marginBottom: '16px' }}> <div style={{ background: '#1e293b', borderRadius: '12px', padding: '16px', marginBottom: '16px' }}>
<div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>版别</label> <div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>版别</label>
<div style={{ display: 'flex', gap: '8px', marginTop: '6px' }}> <div style={{ display: 'flex', gap: '8px', marginTop: '6px' }}>
{['龙钞','马钞','蛇钞','其他'].map(e => ( {['龙钞','马钞','蛇钞'].map(item => {
<button key={e} onClick={() => setSeekForm({...seekForm, edition: e})} const isSelected = seekForm.edition ? seekForm.edition.split(',').includes(item) : false
style={{ flex: 1, padding: '8px', borderRadius: '6px', border: seekForm.edition===e?'2px solid #10b981':'1px solid #334155', background: seekForm.edition===e?'rgba(16,185,129,0.2)':'#0f172a', color: '#fff', fontSize: '12px' }}>{e}</button> return (
))} <button key={item} onClick={() => {
const eds = seekForm.edition ? seekForm.edition.split(',').filter(x => x) : []
if (isSelected) {
const idx = eds.indexOf(item)
if (idx > -1) eds.splice(idx, 1)
} else {
eds.push(item)
}
setSeekForm({...seekForm, edition: eds.join(',')})
}}
style={{ flex: 1, padding: '8px', borderRadius: '6px', border: isSelected?'2px solid #10b981':'1px solid #334155', background: isSelected?'rgba(16,185,129,0.2)':'#0f172a', color: '#fff', fontSize: '12px' }}>{item}</button>
)
})}
</div> </div>
</div> </div>
<div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>类型</label> <div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>类型</label>
@ -134,9 +146,32 @@ export default function News() {
))} ))}
</div> </div>
</div> </div>
<div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>号码特征</label> <div style={{ marginBottom: '8px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>号码特征10</label>
<input type="text" value={seekForm.features} onChange={(e) => setSeekForm({...seekForm, features: e.target.value})} placeholder="如: 8888/7777/开门号" <div style={{ display: 'flex', gap: '4px', marginTop: '6px', flexWrap: 'wrap' }}>
style={{ width: '100%', padding: '8px', marginTop: '6px', background: '#0f172a', border: '1px solid #334155', borderRadius: '6px', color: '#fff', fontSize: '13px', boxSizing: 'border-box' }} /> {[0,1,2,3,4,5,6,7,8,9].map(i => {
const isFixed = i < 2
const placeholder = isFixed ? (i === 0 ? 'J' : '0') : 'X'
return <input key={i} ref={el => { if (el) el.dataset.index = i }} type="text" maxLength={1}
value={isFixed ? placeholder : (seekForm.features?.[i] || '')}
readOnly={isFixed}
onChange={(e) => {
if (i < 2) return
const arr = (seekForm.features || 'J0XXXXXXXX').split('')
arr[i] = e.target.value.toUpperCase()
setSeekForm({...seekForm, features: arr.join('')})
//
if (e.target.value && i < 9) {
setTimeout(() => {
const nextInput = document.querySelector(`input[data-index="${i+1}"]`)
if (nextInput) nextInput.focus()
}, 0)
}
}}
placeholder={placeholder}
style={{ width: '32px', height: '36px', textAlign: 'center', padding: '6px', background: '#0f172a', border: '1px solid #334155', borderRadius: '4px', color: isFixed ? '#10b981' : '#fff', fontSize: '14px', boxSizing: 'border-box' }} />
})}
</div>
<div style={{ color: '#64748b', fontSize: '10px', marginTop: '6px' }}>X=任意数字 A=非4 B=非47 C=非347 D=非247 E=非2347 F=非12347 F=非23457 G=非123457</div>
</div> </div>
<div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>正文</label> <div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>正文</label>
<textarea value={seekForm.content || ''} onChange={(e) => setSeekForm({...seekForm, content: e.target.value})} placeholder="请输入详细信息..." <textarea value={seekForm.content || ''} onChange={(e) => setSeekForm({...seekForm, content: e.target.value})} placeholder="请输入详细信息..."
@ -148,7 +183,7 @@ export default function News() {
</div> </div>
<div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>标题自动生成</label> <div style={{ marginBottom: '12px' }}><label style={{ color: '#94a3b8', fontSize: '12px' }}>标题自动生成</label>
<input type="text" value={seekForm.title} readOnly <input type="text" value={seekForm.title} readOnly
style={{ width: '100%', padding: '8px', marginTop: '6px', background: '#0f172a', border: '1px solid #334155', borderRadius: '6px', color: '#10b981', fontSize: '13px', boxSizing: 'border-box' }} /> style={{ width: '100%', padding: '8px', marginTop: '6px', background: '#0f172a', border: '1px solid #334155', borderRadius: '6px', color: '#fff', fontSize: '13px', boxSizing: 'border-box' }} onChange={(e) => setSeekForm({...seekForm, title: e.target.value})} />
</div> </div>
<div style={{ display: 'flex', gap: '12px' }}> <div style={{ display: 'flex', gap: '12px' }}>
<button onClick={handleSeekPublish} style={{ flex: 1, padding: '12px', background: '#10b981', border: 'none', borderRadius: '8px', color: '#fff', fontSize: '14px', fontWeight: 'bold', cursor: 'pointer' }}>发布寻号</button> <button onClick={handleSeekPublish} style={{ flex: 1, padding: '12px', background: '#10b981', border: 'none', borderRadius: '8px', color: '#fff', fontSize: '14px', fontWeight: 'bold', cursor: 'pointer' }}>发布寻号</button>
@ -161,7 +196,7 @@ export default function News() {
{activeTab === 'seek' && ( {activeTab === 'seek' && (
<div style={{ display: 'flex', gap: '8px', marginLeft: 'auto' }}> <div style={{ display: 'flex', gap: '8px', marginLeft: 'auto' }}>
<button onClick={() => setShowSeekPublish(!showSeekPublish)} style={{ padding: '6px 12px', background: showSeekPublish ? '#6b7280' : '#10b981', border: 'none', borderRadius: '6px', color: '#fff', fontSize: '12px', cursor: 'pointer' }}> <button onClick={() => setShowSeekPublish(!showSeekPublish)} style={{ padding: '6px 12px', background: showSeekPublish ? '#6b7280' : '#10b981', border: 'none', borderRadius: '6px', color: '#fff', fontSize: '12px', cursor: 'pointer' }}>
{showSeekPublish ? '✕ 收起' : '+ 发布寻号'} '+ 发布寻号'
</button> </button>
</div> </div>
)} )}