优化发布等各种状态
This commit is contained in:
@@ -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, '发布失败,请确认已登录并完成实名认证'))
|
||||
|
||||
Reference in New Issue
Block a user