兼容接入商品固定价格字段

This commit is contained in:
yml
2026-05-24 18:13:20 +08:00
parent 14aafcf728
commit e69d08ca9f
15 changed files with 153 additions and 32 deletions
@@ -17,18 +17,17 @@ const form = reactive({
login_platform: 'QQ',
rank_level: '',
haf_coin_amount: 0,
price_hourly: 5,
price_daily: 50,
price_weekly: 300,
price: 50,
deposit_amount: 100,
})
async function handleSubmit() {
loading.value = true
try {
const price = Number(form.price_daily || 0)
const price = Number(form.price || 0)
const listing = await createListing({
...form,
price,
price_hourly: Math.max(Math.round((price / 24) * 100) / 100, 0.01),
price_daily: price,
price_weekly: Math.round(price * 7 * 100) / 100,
@@ -125,7 +124,7 @@ function readError(error: unknown, fallback: string) {
<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_daily" :min="0" />
<el-input-number v-model="form.price" :min="0" />
</el-form-item>
<el-form-item label="押金">
<el-input-number v-model="form.deposit_amount" :min="0" />