Newer
Older
XiaoGanWXMini / unpackage / dist / dev / mp-weixin / pages / index / index.js
@zhangdeliang zhangdeliang on 29 Jul 5 KB 迁移
"use strict";
const common_vendor = require("../../common/vendor.js");
const common_assets = require("../../common/assets.js");
const utils_homeApi = require("../../utils/homeApi.js");
if (!Array) {
  const _easycom_uni_swiper_dot2 = common_vendor.resolveComponent("uni-swiper-dot");
  _easycom_uni_swiper_dot2();
}
const _easycom_uni_swiper_dot = () => "../../uni_modules/uni-swiper-dot/components/uni-swiper-dot/uni-swiper-dot.js";
if (!Math) {
  _easycom_uni_swiper_dot();
}
const _sfc_main = {
  __name: "index",
  setup(__props) {
    const current = common_vendor.ref(0);
    const lawList = common_vendor.ref([]);
    const projectList = common_vendor.ref([]);
    const navImageList = common_vendor.ref([]);
    const menuList = common_vendor.ref([
      {
        title: "技术标准",
        type: "technical",
        url: "/static/images/jsbz.png"
      },
      {
        title: "政策法规",
        type: "policies",
        url: "/static/images/zcfg.png"
      },
      {
        title: "科普知识",
        type: "knowledge",
        url: "/static/images/kpzs.png"
      },
      {
        title: "问卷调查",
        type: "4",
        url: "/static/images/wjdc.png"
      },
      {
        title: "海绵项目",
        type: "project",
        url: "/static/images/hmxm.png"
      },
      {
        title: "通知公告",
        type: "notice",
        url: "/static/images/tzgg.png"
      }
    ]);
    function gotoMenu(item) {
      if (item.type == "4") {
        common_vendor.index.navigateTo({
          url: `/pages/quesNaire/index?title=${item.title}&type=${item.type}`
        });
      } else if (item.type == "project") {
        common_vendor.index.navigateTo({
          // url: `/pages/projectHM/project?title=${item.title}&type=${item.type}`//单个项目
          url: `/pages/projectHM/projectAll`
        });
      } else {
        common_vendor.index.navigateTo({
          url: `/pages/news/index?title=${item.title}&type=${item.type}`
        });
      }
    }
    function getProjectList() {
      utils_homeApi.projectInfoPage({ pageNum: 1, pageSize: 4, topOrder: 1 }).then((res) => {
        projectList.value = res.data;
      });
    }
    function getLawList() {
      utils_homeApi.articleConfigPage({ articleType: "policies" }).then((res) => {
        lawList.value = res.data.splice(0, 5);
      });
    }
    function gotoProject() {
      common_vendor.index.navigateTo({
        // url: `/pages/projectHM/project`//单个项目
        url: `/pages/projectHM/projectAll`
      });
    }
    function checkDetail(item) {
      common_vendor.index.navigateTo({
        url: `/pages/news/detail?title=政策法规&id=${item.id}`
      });
    }
    function getNavList() {
      utils_homeApi.specialNavList().then((res) => {
        navImageList.value = res.data || [];
      });
    }
    function openUrl(url) {
    }
    common_vendor.onShareAppMessage((res) => {
      return {
        title: "转发给朋友",
        path: "/pages/home/index"
      };
    });
    common_vendor.onMounted(() => {
      getNavList();
      getProjectList();
      getLawList();
    });
    common_vendor.onTabItemTap((e) => {
      getNavList();
      getProjectList();
      getLawList();
    });
    return (_ctx, _cache) => {
      return common_vendor.e({
        a: common_vendor.f(navImageList.value, (item, index, i0) => {
          return common_vendor.e({
            a: item.coverPhotosFileList.length == 0
          }, item.coverPhotosFileList.length == 0 ? {} : {
            b: item.coverPhotosFileList[0].url,
            c: common_vendor.o(($event) => openUrl(item.linkUrl), index)
          }, {
            d: index
          });
        }),
        b: common_vendor.p({
          info: navImageList.value,
          current: current.value,
          field: "url",
          mode: "default"
        }),
        c: common_vendor.f(menuList.value, (item, index, i0) => {
          return {
            a: item.url,
            b: common_vendor.t(item.title),
            c: index,
            d: common_vendor.o(($event) => gotoMenu(item), index)
          };
        }),
        d: common_vendor.o(gotoProject),
        e: common_vendor.f(projectList.value, (item, k0, i0) => {
          return {
            a: item.sysFileList.length > 0 ? item.sysFileList[0].url : "",
            b: common_vendor.t(item.projectName),
            c: item.id
          };
        }),
        f: projectList.value.length == 0
      }, projectList.value.length == 0 ? {
        g: common_assets._imports_0
      } : {}, {
        h: common_vendor.f(lawList.value, (item, k0, i0) => {
          return {
            a: common_vendor.t(item.title),
            b: common_vendor.t(item.updateTime),
            c: item.id,
            d: common_vendor.o(($event) => checkDetail(item), item.id)
          };
        }),
        i: lawList.value.length == 0
      }, lawList.value.length == 0 ? {
        j: common_assets._imports_0
      } : {});
    };
  }
};
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__file", "E:/项目/孝感海绵城市/XiaoGanWXMini/pages/index/index.vue"]]);
_sfc_main.__runtimeHooks = 2;
wx.createPage(MiniProgramPage);