删掉租期相关错误东西
This commit is contained in:
@@ -21,14 +21,19 @@ const form = reactive({
|
||||
price_daily: 50,
|
||||
price_weekly: 300,
|
||||
deposit_amount: 100,
|
||||
min_rent_hours: 1,
|
||||
max_rent_hours: 24,
|
||||
})
|
||||
|
||||
async function handleSubmit() {
|
||||
loading.value = true
|
||||
try {
|
||||
await createListing({ ...form, screenshot_urls: screenshotUrls.value })
|
||||
const price = Number(form.price_daily || 0)
|
||||
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('发布已创建')
|
||||
await router.push('/seller/listings')
|
||||
} catch (error) {
|
||||
@@ -115,24 +120,12 @@ function readError(error: unknown, fallback: string) {
|
||||
<el-form-item label="哈夫币数量">
|
||||
<el-input-number v-model="form.haf_coin_amount" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="时租">
|
||||
<el-input-number v-model="form.price_hourly" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="日租">
|
||||
<el-form-item label="价格">
|
||||
<el-input-number v-model="form.price_daily" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="周租">
|
||||
<el-input-number v-model="form.price_weekly" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="押金">
|
||||
<el-input-number v-model="form.deposit_amount" :min="0" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最短租期(小时)">
|
||||
<el-input-number v-model="form.min_rent_hours" :min="1" />
|
||||
</el-form-item>
|
||||
<el-form-item label="最长租期(小时)">
|
||||
<el-input-number v-model="form.max_rent_hours" :min="form.min_rent_hours" />
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-button type="primary" :loading="loading" @click="handleSubmit">保存发布</el-button>
|
||||
</el-form>
|
||||
|
||||
Reference in New Issue
Block a user