From 321414ad87be3c6d13e210efe32a76c51015730f Mon Sep 17 00:00:00 2001 From: zhouxueli <2841188632@qq.com> Date: Tue, 25 Mar 2025 14:15:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8C=E6=89=8B=E8=BD=A6=E4=BA=A4=E6=98=93?= =?UTF-8?q?=EF=BC=8C=E5=94=AE=E4=BB=B7=E8=BE=93=E5=85=A50=E5=BC=80?= =?UTF-8?q?=E5=A4=B4=E6=97=B6=EF=BC=8C=E5=90=8E=E8=BE=B9=E4=B8=8D=E5=85=81?= =?UTF-8?q?=E8=AE=B8=E8=BE=93=E5=85=A5=E4=BB=BB=E4=BD=95=E6=95=B0=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/secondHandCar/carSource.vue | 7 ++++--- src/views/secondHandCar/wantBuy.vue | 14 ++++++++------ 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/src/views/secondHandCar/carSource.vue b/src/views/secondHandCar/carSource.vue index 5ecff08b..8048270e 100644 --- a/src/views/secondHandCar/carSource.vue +++ b/src/views/secondHandCar/carSource.vue @@ -272,10 +272,11 @@ export default { }, methods:{ validatePrice(value) { - if (/^0+$/.test(value)){ - value = '0'; + if (value?.startsWith(0) && value?.length > 1) { + this.$nextTick(() => { + this.form.minPrice = 0 + }) } - this.form.minPrice = value; }, clearStorageFormInfo(){ localStorage.setItem("carSourceFormInfo",'') diff --git a/src/views/secondHandCar/wantBuy.vue b/src/views/secondHandCar/wantBuy.vue index 502745c5..22495413 100644 --- a/src/views/secondHandCar/wantBuy.vue +++ b/src/views/secondHandCar/wantBuy.vue @@ -173,16 +173,18 @@ export default { }, methods:{ validatePrice(value) { - if (/^0+$/.test(value)){ - value = '0'; + if (value?.startsWith(0) && value?.length > 1) { + this.$nextTick(() => { + this.form.minPrice = 0 + }) } - this.form.minPrice = value; }, validatePrice1(value) { - if (/^0+$/.test(value)){ - value = '0'; + if (value?.startsWith(0) && value?.length > 1) { + this.$nextTick(() => { + this.form.maxPrice = 0 + }) } - this.form.maxPrice = value; }, clearStorageFormInfo(){ localStorage.setItem("wantBuyFormInfo",'')