filter
This commit is contained in:
parent
f6efddc06e
commit
0b8e2e5f0c
|
|
@ -33,7 +33,7 @@ Page({
|
||||||
selectedSort: 'default',
|
selectedSort: 'default',
|
||||||
selectedBrand: '',
|
selectedBrand: '',
|
||||||
selectedPrice: '',
|
selectedPrice: '',
|
||||||
selectedParam: '',
|
filterParams: {},
|
||||||
mainActiveIndex: 0,
|
mainActiveIndex: 0,
|
||||||
selectedSeriesId: null,
|
selectedSeriesId: null,
|
||||||
selectedBrandLabel:"品牌",
|
selectedBrandLabel:"品牌",
|
||||||
|
|
@ -74,10 +74,6 @@ Page({
|
||||||
this.setData({ selectedSort: e.detail });
|
this.setData({ selectedSort: e.detail });
|
||||||
this.reloadList();
|
this.reloadList();
|
||||||
},
|
},
|
||||||
onBrandChange(e) {
|
|
||||||
this.setData({ selectedBrand: e.detail });
|
|
||||||
this.reloadList();
|
|
||||||
},
|
|
||||||
onPriceChange(e) {
|
onPriceChange(e) {
|
||||||
this.setData({ selectedPrice: e.detail });
|
this.setData({ selectedPrice: e.detail });
|
||||||
this.reloadList();
|
this.reloadList();
|
||||||
|
|
@ -88,10 +84,24 @@ Page({
|
||||||
this.reloadList();
|
this.reloadList();
|
||||||
},
|
},
|
||||||
|
|
||||||
reloadList() {
|
async reloadList() {
|
||||||
// TODO: 根据筛选值重新加载列表
|
// TODO: 根据筛选值重新加载列表
|
||||||
console.log('筛选值:', this.data.selectedSort, this.data.selectedBrand,
|
const data = {
|
||||||
this.data.selectedPrice, this.data.selectedParam);
|
sort:this.data.selectedSort,
|
||||||
|
brand:this.data.selectedSeriesId,
|
||||||
|
price:this.data.selectedPrice,
|
||||||
|
attr:this.data.filterParams,
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
const raw = await request({
|
||||||
|
url: '/admin/wechat/api/car',
|
||||||
|
method: 'POST',
|
||||||
|
data: data
|
||||||
|
});
|
||||||
|
console.log(raw)
|
||||||
|
} catch (err) {
|
||||||
|
console.error('加载品牌失败', err);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
openMap() {
|
openMap() {
|
||||||
const { latitude, longitude, address, name } = this.data.company
|
const { latitude, longitude, address, name } = this.data.company
|
||||||
|
|
@ -195,10 +205,8 @@ Page({
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
console.log('参数筛选值:', filterParams);
|
|
||||||
this.selectComponent('#dropdownItemParam').toggle(false); // 关闭
|
this.selectComponent('#dropdownItemParam').toggle(false); // 关闭
|
||||||
|
this.setData({filterParams:filterParams});
|
||||||
// 这里你可以请求后端过滤后的列表
|
this.reloadList();
|
||||||
// request({ url: '/xxx', data: filterParams }).then(...)
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
const BASE_URL = 'http://192.168.1.11:8089/'; // 👈 换成你的后端地址
|
const BASE_URL = 'http://127.0.0.1:8089/'; // 👈 换成你的后端地址
|
||||||
|
|
||||||
function request({ url, method = 'GET', data = {}, header = {} }) {
|
function request({ url, method = 'GET', data = {}, header = {} }) {
|
||||||
const token = '';
|
const token = '';
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user