index.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  4. __name: "index",
  5. setup(__props) {
  6. var _a, _b;
  7. (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  8. const $config = (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  9. const field = common_vendor.ref("");
  10. common_vendor.ref("");
  11. 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"]);
  12. const CityList = common_vendor.ref($config.china);
  13. const LetterId = common_vendor.ref("");
  14. common_vendor.onLoad(async (options) => {
  15. field.value = options && options.field || "";
  16. });
  17. const getLetter = (name) => {
  18. LetterId.value = name;
  19. common_vendor.index.pageScrollTo({
  20. selector: "#" + name,
  21. duration: 300
  22. });
  23. };
  24. const getStorage = (item) => {
  25. item.field = field.value;
  26. common_vendor.index.$emit("toCity", item);
  27. common_vendor.index.navigateBack({
  28. delta: 1
  29. // 返回的页面数
  30. });
  31. };
  32. return (_ctx, _cache) => {
  33. return {
  34. a: common_vendor.o(($event) => getLetter("ScrollTop")),
  35. b: common_vendor.f(LatterName.value, (l, i, i0) => {
  36. return {
  37. a: common_vendor.t(l),
  38. b: i,
  39. c: common_vendor.o(($event) => getLetter(l), i),
  40. d: LetterId.value === l ? "#2979ff" : "#000"
  41. };
  42. }),
  43. c: common_vendor.f(CityList.value, (item, index, i0) => {
  44. return {
  45. a: common_vendor.t(item.initial),
  46. b: item.initial,
  47. c: common_vendor.f(item.list, (item_city, name_index, i1) => {
  48. return {
  49. a: common_vendor.t(item_city.name),
  50. b: common_vendor.o(($event) => getStorage(item_city), name_index),
  51. c: name_index
  52. };
  53. }),
  54. d: index
  55. };
  56. }),
  57. d: LetterId.value
  58. };
  59. };
  60. }
  61. });
  62. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-3361df53"], ["__file", "D:/project/赋强公证/notarization_applet/pagesHome/city/index.vue"]]);
  63. wx.createPage(MiniProgramPage);