"use strict";
const common_vendor = require("../../common/vendor.js");
const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  __name: "index",
  setup(__props) {
    var _a, _b;
    (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
    const $config = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
    const field = common_vendor.ref("");
    common_vendor.ref("");
    const LatterName = common_vendor.ref(["全", "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z"]);
    const CityList = common_vendor.ref($config.china);
    const LetterId = common_vendor.ref("");
    common_vendor.onLoad(async (options) => {
      field.value = options && options.field || "";
    });
    const getLetter = (name) => {
      LetterId.value = name;
      common_vendor.index.pageScrollTo({
        selector: "#" + name,
        duration: 300
      });
    };
    const getStorage = (item) => {
      item.field = field.value;
      common_vendor.index.$emit("toCity", item);
      common_vendor.index.navigateBack({
        delta: 1
        // 返回的页面数
      });
    };
    return (_ctx, _cache) => {
      return {
        a: common_vendor.o(($event) => getLetter("ScrollTop")),
        b: common_vendor.f(LatterName.value, (l, i, i0) => {
          return {
            a: common_vendor.t(l),
            b: i,
            c: common_vendor.o(($event) => getLetter(l), i),
            d: LetterId.value === l ? "#2979ff" : "#000"
          };
        }),
        c: common_vendor.f(CityList.value, (item, index, i0) => {
          return {
            a: common_vendor.t(item.initial),
            b: item.initial,
            c: common_vendor.f(item.list, (item_city, name_index, i1) => {
              return {
                a: common_vendor.t(item_city.name),
                b: common_vendor.o(($event) => getStorage(item_city), name_index),
                c: name_index
              };
            }),
            d: index
          };
        }),
        d: LetterId.value
      };
    };
  }
});
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3361df53"], ["__file", "D:/project/赋强公证/notarization_applet/pagesHome/city/index.vue"]]);
wx.createPage(MiniProgramPage);
