index.js 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. "use strict";
  2. const common_vendor = require("../../common/vendor.js");
  3. if (!Array) {
  4. const _easycom_u_swiper2 = common_vendor.resolveComponent("u-swiper");
  5. const _easycom_u_icon2 = common_vendor.resolveComponent("u-icon");
  6. (_easycom_u_swiper2 + _easycom_u_icon2)();
  7. }
  8. const _easycom_u_swiper = () => "../../node-modules/uview-plus/components/u-swiper/u-swiper.js";
  9. const _easycom_u_icon = () => "../../node-modules/uview-plus/components/u-icon/u-icon.js";
  10. if (!Math) {
  11. (_easycom_u_swiper + _easycom_u_icon)();
  12. }
  13. const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({
  14. __name: "index",
  15. setup(__props) {
  16. var _a, _b;
  17. const $api = (_a = common_vendor.getCurrentInstance()) == null ? void 0 : _a.appContext.config.globalProperties.$api;
  18. (_b = common_vendor.getCurrentInstance()) == null ? void 0 : _b.appContext.config.globalProperties.$config;
  19. const config = common_vendor.ref({ logo: [], file: [] });
  20. common_vendor.ref([]);
  21. common_vendor.ref(0);
  22. const menuList = common_vendor.ref([]);
  23. common_vendor.onShow(async () => {
  24. await searchConfig();
  25. await searchOther();
  26. await search();
  27. });
  28. const searchConfig = async () => {
  29. config.value = common_vendor.index.getStorageSync("config");
  30. };
  31. const searchOther = async () => {
  32. const res = await $api("module", "GET", { is_use: "0" });
  33. if (res.errcode === 0) {
  34. menuList.value = res.data;
  35. } else {
  36. common_vendor.index.showToast({
  37. title: res.errmsg || "",
  38. icon: "error"
  39. });
  40. }
  41. };
  42. const search = async () => {
  43. };
  44. const toCommon = (url) => {
  45. common_vendor.index.navigateTo({
  46. url
  47. });
  48. };
  49. return (_ctx, _cache) => {
  50. return {
  51. a: common_vendor.p({
  52. list: config.value.file,
  53. height: "240px",
  54. indicator: true,
  55. indicatorMode: "line",
  56. circular: true
  57. }),
  58. b: common_vendor.f(menuList.value, (item, index, i0) => {
  59. return {
  60. a: item.file && item.file.length > 0 ? item.file[0].url : "",
  61. b: common_vendor.t(item.title),
  62. c: common_vendor.t(item.brief),
  63. d: "4978fed5-1-" + i0,
  64. e: index,
  65. f: common_vendor.o(($event) => toCommon(item.route), index)
  66. };
  67. }),
  68. c: common_vendor.p({
  69. name: "arrow-right",
  70. size: "20"
  71. })
  72. };
  73. };
  74. }
  75. });
  76. const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-4978fed5"], ["__file", "D:/project/赋强公证/notarization_applet/pages/home/index.vue"]]);
  77. wx.createPage(MiniProgramPage);