删掉租期相关错误东西

This commit is contained in:
yml2213
2026-05-23 14:44:32 +08:00
parent e6cc9f1255
commit a6a1afb879
41 changed files with 127 additions and 312 deletions
@@ -133,9 +133,6 @@ const calculatedFinalPrice = computed(() =>
const calculatedRatioText = computed(() =>
calculatedRatio.value > 0 ? `1:${formatNumber(calculatedRatio.value)}` : ""
);
const calculatedRentDays = computed(() =>
coinMAmount.value > 0 ? calculateRentDays(coinMAmount.value) : 0
);
onMounted(() => {
restoreDraft();
@@ -356,8 +353,7 @@ async function handleSubmit() {
loading.value = true;
try {
const title = `${form.server_region} ${form.rank_level} ${form.haf_coin_amount}M哈夫币`;
const rentDays = Math.max(calculatedRentDays.value, 1);
const dailyPrice = roundMoney(calculatedFinalPrice.value / rentDays);
const dailyPrice = calculatedFinalPrice.value;
const hourlyPrice = Math.max(roundMoney(dailyPrice / 24), 0.01);
await createListing({
@@ -373,8 +369,6 @@ async function handleSubmit() {
price_daily: dailyPrice,
price_weekly: roundMoney(dailyPrice * 7),
deposit_amount: Number(form.deposit_amount),
min_rent_hours: 24,
max_rent_hours: rentDays * 24,
});
localStorage.removeItem(draftKey);
showToast({ message: "发布成功", icon: "passed" });
@@ -402,7 +396,7 @@ function validateForm() {
if (form.deposit_amount === "" || Number(form.deposit_amount) < 0) {
return "请填写押金";
}
if (!calculatedFinalPrice.value || !calculatedRentDays.value) {
if (!calculatedFinalPrice.value) {
return "请完善币数、保险、体力和负重后再发布";
}
for (const item of screenshotSlots.value) {
@@ -426,6 +420,7 @@ function buildAssetSummary() {
face_owner: form.face_owner,
secret_kd: form.secret_kd,
fire_level: Number(form.fire_level),
publish_ratio: calculatedRatio.value,
season_insurance: form.season_insurance,
stamina_level: form.stamina_level,
load_level: form.load_level,
@@ -535,12 +530,6 @@ function getCoinCorrection(coinM: number) {
.find((item) => coinM > item.threshold_m)?.correction || 0;
}
function calculateRentDays(coinM: number) {
return [...ratioConfig.value.rent_rules]
.sort((a, b) => b.threshold_m - a.threshold_m)
.find((item) => coinM >= item.threshold_m)?.days || 1;
}
function formatNumber(value: number) {
return Number.isInteger(value) ? `${value}` : `${Math.round(value * 10) / 10}`;
}
@@ -795,7 +784,7 @@ function readError(error: unknown, fallback: string) {
/>
</div>
<p class="field-hint">
此在线时间指的是百分百能够联系上您的时间若是在此期间联系不上您导致无法上号会扣除您的部分租金或上架押金在线时长太短可能无法上架请预留充足时间用于扫码以及冻结人脸请谨慎填写
此在线时间指的是百分百能够联系上您的时间若是在此期间联系不上您导致无法上号会扣除您的部分订单金额或上架押金在线时长太短可能无法上架请预留充足时间用于扫码以及冻结人脸请谨慎填写
</p>
<van-field label="封禁记录" required class="publish-field">