feat: 价格限制最低4港币

This commit is contained in:
2026-06-04 16:00:12 +08:00
parent 9cd9d82077
commit d5266937d7
3 changed files with 26 additions and 14 deletions

View File

@@ -1759,6 +1759,7 @@ export default {
learnMore: '了解更多',
requiredFieldTips: '请填写{field}',
requiredFieldTipsWithPage: '第 {index} 个商品:请填写{field}',
priceMinMessage: '价格不能低于4港币',
draftSaved: '草稿已保存',
draftDesc: '您的商品已保存为草稿。\n您可以继续编辑或稍后在“我的商品”中发布。',
listingLive: '商品已上架',

View File

@@ -1810,6 +1810,7 @@ export default {
learnMore:'Learn more',
requiredFieldTips:'Please fill in {field}',
requiredFieldTipsWithPage:'Listing {index}: Please fill in {field}',
priceMinMessage: 'Price cannot be less than HK$4',
draftSaved: 'Draft Saved',
draftDesc: 'Your listing has been saved as a draft. \nYou can continue editing or publish it later from My Listings.',
listingLive:'Listing Live',

View File

@@ -32,20 +32,20 @@
</div>
<div class="right">
<div class="right-content" ref="rightContentRef">
<ListingForm
:product-name="currentListing.productName"
:price="currentListing.price"
:desc="currentListing.desc"
:gender="currentListing.gender"
:category="currentListing.category"
:gender-options="genderOptions"
:category-options="categoryOptions"
@update:product-name="currentListing.productName = $event"
@update:price="currentListing.price = $event"
@update:desc="currentListing.desc = $event"
@update:gender="handleUpdateGender"
@update:category="currentListing.category = $event"
/>
<ListingForm
:product-name="currentListing.productName"
:price="currentListing.price"
:desc="currentListing.desc"
:gender="currentListing.gender"
:category="currentListing.category"
:gender-options="genderOptions"
:category-options="categoryOptions"
@update:product-name="currentListing.productName = $event"
@update:price="handleUpdatePrice"
@update:desc="currentListing.desc = $event"
@update:gender="handleUpdateGender"
@update:category="currentListing.category = $event"
/>
</div>
<div class="page-control flex align-center" v-if="selectList.length > 1">
<a-pagination
@@ -171,6 +171,16 @@
currentListing.value.category = null
}
const handleUpdatePrice = (value: string) => {
const num = Number(value)
if (value && !Number.isNaN(num) && num < 4) {
currentListing.value.price = "4"
message.warning(t("SellerListEdit.priceMinMessage"))
} else {
currentListing.value.price = value
}
}
const previewImageMap = computed(() => ({
sketch: currentListing.value.sketch,
mainProductImage: currentListing.value.mainProductImage,