张雄 3 years ago
parent 2db412e7ae
commit 86907e9a74

@ -18,6 +18,16 @@
<li v-for="(item,index) in letterArr" :key="index" :class="activeLi === index ? 'lactive': ''" @click="handlerLi(index)">{{item}}</li>
<li @click="selectAll"></li>
</ul>
<div style="margin: 0 0 0 16px">
<a-form-model layout="inline">
<a-form-model-item label="关键词">
<a-input v-model="sKeyword" style="width: 160px"></a-input>
</a-form-model-item>
<a-form-model-item>
<a-button type="primary" @click="onSearch"></a-button>
</a-form-model-item>
</a-form-model>
</div>
<div style="clear: both"></div>
<div class="sb-dd">
<vue-scroll>
@ -95,6 +105,7 @@ export default {
models: [],
brandname: "",
brandList: [],
sKeyword:'',
};
},
methods: {
@ -105,6 +116,7 @@ export default {
},
// li
handlerLi(n) {
this.sKeyword = '';
this.activeLi = n;
let key = this.letterArr[n];
this.showCars = this.cars.filter((ele) => ele.firstword === key);
@ -160,6 +172,10 @@ export default {
arr.push(ele.brandname);
})
this.$emit("selectAll", arr);
},
onSearch() {
let kw = this.sKeyword;
this.showCars = this.cars.filter((ele) => ele.brandname.indexOf(kw) != -1 && ele.firstword != '热门');
}
},
};
@ -221,7 +237,7 @@ export default {
}
.sb-dd {
width: 100%;
height: calc(100% - 30px);
height: calc(100% - 70px);
box-shadow: 0 0 20px;
}
.sb-bd {

@ -248,7 +248,6 @@ export default {
getUserBrand(this.form)
.then((res) => {
let data = res.data;
console.log(data)
let arr = [];
data.forEach((ele) => {
let fk = ele.firstword;

@ -17,6 +17,16 @@
<span class="liSn">按品牌拼音首字母查找:</span>
<li v-for="(item,index) in letterArr" :key="index" :class="activeLi === index ? 'lactive': ''" @click="handlerLi(index)">{{item}}</li>
</ul>
<div style="margin: 0 0 0 16px">
<a-form-model layout="inline">
<a-form-model-item label="关键词">
<a-input v-model="sKeyword" style="width: 160px"></a-input>
</a-form-model-item>
<a-form-model-item>
<a-button type="primary" @click="onSearch"></a-button>
</a-form-model-item>
</a-form-model>
</div>
<div style="clear: both"></div>
<div class="sb-dd">
<vue-scroll>
@ -87,6 +97,7 @@ export default {
chooseModel: null,
models: [],
brandname: "",
sKeyword:'',
};
},
methods: {
@ -97,6 +108,7 @@ export default {
},
// li
handlerLi(n) {
this.sKeyword = '';
this.activeLi = n;
let key = this.letterArr[n];
this.showCars = this.cars.filter((ele) => ele.firstword === key);
@ -167,6 +179,10 @@ export default {
this.$message.warning("请选择品牌");
}
},
onSearch() {
let kw = this.sKeyword;
this.showCars = this.cars.filter((ele) => ele.brandname.indexOf(kw) != -1 && ele.firstword != '热门');
}
},
};
</script>
@ -227,7 +243,7 @@ export default {
}
.sb-dd {
width: 100%;
height: calc(100% - 30px);
height: calc(100% - 70px);
box-shadow: 0 0 20px;
}
.sb-bd {

Loading…
Cancel
Save