filter
This commit is contained in:
parent
f6efddc06e
commit
0b8e2e5f0c
|
|
@ -33,7 +33,7 @@ Page({
|
|||
selectedSort: 'default',
|
||||
selectedBrand: '',
|
||||
selectedPrice: '',
|
||||
selectedParam: '',
|
||||
filterParams: {},
|
||||
mainActiveIndex: 0,
|
||||
selectedSeriesId: null,
|
||||
selectedBrandLabel:"品牌",
|
||||
|
|
@ -74,10 +74,6 @@ Page({
|
|||
this.setData({ selectedSort: e.detail });
|
||||
this.reloadList();
|
||||
},
|
||||
onBrandChange(e) {
|
||||
this.setData({ selectedBrand: e.detail });
|
||||
this.reloadList();
|
||||
},
|
||||
onPriceChange(e) {
|
||||
this.setData({ selectedPrice: e.detail });
|
||||
this.reloadList();
|
||||
|
|
@ -88,10 +84,24 @@ Page({
|
|||
this.reloadList();
|
||||
},
|
||||
|
||||
reloadList() {
|
||||
async reloadList() {
|
||||
// TODO: 根据筛选值重新加载列表
|
||||
console.log('筛选值:', this.data.selectedSort, this.data.selectedBrand,
|
||||
this.data.selectedPrice, this.data.selectedParam);
|
||||
const data = {
|
||||
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() {
|
||||
const { latitude, longitude, address, name } = this.data.company
|
||||
|
|
@ -195,10 +205,8 @@ Page({
|
|||
}
|
||||
}
|
||||
});
|
||||
console.log('参数筛选值:', filterParams);
|
||||
this.selectComponent('#dropdownItemParam').toggle(false); // 关闭
|
||||
|
||||
// 这里你可以请求后端过滤后的列表
|
||||
// request({ url: '/xxx', data: filterParams }).then(...)
|
||||
this.setData({filterParams:filterParams});
|
||||
this.reloadList();
|
||||
}
|
||||
})
|
||||
|
|
|
|||
|
|
@ -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 = {} }) {
|
||||
const token = '';
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user