二手车交易,测试优化

This commit is contained in:
2025-03-13 19:47:15 +08:00
parent 2e6f855cf8
commit 1d491e501f
6 changed files with 93 additions and 38 deletions

View File

@ -34,7 +34,7 @@
> </van-field>
</div>
</div>
<div class="item">
<div class="item" v-if="form.vehicleType=='拖车'">
<span> <span class="star">*</span>落板方式 </span>
<van-radio-group v-model="form.boardType" direction="horizontal" class="radioWrap">
<van-radio name="1" :class="{'checked':form.boardType==1}">全落地</van-radio>
@ -43,7 +43,7 @@
<van-radio name="9" :class="{'checked':form.boardType==9}">不限</van-radio>
</van-radio-group>
</div>
<div class="item">
<div class="item" >
<span> <span class="star">*</span>排放标准 </span>
<van-radio-group v-model="form.emissionStandard" direction="horizontal" class="radioWrap">
<van-radio name="4" :class="{'checked':form.emissionStandard==4}">国4</van-radio>
@ -55,6 +55,7 @@
<div class="item">
<span> <span class="star">*</span>联系号码 </span>
<van-field
type="number"
class="radioWrap"
v-model="form.contactNumber"
input-align="right"
@ -64,12 +65,12 @@
<div class="item priceItem">
<span> <span class="star">*</span>价格区间 </span>
<div style="display: flex;align-items: center" class="price">
<el-input v-model="form.minPrice" >
<el-input v-model.number="form.minPrice" >
<template slot="suffix" >
</template>
</el-input>
<span style="font-size: 14px;color: rgba(44, 61, 84, 0.59);margin: 0 6px">-</span>
<el-input v-model="form.maxPrice" >
<el-input v-model.number="form.maxPrice" >
<template slot="suffix" >
</template>
</el-input>
@ -194,7 +195,7 @@ export default {
})
setTimeout(()=>{
this.closeParentDialog()
},2000)
},1000)
} finally {
console.log(type)
}
@ -210,6 +211,12 @@ export default {
this.$toast(flag)
return
}
if (this.form.vehicleType=='拖车' && !this.form.boardType) {
this.$toast('落板方式不能为空')
return
}else {
this.form.boardType=''
}
let rule=this.validationRules.find(item=>!item.value)
if(rule){
this.$toast(rule.name)
@ -220,12 +227,15 @@ export default {
...this.form,
})
if(res.code == 200 && !res.msg){
this.$toast('发布完成')
if(this.isWebFunc()){
setTimeout(()=>{
this.closeParentDialog()
},2000)
},1000)
}else{
this.h5GoBack()
setTimeout(()=>{
this.$router.push({ name: "mineRelease",query:{activeTab : 1}})
},1000)
}
}else{
this.$toast(res.msg)
@ -253,7 +263,6 @@ export default {
validationRules() {
return [
{ value: this.form.vehicleType, name: '车辆类型不能为空' },
{ value: this.form.boardType, name: '落板方式不能为空' },
{ value: this.form.emissionStandard, name: '排放标准不能为空' },
{ value: this.form.contactNumber, name: '联系方式不能为空' },
{ value: this.form.minPrice, name: '售价不能为空' },
@ -437,6 +446,7 @@ export default {
font-weight: bold;
border-radius: 5px;
color: #FFFFFF;
cursor: pointer;
}
.btn{
width: 296px;