index.js 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_index_anchor2 = common_vendor.resolveComponent("u-index-anchor");
  5. const _easycom_u_index_item2 = common_vendor.resolveComponent("u-index-item");
  6. const _easycom_u_index_list2 = common_vendor.resolveComponent("u-index-list");
  7. (_easycom_u_index_anchor2 + _easycom_u_index_item2 + _easycom_u_index_list2)();
  8. }
  9. const _easycom_u_index_anchor = () => "../../node-modules/uview-plus/components/u-index-anchor/u-index-anchor.js";
  10. const _easycom_u_index_item = () => "../../node-modules/uview-plus/components/u-index-item/u-index-item.js";
  11. const _easycom_u_index_list = () => "../../node-modules/uview-plus/components/u-index-list/u-index-list.js";
  12. if (!Math) {
  13. (_easycom_u_index_anchor + _easycom_u_index_item + _easycom_u_index_list)();
  14. }
  15. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  16. __name: "index",
  17. setup(__props) {
  18. var _a;
  19. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  20. const config = common_vendor.ref({ logoUrl: [] });
  21. const indexList = common_vendor.ref(["A", "B", "C", "D", "E", "F", "G", "H", "I", "J"]);
  22. const itemArr = common_vendor.ref([
  23. [{ title: "奥迪", url: [], type: "0" }, { title: "爱驰", url: [], type: "0" }, { title: "阿斯顿·马丁", url: [], type: "0" }],
  24. [{ title: "宝马", url: [], type: "0" }, { title: "本田", url: [], type: "0" }, { title: "比亚迪", url: [], type: "0" }, { title: "奔腾", url: [], type: "0" }],
  25. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  26. [{ title: "大众", url: [], type: "0" }, { title: "东风", url: [], type: "0" }, { title: "大运", url: [], type: "0" }],
  27. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  28. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  29. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  30. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  31. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }],
  32. [{ title: "长安", url: [], type: "0" }, { title: "长城", url: [], type: "0" }, { title: "创维", url: [], type: "0" }]
  33. ]);
  34. const list = common_vendor.ref([
  35. { title: "奥迪", url: [], type: "0" },
  36. { title: "本田", url: [], type: "0" },
  37. { title: "别克", url: [], type: "0" },
  38. { title: "奥迪", url: [], type: "0" },
  39. { title: "大众", url: [], type: "0" },
  40. { title: "长城", url: [], type: "0" },
  41. { title: "福特", url: [], type: "0" },
  42. { title: "丰田", url: [], type: "0" },
  43. { title: "长安", url: [], type: "0" },
  44. { title: "日产", url: [], type: "0" }
  45. ]);
  46. common_vendor.onLoad(async () => {
  47. await searchConfig();
  48. await search();
  49. });
  50. const searchConfig = async () => {
  51. config.value = common_vendor.index.getStorageSync("config");
  52. };
  53. const search = async () => {
  54. };
  55. const toCommon = (item) => {
  56. common_vendor.index.$emit("toRoute", item);
  57. common_vendor.index.navigateBack({
  58. delta: 1
  59. // 返回的页面数
  60. });
  61. };
  62. return (_ctx, _cache) => {
  63. return {
  64. a: common_vendor.f(list.value, (item, index, i0) => {
  65. return {
  66. a: item.url && item.url.length > 0 ? item.url[0].url : "/static/logo.png",
  67. b: common_vendor.t(item.title),
  68. c: index,
  69. d: common_vendor.o(($event) => toCommon(item), index)
  70. };
  71. }),
  72. b: _ctx.header,
  73. c: common_vendor.f(itemArr.value, (item, index, i0) => {
  74. return {
  75. a: "bd19021e-2-" + i0 + "," + ("bd19021e-1-" + i0),
  76. b: common_vendor.p({
  77. color: "#333333",
  78. ["bg-color"]: "#f9f9f9",
  79. text: indexList.value[index]
  80. }),
  81. c: common_vendor.f(item, (cell, index2, i1) => {
  82. return {
  83. a: common_vendor.t(cell.title),
  84. b: common_vendor.o(($event) => toCommon(cell))
  85. };
  86. }),
  87. d: item.url && item.url.length > 0 ? item.url[0].url : "/static/logo.png",
  88. e: "bd19021e-1-" + i0 + ",bd19021e-0",
  89. f: index
  90. };
  91. }),
  92. d: common_vendor.p({
  93. ["index-list"]: indexList.value,
  94. sticky: false,
  95. activeColor: "#ffbc00"
  96. })
  97. };
  98. };
  99. }
  100. });
  101. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-bd19021e"], ["__file", "D:/project/二手车/car_applet/pagesHome/brand/index.vue"]]);
  102. wx.createPage(MiniProgramPage);