"use strict"; const common_vendor = require("../../common/vendor.js"); const pagesHome_condition_common_classify = require("./common/classify.js"); if (!Array) { const _easycom_u_button2 = common_vendor.resolveComponent("u-button"); _easycom_u_button2(); } const _easycom_u_button = () => "../../node-modules/uview-plus/components/u-button/u-button.js"; if (!Math) { (_easycom_u_button + SliderRange)(); } const SliderRange = () => "../../components/slider-range/index.js"; const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "index", setup(__props) { var _a; (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api; common_vendor.computed(() => { return common_vendor.index.getStorageSync("openid"); }); const config = common_vendor.ref({}); const id = common_vendor.ref(""); const total = common_vendor.ref(0); const scrollTop = common_vendor.ref(0); const current = common_vendor.ref(0); const itemId = common_vendor.ref(""); const tabbar = common_vendor.ref(pagesHome_condition_common_classify.classifyData); const scrollRightTop = common_vendor.ref(0); const brandInfo = common_vendor.ref({}); const cityInfo = common_vendor.ref({}); const searchList = common_vendor.ref([]); common_vendor.onLoad(async (options) => { id.value = options && options.id; await searchOther(); await searchConfig(); await search(); }); common_vendor.onShow(async () => { common_vendor.index.$on("toRoute", function(data) { brandInfo.value = data; tabbar.value = tabbar.value.map((item, index) => { if (item.type == "1" && item.value == "0") item.text = data.title; return item; }); }); common_vendor.index.$on("toCity", function(data) { cityInfo.value = data; tabbar.value = tabbar.value.map((item, index) => { if (item.type == "1" && item.value == "1") item.text = data.name; return item; }); }); }); const searchOther = async () => { }; const searchConfig = async () => { config.value = common_vendor.index.getStorageSync("config"); }; const search = async () => { }; const swichMenu = (index) => { if (index == current.value) return; current.value = index; itemId.value = `item${index}`; }; const rightScroll = async (e) => { scrollTop.value = e.scrollTop; }; const toCommon = (type) => { if (type == "0") { common_vendor.index.navigateTo({ url: `/pagesHome/brand/index` }); } else { common_vendor.index.navigateTo({ url: `/pagesHome/city/index` }); } }; const changeSliderValue = (e, data) => { tabbar.value = tabbar.value.map((item, index) => { if (item.name == data.name) { if (e.firstValue == 0) item.content = `${e.secondValue}${item.unit}以下`; else item.content = `${e.firstValue}-${e.secondValue}${item.unit}`; item.value = e.values; } return item; }); }; const toSelect = async (value, data) => { searchList.value.push(data); tabbar.value = tabbar.value.map((item, index) => { if (item.name == value.name) { item.foods = item.foods.map((item1, index1) => { if (item1.title == data.title) item1.is_open = !item1.is_open; return item1; }); } return item; }); }; return (_ctx, _cache) => { return { a: common_vendor.f(tabbar.value, (item, index, i0) => { return { a: common_vendor.t(item.name), b: index, c: "item" + index, d: common_vendor.n(current.value == index ? "u-tab-item-active" : ""), e: common_vendor.o(($event) => swichMenu(index), index) }; }), b: scrollTop.value, c: common_vendor.f(tabbar.value, (item, index, i0) => { return common_vendor.e({ a: item.type != "2" }, item.type != "2" ? { b: common_vendor.t(item.name) } : { c: common_vendor.t(item.name), d: common_vendor.t(item.unit), e: common_vendor.t(item.content || "不限") }, { f: item.type == "0" }, item.type == "0" ? { g: common_vendor.f(item.foods, (item1, index1, i1) => { return { a: common_vendor.t(item1.title), b: common_vendor.n(item1.is_open == false ? "title_1" : "title_2"), c: index1, d: common_vendor.o(($event) => toSelect(item, item1), index1) }; }) } : item.type == "1" ? { i: common_vendor.o(($event) => toCommon(item.value), index), j: "4b99813d-0-" + i0, k: common_vendor.p({ text: item.text, size: "normal", type: "info" }) } : item.type == "2" ? { m: common_vendor.o((event) => changeSliderValue(event, item), index), n: "4b99813d-1-" + i0, o: common_vendor.p({ value: item.value, min: item.min, max: item.max, step: item.step, scale: { show: true } }) } : {}, { h: item.type == "1", l: item.type == "2", p: "item" + index, q: index }); }), d: scrollRightTop.value, e: itemId.value, f: common_vendor.o(rightScroll), g: common_vendor.t(total.value) }; }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4b99813d"], ["__file", "D:/project/二手车/car_applet/pagesHome/condition/index.vue"]]); wx.createPage(MiniProgramPage);