|
@@ -29,9 +29,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
const sortList = common_vendor.ref([{ title: "默认排序", type: "0", is_open: true }, { title: "最新上架", type: "1", is_open: false }, { title: "车龄最短", type: "2", is_open: false }, { title: "里程最少", type: "3", is_open: false }, { title: "价格最高", type: "4", is_open: false }, { title: "价格最低", type: "5", is_open: false }]);
|
|
const sortList = common_vendor.ref([{ title: "默认排序", type: "0", is_open: true }, { title: "最新上架", type: "1", is_open: false }, { title: "车龄最短", type: "2", is_open: false }, { title: "里程最少", type: "3", is_open: false }, { title: "价格最高", type: "4", is_open: false }, { title: "价格最低", type: "5", is_open: false }]);
|
|
const moneyList = common_vendor.ref([{ title: "不限价格", type: "0", is_open: true }, { title: "10万以下", type: "1", is_open: false }, { title: "10-15万", type: "2", is_open: false }, { title: "15-20万", type: "3", is_open: false }, { title: "20-25万", type: "4", is_open: false }, { title: "25-30万", type: "5", is_open: false }, { title: "30-50万", type: "6", is_open: false }, { title: "50万以上", type: "7", is_open: false }]);
|
|
const moneyList = common_vendor.ref([{ title: "不限价格", type: "0", is_open: true }, { title: "10万以下", type: "1", is_open: false }, { title: "10-15万", type: "2", is_open: false }, { title: "15-20万", type: "3", is_open: false }, { title: "20-25万", type: "4", is_open: false }, { title: "25-30万", type: "5", is_open: false }, { title: "30-50万", type: "6", is_open: false }, { title: "50万以上", type: "7", is_open: false }]);
|
|
const yearList = common_vendor.ref([{ title: "不限车龄", type: "0", is_open: true }, { title: "2年以下", type: "1", is_open: false }, { title: "4年以下", type: "2", is_open: false }, { title: "6年以下", type: "3", is_open: false }]);
|
|
const yearList = common_vendor.ref([{ title: "不限车龄", type: "0", is_open: true }, { title: "2年以下", type: "1", is_open: false }, { title: "4年以下", type: "2", is_open: false }, { title: "6年以下", type: "3", is_open: false }]);
|
|
- const brandInfo = common_vendor.ref({});
|
|
|
|
- const moneyInfo = common_vendor.ref({});
|
|
|
|
- const yearInfo = common_vendor.ref({});
|
|
|
|
|
|
+ const searchInfo = common_vendor.ref({});
|
|
const moreList = common_vendor.ref([]);
|
|
const moreList = common_vendor.ref([]);
|
|
const list = common_vendor.ref([]);
|
|
const list = common_vendor.ref([]);
|
|
const total = common_vendor.ref(0);
|
|
const total = common_vendor.ref(0);
|
|
@@ -47,12 +45,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
});
|
|
});
|
|
await searchConfig();
|
|
await searchConfig();
|
|
await search();
|
|
await search();
|
|
- await searchOther();
|
|
|
|
});
|
|
});
|
|
- common_vendor.onShow(() => {
|
|
|
|
|
|
+ common_vendor.onShow(async () => {
|
|
common_vendor.index.$on("toRoute", function(data) {
|
|
common_vendor.index.$on("toRoute", function(data) {
|
|
- brandInfo.value = data;
|
|
|
|
|
|
+ if (data && data.name)
|
|
|
|
+ searchInfo.value.brand = data.name;
|
|
});
|
|
});
|
|
|
|
+ await clearPage();
|
|
|
|
+ await searchOther();
|
|
});
|
|
});
|
|
const searchConfig = async () => {
|
|
const searchConfig = async () => {
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
@@ -78,6 +78,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
status: "0",
|
|
status: "0",
|
|
shop: id.value
|
|
shop: id.value
|
|
};
|
|
};
|
|
|
|
+ if (searchInfo.value.brand)
|
|
|
|
+ info.brand = searchInfo.value.brand;
|
|
|
|
+ if (searchInfo.value.money)
|
|
|
|
+ info.money = searchInfo.value.money;
|
|
|
|
+ if (searchInfo.value.year)
|
|
|
|
+ info.year = searchInfo.value.year;
|
|
res = await $api("car", "GET", {
|
|
res = await $api("car", "GET", {
|
|
...info
|
|
...info
|
|
});
|
|
});
|
|
@@ -129,7 +135,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
};
|
|
};
|
|
- const toSelect = (data, type2) => {
|
|
|
|
|
|
+ const toSelect = async (data, type2) => {
|
|
if (type2 == "0") {
|
|
if (type2 == "0") {
|
|
sortList.value = sortList.value.map((item, index) => {
|
|
sortList.value = sortList.value.map((item, index) => {
|
|
if (item.type == data.type)
|
|
if (item.type == data.type)
|
|
@@ -151,7 +157,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
item.is_open = false;
|
|
item.is_open = false;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
- moneyInfo.value = data;
|
|
|
|
|
|
+ searchInfo.value.money = data.title;
|
|
} else {
|
|
} else {
|
|
yearList.value = yearList.value.map((item, index) => {
|
|
yearList.value = yearList.value.map((item, index) => {
|
|
if (item.type == data.type)
|
|
if (item.type == data.type)
|
|
@@ -160,12 +166,14 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
item.is_open = false;
|
|
item.is_open = false;
|
|
return item;
|
|
return item;
|
|
});
|
|
});
|
|
- yearInfo.value = data;
|
|
|
|
|
|
+ searchInfo.value.year = data.title;
|
|
}
|
|
}
|
|
|
|
+ await clearPage();
|
|
|
|
+ await searchOther();
|
|
};
|
|
};
|
|
- const toDelete = (item, type2) => {
|
|
|
|
|
|
+ const toDelete = async (item, type2) => {
|
|
if (type2 == "0")
|
|
if (type2 == "0")
|
|
- brandInfo.value = {};
|
|
|
|
|
|
+ searchInfo.value.brand = "";
|
|
else if (type2 == "1") {
|
|
else if (type2 == "1") {
|
|
moneyList.value = moneyList.value.map((item2, index) => {
|
|
moneyList.value = moneyList.value.map((item2, index) => {
|
|
if (item2.type == "0")
|
|
if (item2.type == "0")
|
|
@@ -174,7 +182,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
item2.is_open = false;
|
|
item2.is_open = false;
|
|
return item2;
|
|
return item2;
|
|
});
|
|
});
|
|
- moneyInfo.value = {};
|
|
|
|
|
|
+ searchInfo.value.money = "";
|
|
} else if (type2 == "2") {
|
|
} else if (type2 == "2") {
|
|
yearList.value = yearList.value.map((item2, index) => {
|
|
yearList.value = yearList.value.map((item2, index) => {
|
|
if (item2.type == "0")
|
|
if (item2.type == "0")
|
|
@@ -183,16 +191,20 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
item2.is_open = false;
|
|
item2.is_open = false;
|
|
return item2;
|
|
return item2;
|
|
});
|
|
});
|
|
- yearInfo.value = {};
|
|
|
|
|
|
+ searchInfo.value.year = "";
|
|
} else
|
|
} else
|
|
moreList.value = moreList.value.filter((i, index) => i.type != item.type);
|
|
moreList.value = moreList.value.filter((i, index) => i.type != item.type);
|
|
|
|
+ await clearPage();
|
|
|
|
+ await searchOther();
|
|
};
|
|
};
|
|
- const toReset = () => {
|
|
|
|
|
|
+ const toReset = async () => {
|
|
toDelete({}, "0");
|
|
toDelete({}, "0");
|
|
toDelete({}, "1");
|
|
toDelete({}, "1");
|
|
toDelete({}, "2");
|
|
toDelete({}, "2");
|
|
moreList.value = [];
|
|
moreList.value = [];
|
|
toClear();
|
|
toClear();
|
|
|
|
+ await clearPage();
|
|
|
|
+ await searchOther();
|
|
};
|
|
};
|
|
const toClear = () => {
|
|
const toClear = () => {
|
|
searchList.value = searchList.value.map((i, index) => {
|
|
searchList.value = searchList.value.map((i, index) => {
|
|
@@ -258,6 +270,12 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
} else
|
|
} else
|
|
is_bottom.value = true;
|
|
is_bottom.value = true;
|
|
};
|
|
};
|
|
|
|
+ const clearPage = () => {
|
|
|
|
+ list.value = [];
|
|
|
|
+ skip.value = 0;
|
|
|
|
+ limit.value = 6;
|
|
|
|
+ page.value = 0;
|
|
|
|
+ };
|
|
return (_ctx, _cache) => {
|
|
return (_ctx, _cache) => {
|
|
var _a2;
|
|
var _a2;
|
|
return common_vendor.e({
|
|
return common_vendor.e({
|
|
@@ -343,11 +361,11 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
q: type.value == "3",
|
|
q: type.value == "3",
|
|
t: is_show.value,
|
|
t: is_show.value,
|
|
v: common_vendor.o(toClose),
|
|
v: common_vendor.o(toClose),
|
|
- w: Object.keys(brandInfo.value).length > 0 || Object.keys(moneyInfo.value).length > 0 || Object.keys(yearInfo.value).length > 0 || moreList.value.length > 0
|
|
|
|
- }, Object.keys(brandInfo.value).length > 0 || Object.keys(moneyInfo.value).length > 0 || Object.keys(yearInfo.value).length > 0 || moreList.value.length > 0 ? common_vendor.e({
|
|
|
|
- x: brandInfo.value && brandInfo.value.type
|
|
|
|
- }, brandInfo.value && brandInfo.value.type ? {
|
|
|
|
- y: common_vendor.t(brandInfo.value.title),
|
|
|
|
|
|
+ w: searchInfo.value.brand || searchInfo.value.money || moreList.value.length > 0
|
|
|
|
+ }, searchInfo.value.brand || searchInfo.value.money || moreList.value.length > 0 ? common_vendor.e({
|
|
|
|
+ x: searchInfo.value && searchInfo.value.brand
|
|
|
|
+ }, searchInfo.value && searchInfo.value.brand ? {
|
|
|
|
+ y: common_vendor.t(searchInfo.value.brand),
|
|
z: common_vendor.p({
|
|
z: common_vendor.p({
|
|
color: "#000",
|
|
color: "#000",
|
|
size: "14px",
|
|
size: "14px",
|
|
@@ -355,9 +373,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
}),
|
|
}),
|
|
A: common_vendor.o(($event) => toDelete({}, "0"))
|
|
A: common_vendor.o(($event) => toDelete({}, "0"))
|
|
} : {}, {
|
|
} : {}, {
|
|
- B: moneyInfo.value && moneyInfo.value.type
|
|
|
|
- }, moneyInfo.value && moneyInfo.value.type ? {
|
|
|
|
- C: common_vendor.t(moneyInfo.value.title),
|
|
|
|
|
|
+ B: searchInfo.value && searchInfo.value.money
|
|
|
|
+ }, searchInfo.value && searchInfo.value.money ? {
|
|
|
|
+ C: common_vendor.t(searchInfo.value.money),
|
|
D: common_vendor.p({
|
|
D: common_vendor.p({
|
|
color: "#000",
|
|
color: "#000",
|
|
size: "14px",
|
|
size: "14px",
|
|
@@ -365,9 +383,9 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
}),
|
|
}),
|
|
E: common_vendor.o(($event) => toDelete({}, "1"))
|
|
E: common_vendor.o(($event) => toDelete({}, "1"))
|
|
} : {}, {
|
|
} : {}, {
|
|
- F: yearInfo.value && yearInfo.value.type
|
|
|
|
- }, yearInfo.value && yearInfo.value.type ? {
|
|
|
|
- G: common_vendor.t(yearInfo.value.title),
|
|
|
|
|
|
+ F: searchInfo.value && searchInfo.value.year
|
|
|
|
+ }, searchInfo.value && searchInfo.value.year ? {
|
|
|
|
+ G: common_vendor.t(searchInfo.value.year),
|
|
H: common_vendor.p({
|
|
H: common_vendor.p({
|
|
color: "#000",
|
|
color: "#000",
|
|
size: "14px",
|
|
size: "14px",
|