Commit 07c0fc90 authored by 沈良进's avatar 沈良进

搜索优化

parent 68cf57d3
......@@ -588,6 +588,7 @@ export default {
});
this.msg.dayNumList = arr;
this.goSearchHandler();
},
optionsFn(cd) {
return (
......@@ -731,9 +732,9 @@ export default {
this.$q.loading.hide();
if (res.data.resultCode == 1) {
this.PageCount = res.data.data.List.pageCount;
this.TotalCount = res.data.data.List.count;
var tempArray = res.data.data.List.pageData;
this.PageCount = res.data.data.pageData.pageCount;
this.TotalCount = res.data.data.pageData.count;
var tempArray = res.data.data.pageData.list;
console.log('getSearch data', tempArray)
if (tempArray && tempArray.length > 0) {
// tempArray.forEach(item => {
......@@ -749,6 +750,7 @@ export default {
// }
// });
this.DataList = tempArray;
this.renderSearchInfo(res.data.data.pageData.condition)
this.$forceUpdate();
}
}
......@@ -756,6 +758,38 @@ export default {
(err) => {}
);
},
renderSearchInfo(condition) {
if(!condition.length) {
return
}
let areaInfo = condition.find(item => item.type === 1).list
let dayInfo = condition.find(item => item.type === 2).list
let priceInfo = condition.find(item => item.type === 3)
let categoryInfo = condition.find(item => item.type === 4).list
this.areaTicked = areaInfo;
this.ticked = categoryInfo;
this.msg.priceRange = {min: priceInfo.minPrice, max: priceInfo.maxPrice}
let arr = []
dayInfo.forEach(item => {
if(item < 6) {
arr.push(item)
} else if(item === 7 || item ===8) {
arr.push(7)
} else if(item === 8 || item ===10) {
arr.push(8)
} else {
arr.push(9)
}
})
console.log('dayInfo', arr, dayInfo, this.dayArray)
// arr = [... new Set(arr)]
this.dayArray.forEach(item => {
if(arr.includes(item.id)) {
item.checked = true
}
})
this.msg.dayNumList = arr;
},
GotoDetails(item) {
if(item.productType === 4) { // 接送机,包车
this.CommonJump(
......
......@@ -367,8 +367,9 @@
<div style="width: 40%; margin-left: 10%">
<div class="mt mb">车辆选择</div>
<div>
<q-btn
<q-btn @click="handleSelect(item.Id)"
class="car-tag mr"
:class="{'car-select': item.Id === selectedCar}"
v-for="item in dataList.CarTypeList"
:key="item.Id"
>
......@@ -665,6 +666,7 @@ export default {
props: [],
data() {
return {
selectedCar: '',
currentYM: { year: 2023, month: 2, str: "2023-02" }, // 当前年月
isCurrent: false,
isLast: false,
......@@ -794,6 +796,13 @@ export default {
this.getCarPriceData();
},
methods: {
handleSelect(id) {
if(this.selectedCar === id) {
this.selectedCar = ''
} else {
this.selectedCar = id
}
},
handleMinus() {
if(this.isCurrent) return;
const { str, year, month } = this.currentYM;
......@@ -1115,6 +1124,10 @@ export default {
}
</style>
<style scoped>
.car-select {
background: #ef7a70;
color: #fff;
}
.gray {
color: #999;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment