|
@@ -16,33 +16,10 @@ 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;
|
|
|
+ const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
|
|
|
const config = common_vendor.ref({ logoUrl: [] });
|
|
|
- const indexList = common_vendor.ref(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]);
|
|
|
- const itemArr = common_vendor.ref([
|
|
|
- [{ title: "奥迪", url: [], type: "0" }, { title: "爱驰", url: [], type: "0" }, { title: "阿斯顿·马丁", url: [], type: "0" }],
|
|
|
- [{ title: "宝马", url: [], type: "0" }, { title: "本田", url: [], type: "0" }, { title: "比亚迪", url: [], type: "0" }, { title: "奔腾", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "大众", url: [], type: "0" }, { title: "东风", url: [], type: "0" }, { title: "大运", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
|
|
|
- [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }]
|
|
|
- ]);
|
|
|
- const list = common_vendor.ref([
|
|
|
- { title: "奥迪", url: [], type: "0" },
|
|
|
- { title: "本田", url: [], type: "0" },
|
|
|
- { title: "别克", url: [], type: "0" },
|
|
|
- { title: "奥迪", url: [], type: "0" },
|
|
|
- { title: "大众", url: [], type: "0" },
|
|
|
- { title: "长城", url: [], type: "0" },
|
|
|
- { title: "福特", url: [], type: "0" },
|
|
|
- { title: "丰田", url: [], type: "0" },
|
|
|
- { title: "长安", url: [], type: "0" },
|
|
|
- { title: "日产", url: [], type: "0" }
|
|
|
- ]);
|
|
|
+ const indexList = common_vendor.ref([]);
|
|
|
+ const itemArr = common_vendor.ref([]);
|
|
|
common_vendor.onLoad(async () => {
|
|
|
await searchConfig();
|
|
|
await search();
|
|
@@ -51,6 +28,16 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
config.value = common_vendor.index.getStorageSync("config");
|
|
|
};
|
|
|
const search = async () => {
|
|
|
+ const res = await $api("brand/index", "GET", {});
|
|
|
+ if (res.errcode === 0) {
|
|
|
+ itemArr.value = res.data.data1;
|
|
|
+ indexList.value = res.data.data2;
|
|
|
+ } else {
|
|
|
+ common_vendor.index.showToast({
|
|
|
+ title: res.errmsg || "",
|
|
|
+ icon: "error"
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
const toCommon = (item) => {
|
|
|
common_vendor.index.$emit("toRoute", item);
|
|
@@ -61,16 +48,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
};
|
|
|
return (_ctx, _cache) => {
|
|
|
return {
|
|
|
- a: common_vendor.f(list.value, (item, index, i0) => {
|
|
|
- return {
|
|
|
- a: item.url && item.url.length > 0 ? item.url[0].url : "/static/logo.png",
|
|
|
- b: common_vendor.t(item.title),
|
|
|
- c: index,
|
|
|
- d: common_vendor.o(($event) => toCommon(item), index)
|
|
|
- };
|
|
|
- }),
|
|
|
- b: _ctx.header,
|
|
|
- c: common_vendor.f(itemArr.value, (item, index, i0) => {
|
|
|
+ a: common_vendor.f(itemArr.value, (item, index, i0) => {
|
|
|
return {
|
|
|
a: "bd19021e-2-" + i0 + "," + ("bd19021e-1-" + i0),
|
|
|
b: common_vendor.p({
|
|
@@ -80,7 +58,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
}),
|
|
|
c: common_vendor.f(item, (cell, index2, i1) => {
|
|
|
return {
|
|
|
- a: common_vendor.t(cell.title),
|
|
|
+ a: common_vendor.t(cell.name),
|
|
|
b: common_vendor.o(($event) => toCommon(cell))
|
|
|
};
|
|
|
}),
|
|
@@ -89,7 +67,7 @@ const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
|
|
|
f: index
|
|
|
};
|
|
|
}),
|
|
|
- d: common_vendor.p({
|
|
|
+ b: common_vendor.p({
|
|
|
["index-list"]: indexList.value,
|
|
|
sticky: false,
|
|
|
activeColor: "#ffbc00"
|