删掉租期相关错误东西
This commit is contained in:
@@ -36,20 +36,20 @@ const filteredListings = computed(() => {
|
||||
const matchCoin =
|
||||
!filters.minCoin || item.haf_coin_amount >= filters.minCoin;
|
||||
const matchPrice =
|
||||
!filters.maxPrice || item.price_hourly <= filters.maxPrice;
|
||||
!filters.maxPrice || listingPrice(item) <= filters.maxPrice;
|
||||
return (
|
||||
matchKeyword && matchRegion && matchPlatform && matchCoin && matchPrice
|
||||
);
|
||||
});
|
||||
|
||||
return [...result].sort((a, b) => {
|
||||
if (sortBy.value === "price-asc") return a.price_hourly - b.price_hourly;
|
||||
if (sortBy.value === "price-asc") return listingPrice(a) - listingPrice(b);
|
||||
if (sortBy.value === "coin-desc")
|
||||
return b.haf_coin_amount - a.haf_coin_amount;
|
||||
if (sortBy.value === "deposit-asc")
|
||||
return a.deposit_amount - b.deposit_amount;
|
||||
return (
|
||||
b.haf_coin_amount - a.haf_coin_amount || a.price_hourly - b.price_hourly
|
||||
b.haf_coin_amount - a.haf_coin_amount || listingPrice(a) - listingPrice(b)
|
||||
);
|
||||
});
|
||||
});
|
||||
@@ -77,6 +77,10 @@ function resetFilters() {
|
||||
function uniqueOptions(values: string[]) {
|
||||
return [...new Set(values.filter(Boolean))];
|
||||
}
|
||||
|
||||
function listingPrice(item: Listing) {
|
||||
return Number(item.price_daily || item.price_hourly || 0);
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -145,7 +149,7 @@ function uniqueOptions(values: string[]) {
|
||||
class="full-control"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="最高时租">
|
||||
<el-form-item label="最高价格">
|
||||
<el-input-number
|
||||
v-model="filters.maxPrice"
|
||||
:min="0"
|
||||
@@ -203,12 +207,9 @@ function uniqueOptions(values: string[]) {
|
||||
</div>
|
||||
</div>
|
||||
<div class="resource-price-box">
|
||||
<span>时租</span>
|
||||
<strong>¥{{ item.price_hourly }}</strong>
|
||||
<span>价格</span>
|
||||
<strong>¥{{ listingPrice(item).toFixed(2) }}</strong>
|
||||
<em>押金 ¥{{ item.deposit_amount }}</em>
|
||||
<small
|
||||
>{{ item.min_rent_hours }}-{{ item.max_rent_hours }} 小时</small
|
||||
>
|
||||
</div>
|
||||
</RouterLink>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user