版本更新: v1.2.16 - 用户信息完善版本
This commit is contained in:
parent
a71697aed0
commit
2aae399ce4
|
|
@ -1 +1 @@
|
|||
VERSION=1.2.15
|
||||
VERSION=1.2.16
|
||||
|
|
|
|||
|
|
@ -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>甲辰收藏 v1.2.14</title>
|
||||
<title>甲辰收藏 v1.2.15</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="/static/icons/favicon.ico" />
|
||||
|
|
|
|||
|
|
@ -8,13 +8,15 @@ export default function Info() {
|
|||
const [editingItem, setEditingItem] = useState(null)
|
||||
|
||||
const [formData, setFormData] = useState({
|
||||
edition: '龙钞', type: '标百', isGraded: true, category: '成交', source: '直播', title: '', content: ''
|
||||
edition: '龙钞', type: '标百', isGraded: true, category: '成交', source: '直播', title: ''
|
||||
})
|
||||
const [content, setContent] = useState('')
|
||||
|
||||
useEffect(() => {
|
||||
if (activeTab === 'manage') fetchMyList()
|
||||
}, [activeTab])
|
||||
|
||||
// 自动生成标题
|
||||
useEffect(() => {
|
||||
const now = new Date()
|
||||
const date = `${now.getFullYear()}/${now.getMonth() + 1}/${now.getDate()}`
|
||||
|
|
@ -41,13 +43,14 @@ export default function Info() {
|
|||
const token = localStorage.getItem('token')
|
||||
const res = await fetch(`${API_BASE}/api/information/`, {
|
||||
method: 'POST', headers: { 'Authorization': `Bearer ${token}`, 'Content-Type': 'application/json' },
|
||||
body: JSON.stringify({ title: formData.title, content: formData.content, info_type: formData.category === '成交' ? 'deal' : 'seek' })
|
||||
body: JSON.stringify({ title: formData.title, content: content, info_type: formData.category === '成交' ? 'deal' : 'seek' })
|
||||
})
|
||||
const data = await res.json()
|
||||
if (data.id || data.code === 0) {
|
||||
alert('发布成功!')
|
||||
setShowPublish(false)
|
||||
setFormData({ edition: '龙钞', type: '标百', isGraded: true, category: '成交', source: '直播', title: '', content: '' })
|
||||
setFormData({ edition: '龙钞', type: '标百', isGraded: true, category: '成交', source: '直播', title: '' })
|
||||
setContent('')
|
||||
fetchMyList()
|
||||
} else { alert(data.message || '发布失败') }
|
||||
} catch (e) { alert('发布失败: ' + e.message) }
|
||||
|
|
@ -109,10 +112,10 @@ export default function Info() {
|
|||
{/* 顶部标签 */}
|
||||
<div style={{ position: 'sticky', top: 0, background: 'rgba(15,23,42,0.95)', backdropFilter: 'blur(10px)', padding: '16px 20px', borderBottom: '1px solid #1e293b', zIndex: 100 }}>
|
||||
<div style={{ display: 'flex', gap: '8px', background: '#1e293b', borderRadius: '12px', padding: '4px' }}>
|
||||
{[{ key: 'publish', label: '📝 发布行情', icon: '📝' }, { key: 'manage', label: '📋 发布管理', icon: '📋' }].map(t => (
|
||||
{[{ key: 'publish', label: '📝 寻配号发布' }, { key: 'manage', label: '📋 发布管理' }].map(t => (
|
||||
<div key={t.key} onClick={() => setActiveTab(t.key)}
|
||||
style={{ flex: 1, padding: '12px 16px', borderRadius: '10px', background: activeTab === t.key ? 'linear-gradient(135deg, #3b82f6 0%, #2563eb 100%)' : 'transparent',
|
||||
color: activeTab === t.key ? '#fff' : '#9ca3af', cursor: 'pointer', textAlign: 'center', fontSize: '14px', fontWeight: '600', transition: 'all 0.3s', boxShadow: activeTab === t.key ? '0 2px 10px rgba(59,130,246,0.4)' : 'none' }}>
|
||||
color: activeTab === t.key ? '#fff' : '#9ca3af', cursor: 'pointer', textAlign: 'center', fontSize: '14px', fontWeight: '600', transition: 'all 0.3s' }}>
|
||||
{t.label}
|
||||
</div>
|
||||
))}
|
||||
|
|
@ -120,26 +123,37 @@ export default function Info() {
|
|||
</div>
|
||||
|
||||
<div style={{ padding: '20px' }}>
|
||||
{/* 寻配号发布 - 提示页面 */}
|
||||
{activeTab === 'publish' && (
|
||||
<div style={{ padding: '40px', textAlign: 'center', color: '#94a3b8' }}>
|
||||
<div style={{ fontSize: '48px', marginBottom: '16px' }}>📝</div>
|
||||
<div style={{ fontSize: '16px', marginBottom: '8px', color: '#fff' }}>寻配号发布</div>
|
||||
<div style={{ fontSize: '13px' }}>请到「发布管理」tab进行发布</div>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* 发布管理 */}
|
||||
{activeTab === 'manage' && (
|
||||
<div>
|
||||
{/* 新增按钮 */}
|
||||
<div style={{ display: 'flex', justifyContent: 'flex-end', marginBottom: '20px' }}>
|
||||
<Card title="📋 发布管理">
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<button onClick={() => setShowPublish(!showPublish)}
|
||||
style={{ background: showPublish ? 'linear-gradient(135deg, #6b7280 0%, #4b5563 100%)' : 'linear-gradient(135deg, #10b981 0%, #059669 100%)',
|
||||
color: '#fff', border: 'none', padding: '12px 24px', borderRadius: '10px', cursor: 'pointer', fontSize: '14px', fontWeight: '600', boxShadow: '0 4px 15px rgba(16,185,129,0.3)', transition: 'all 0.3s' }}>
|
||||
{showPublish ? '✕ 收起表单' : '+ 新增发布'}
|
||||
color: '#fff', border: 'none', padding: '12px 24px', borderRadius: '10px', cursor: 'pointer', fontSize: '14px', fontWeight: '600' }}>
|
||||
{showPublish ? '✕ 收起' : '+ 新增发布'}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
{/* 发布表单 */}
|
||||
{showPublish && (
|
||||
<Card title="📝 发布行情信息">
|
||||
<div style={{ background: '#0f172a', borderRadius: '12px', padding: '16px', marginBottom: '16px' }}>
|
||||
<BtnGroup label="版别" options={[
|
||||
{ value: '龙钞', label: '🐉 龙钞' }, { value: '马钞', label: '🐎 马钞' }, { value: '蛇钞', label: '🐍 蛇钞' }, { value: '其他', label: '📄 其他' }
|
||||
]} value={formData.edition} onChange={v => setFormData({...formData, edition: v})} />
|
||||
|
||||
<div style={{ display: 'flex', gap: '12px', marginBottom: '16px' }}>
|
||||
<div style={{ flex: 2 }}>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px', fontWeight: '500' }}>类型</div>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px' }}>类型</div>
|
||||
<div style={{ display: 'flex', gap: '6px' }}>
|
||||
{['标百', '标十', '单张'].map(t => (
|
||||
<button key={t} onClick={() => setFormData({...formData, type: t})}
|
||||
|
|
@ -149,7 +163,7 @@ export default function Info() {
|
|||
</div>
|
||||
</div>
|
||||
<div style={{ flex: 1 }}>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px', fontWeight: '500' }}>是否评级</div>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px' }}>是否评级</div>
|
||||
<button onClick={() => setFormData({...formData, isGraded: !formData.isGraded})}
|
||||
style={{ width: '100%', padding: '10px', borderRadius: '8px', border: formData.isGraded ? '2px solid #10b981' : '1px solid #374151',
|
||||
background: formData.isGraded ? 'rgba(16,185,129,0.15)' : '#1f2937', color: formData.isGraded ? '#10b981' : '#d1d5db', cursor: 'pointer', fontSize: '13px' }}>
|
||||
|
|
@ -162,36 +176,28 @@ export default function Info() {
|
|||
{ value: '成交', label: '💰 成交' }, { value: '求购', label: '🔍 求购' }, { value: '出售', label: '💵 出售' }
|
||||
]} value={formData.category} onChange={v => setFormData({...formData, category: v})} />
|
||||
|
||||
<BtnGroup label="信息来源" options={[
|
||||
{ value: '直播', label: '📺 直播' }, { value: '一尘', label: '💼 一尘' }, { value: '爱藏', label: '📦 爱藏' }, { value: '其他', label: '📋 其他' }
|
||||
]} value={formData.source} onChange={v => setFormData({...formData, source: v})} />
|
||||
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px', fontWeight: '500' }}>标题(自动生成)</div>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px' }}>标题(自动生成)</div>
|
||||
<input type="text" value={formData.title} readOnly
|
||||
style={{ width: '100%', padding: '14px', background: '#0f172a', border: '1px solid #374151', borderRadius: '10px', color: '#10b981', fontSize: '14px', boxSizing: 'border-box' }} />
|
||||
style={{ width: '100%', padding: '14px', background: '#1f2937', border: '1px solid #374151', borderRadius: '10px', color: '#10b981', fontSize: '14px', boxSizing: 'border-box' }} />
|
||||
</div>
|
||||
|
||||
<div style={{ marginBottom: '20px' }}>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px', fontWeight: '500' }}>正文内容</div>
|
||||
<textarea value={formData.content} onChange={(e) => setFormData({...formData, content: e.target.value})} placeholder="请输入详细信息..." rows={4}
|
||||
style={{ width: '100%', padding: '14px', background: '#0f172a', border: '1px solid #374151', borderRadius: '10px', color: '#fff', resize: 'vertical', boxSizing: 'border-box', fontSize: '14px' }} />
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<div style={{ color: '#9ca3af', fontSize: '13px', marginBottom: '8px' }}>正文</div>
|
||||
<textarea defaultValue={content} onChange={(e) => setContent(e.target.value)} placeholder="请输入..." rows={3}
|
||||
style={{ width: '100%', padding: '14px', background: '#1f2937', border: '1px solid #374151', borderRadius: '10px', color: '#fff', resize: 'vertical', boxSizing: 'border-box', fontSize: '14px' }} />
|
||||
</div>
|
||||
|
||||
<button onClick={handlePublish}
|
||||
style={{ width: '100%', padding: '16px', background: 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)', border: 'none', borderRadius: '12px', color: '#fff', fontSize: '16px', fontWeight: 'bold', cursor: 'pointer', boxShadow: '0 4px 15px rgba(245,158,11,0.3)', transition: 'transform 0.2s' }}>
|
||||
style={{ width: '100%', padding: '14px', background: 'linear-gradient(135deg, #f59e0b 0%, #d97706 100%)', border: 'none', borderRadius: '10px', color: '#fff', fontSize: '15px', fontWeight: 'bold', cursor: 'pointer' }}>
|
||||
🚀 提交发布
|
||||
</button>
|
||||
</Card>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
|
||||
{activeTab === 'manage' && (
|
||||
<div>
|
||||
<Card title="📋 我的发布">
|
||||
{/* 发布列表 */}
|
||||
{loading ? (
|
||||
<div style={{ color: '#9ca3af', textAlign: 'center', padding: '30px' }}>⏳ 加载中...</div>
|
||||
<div style={{ color: '#9ca3af', textAlign: 'center', padding: '30px' }}>加载中...</div>
|
||||
) : myList.length === 0 ? (
|
||||
<div style={{ color: '#9ca3af', textAlign: 'center', padding: '30px', fontSize: '14px' }}>暂无发布记录</div>
|
||||
) : (
|
||||
|
|
@ -223,8 +229,8 @@ export default function Info() {
|
|||
|
||||
{/* 编辑弹窗 */}
|
||||
{editingItem && (
|
||||
<div style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.8)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 1000, padding: '20px', backdropFilter: 'blur(5px)' }}>
|
||||
<div style={{ background: '#1f2937', borderRadius: '16px', padding: '24px', width: '100%', maxWidth: '420px', border: '1px solid #374151', boxShadow: '0 20px 40px rgba(0,0,0,0.5)' }}>
|
||||
<div style={{ position: 'fixed', inset: 0, background: 'rgba(0,0,0,0.8)', display: 'flex', alignItems: 'center', justifyContent: 'center', zIndex: 1000, padding: '20px' }}>
|
||||
<div style={{ background: '#1f2937', borderRadius: '16px', padding: '24px', width: '100%', maxWidth: '420px', border: '1px solid #374151' }}>
|
||||
<h3 style={{ color: '#f9fafb', marginBottom: '20px', fontSize: '18px', fontWeight: '600' }}>✏️ 编辑信息</h3>
|
||||
<div style={{ marginBottom: '16px' }}>
|
||||
<label style={{ color: '#9ca3af', fontSize: '13px', display: 'block', marginBottom: '8px' }}>标题</label>
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@ import React, { useState, useEffect } from 'react'
|
|||
|
||||
// 资讯页面 - 展示寻配号和行情信息(所有人可见)
|
||||
export default function News() {
|
||||
const [activeTab, setActiveTab] = useState('seek')
|
||||
const [activeTab, setActiveTab] = useState('deal')
|
||||
const [infoList, setInfoList] = useState([])
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue