优化发布等各种状态

This commit is contained in:
yml2213
2026-05-23 15:52:44 +08:00
parent f2492d5e40
commit b101415e9d
25 changed files with 368 additions and 70 deletions
@@ -27,14 +27,18 @@ async function handleSubmit() {
loading.value = true
try {
const price = Number(form.price_daily || 0)
await createListing({
const listing = await createListing({
...form,
price_hourly: Math.max(Math.round((price / 24) * 100) / 100, 0.01),
price_daily: price,
price_weekly: Math.round(price * 7 * 100) / 100,
screenshot_urls: screenshotUrls.value,
})
ElMessage.success('发布已创建')
ElMessage.success(
listing.status === 'published' && listing.review_status === 'approved'
? '发布成功,已上架'
: '发布成功,等待后台审核',
)
await router.push('/seller/listings')
} catch (error) {
ElMessage.error(readError(error, '发布失败,请确认已登录并完成实名认证'))