二手车交易,发布时,求购可以输入0,但不允许输入多个0
This commit is contained in:
@ -105,6 +105,7 @@
|
||||
style="border: none"
|
||||
class="radioWrap"
|
||||
v-model="form.minPrice"
|
||||
@input="validatePrice"
|
||||
input-align="right"
|
||||
>
|
||||
<template slot="right-icon" >
|
||||
@ -270,6 +271,12 @@ export default {
|
||||
// console.log("--",this.vehicleLicensePhotoList,this.vehicleAnglePhotoList,this.otherImgSrcList)
|
||||
},
|
||||
methods:{
|
||||
validatePrice(value) {
|
||||
if (/^0+$/.test(value)){
|
||||
value = '0';
|
||||
}
|
||||
this.form.minPrice = value;
|
||||
},
|
||||
clearStorageFormInfo(){
|
||||
localStorage.setItem("carSourceFormInfo",'')
|
||||
},
|
||||
@ -357,7 +364,11 @@ export default {
|
||||
}else if(this.form.vehicleType !=='拖车'){
|
||||
this.form.boardType=''
|
||||
}
|
||||
let rule=this.validationRules.find(item=>!item.value)
|
||||
let rule = this.validationRules.find(item =>
|
||||
item.value === null ||
|
||||
item.value === undefined ||
|
||||
item.value === ''
|
||||
)
|
||||
if(rule){
|
||||
this.$toast(rule.name)
|
||||
return
|
||||
@ -403,7 +414,11 @@ export default {
|
||||
}else if(this.form.vehicleType !=='拖车'){
|
||||
this.form.boardType=''
|
||||
}
|
||||
let rule=this.validationRules.find(item=>!item.value)
|
||||
let rule = this.validationRules.find(item =>
|
||||
item.value === null ||
|
||||
item.value === undefined ||
|
||||
item.value === ''
|
||||
)
|
||||
if(rule){
|
||||
this.$toast(rule.name)
|
||||
return
|
||||
|
@ -69,12 +69,12 @@
|
||||
<div class="item priceItem">
|
||||
<span> <span class="star">*</span>价格区间 </span>
|
||||
<div style="display: flex;align-items: center" class="price">
|
||||
<el-input type="tel" v-model.number="form.minPrice" >
|
||||
<el-input type="tel" v-model.number="form.minPrice" @input="validatePrice">
|
||||
<template slot="suffix" >元
|
||||
</template>
|
||||
</el-input>
|
||||
<span style="font-size: 14px;color: rgba(44, 61, 84, 0.59);margin: 0 6px">-</span>
|
||||
<el-input type="tel" v-model.number="form.maxPrice" >
|
||||
<el-input type="tel" v-model.number="form.maxPrice" @input="validatePrice1">
|
||||
<template slot="suffix" >元
|
||||
</template>
|
||||
</el-input>
|
||||
@ -172,6 +172,18 @@ export default {
|
||||
this.ortherReason=wantBuyFormInfo.ortherReason
|
||||
},
|
||||
methods:{
|
||||
validatePrice(value) {
|
||||
if (/^0+$/.test(value)){
|
||||
value = '0';
|
||||
}
|
||||
this.form.minPrice = value;
|
||||
},
|
||||
validatePrice1(value) {
|
||||
if (/^0+$/.test(value)){
|
||||
value = '0';
|
||||
}
|
||||
this.form.maxPrice = value;
|
||||
},
|
||||
clearStorageFormInfo(){
|
||||
localStorage.setItem("wantBuyFormInfo",'')
|
||||
},
|
||||
@ -206,7 +218,11 @@ export default {
|
||||
}else if(this.form.vehicleType !=='拖车'){
|
||||
this.form.boardType=''
|
||||
}
|
||||
let rule=this.validationRules.find(item=>!item.value)
|
||||
let rule = this.validationRules.find(item =>
|
||||
item.value === null ||
|
||||
item.value === undefined ||
|
||||
item.value === ''
|
||||
)
|
||||
if(rule){
|
||||
this.$toast(rule.name)
|
||||
return
|
||||
@ -248,7 +264,11 @@ export default {
|
||||
}else if(this.form.vehicleType !=='拖车'){
|
||||
this.form.boardType=''
|
||||
}
|
||||
let rule=this.validationRules.find(item=>!item.value)
|
||||
let rule = this.validationRules.find(item =>
|
||||
item.value === null ||
|
||||
item.value === undefined ||
|
||||
item.value === ''
|
||||
)
|
||||
if(rule){
|
||||
this.$toast(rule.name)
|
||||
return
|
||||
|
Reference in New Issue
Block a user