feat(consignment): 收敛寄卖迁移并调整发布页价格区布局

- 142–148 收敛为 142_consignment_platform,旧账本自动清理

- 价格三卡保持一行等宽,其余发布页布局回退

- 修复发布 tab 空白并统一价格文案为系统建议价
This commit is contained in:
2026-11-06 14:28:35 +08:00
parent 374e2a69df
commit 8b7bcca36a
17 changed files with 711 additions and 614 deletions
@@ -1312,7 +1312,7 @@ export default function ConsignmentConfigPanel() {
label="允许打手改价"
name={['pricing', 'allowWorkerPrice']}
valuePropName="checked"
extra="打手只能按系统建议价往下调"
extra="打手只能按系统建议价格往下调"
style={{ marginBottom: 0 }}
>
<Switch checkedChildren="允许" unCheckedChildren="不允许" />
@@ -162,7 +162,7 @@ export default function WorkerConsignmentPage() {
const [cooldownNow, setCooldownNow] = useState(() => Date.now())
const [form] = Form.useForm()
const currentDiamondLevel = Form.useWatch('diamondLevel', form)
// 寄售价:按后台配置(模板折扣价 / 固定价)自动带出,打手只能往下调。
// 寄售价:按后台配置(模板折扣价 / 模板价固定下调)自动带出,打手只能往下调。
const [priceState, setPriceState] = useState<
| { status: 'idle' }
| { status: 'loading' }
@@ -740,14 +740,6 @@ export default function WorkerConsignmentPage() {
}
/>
{!consignmentContactsQuery.isLoading && contactSupporters.length === 0 ? (
<Alert
type="warning"
showIcon
message="暂无可选的对接客服,请联系管理员在「配置 - 对接客服」中添加后再发布"
/>
) : null}
<Divider plain className="worker-consignment-divider">
规格与价格
</Divider>
@@ -846,12 +838,16 @@ export default function WorkerConsignmentPage() {
})}
</div>
<div className="worker-consignment-price-grid">
<div
className={`worker-consignment-price-grid${
selectedProfile?.config.fields.quantity === false ? ' is-two' : ''
}`}
>
<Form.Item
label="寄售价格"
tooltip={
manualPriceAllowed
? `默认按后台配置带出(模板折扣价 / 固定价),可下调,不能高于系统建议价${selectedProfile?.config.pricing.minPriceFen ? `;最低 ¥${(selectedProfile.config.pricing.minPriceFen / 100).toFixed(2)}` : ''}。`
? `默认按后台配置带出(模板折扣价 / 模板价固定下调),可下调,不能高于系统建议价${selectedProfile?.config.pricing.minPriceFen ? `;最低 ¥${(selectedProfile.config.pricing.minPriceFen / 100).toFixed(2)}` : ''}。`
: '由后台寄卖配置自动带出,卖家不可修改;需要调整请联系客服。'
}
className="worker-consignment-spec-card is-price"
@@ -1126,33 +1122,12 @@ export default function WorkerConsignmentPage() {
<Card bordered={false} className="worker-orders-card">
<Tabs
className="worker-order-tabs"
activeKey={
activeTab === 'records'
? 'records'
: selectedProfile
? `publish-${selectedProfile.profileId}`
: 'publish'
}
activeKey={activeTab === 'records' ? 'records' : 'publish'}
onChange={(key) => {
if (key === 'records') {
setActiveTab('records')
return
}
const profileId = Number(String(key).replace('publish-', ''))
if (Number.isInteger(profileId) && profileId > 0) {
if (profileId !== selectedProfileId) {
const nextProfile = consignmentProfiles.find((item) => item.profileId === profileId)
const nextSpecs = nextProfile?.config.specs ?? []
const cleared: Record<string, undefined> = {}
for (const field of nextSpecs) cleared[field.key] = undefined
cleared.askingPrice = undefined
cleared.itemName = undefined
form.setFieldsValue(cleared)
setPriceState({ status: 'idle' })
lastPriceQueryKeyRef.current = ''
}
setSelectedProfileId(profileId)
}
setActiveTab('publish')
}}
items={[
+1 -1
View File
@@ -615,7 +615,7 @@ export function fetchWorkerConsignmentPriceSuggestion(params: {
}>('/api/v1/worker/consignment/price-suggestion', params)
}
/** 动态规格发布:按 profileId + specValues 算价(模板折扣价 / 固定价)。 */
/** 动态规格发布:按 profileId + specValues 算价(模板折扣价 / 模板价固定下调)。 */
export function fetchWorkerConsignmentPricePreview(payload: {
profileId?: number
specValues: ConsignmentSpecValues
+21 -4
View File
@@ -4498,11 +4498,16 @@ body {
gap: 12px;
}
/* 寄售价格 / 寄售数量 / 履约押金始终一行三列等宽 */
.worker-consignment-price-grid {
display: grid;
grid-template-columns: 240px 240px;
grid-template-columns: repeat(3, minmax(0, 1fr));
gap: 12px;
justify-content: start;
}
/* 寄售数量被后台关闭时只剩两张卡,按两列等宽,避免第三列留空 */
.worker-consignment-price-grid.is-two {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
.worker-consignment-spec-card {
@@ -4635,9 +4640,14 @@ body {
}
}
@media (max-width: 768px) {
.worker-consignment-spec-grid,
@media (max-width: 1024px) {
.worker-consignment-price-grid {
grid-template-columns: repeat(2, minmax(0, 1fr));
}
}
@media (max-width: 768px) {
.worker-consignment-spec-grid {
grid-template-columns: 1fr;
}
@@ -4646,6 +4656,13 @@ body {
}
}
@media (max-width: 640px) {
.worker-consignment-price-grid,
.worker-consignment-price-grid.is-two {
grid-template-columns: 1fr;
}
}
.worker-consignment-filter-row {
display: flex;
flex-wrap: wrap;