"use strict"; const common_vendor = require("../../common/vendor.js"); const pages_oldmanindex_api = require("./api.js"); const _sfc_main = /* @__PURE__ */ common_vendor.defineComponent({ __name: "message", setup(__props) { const hulijigouArray = common_vendor.ref([]); common_vendor.ref(false); common_vendor.ref(""); const clickCard = (type) => { if (type.izRead == "1") { pages_oldmanindex_api.upRead({ id: type.id }).then((res) => { if (res.success) { search(); switch (type.type) { case "emp_org_invited_emp_list": common_vendor.index.navigateTo({ url: `/pages/yuangongindex/simpleyaoqing?extend=${type.extend}` }); break; } } }); } else { switch (type.type) { case "emp_org_invited_emp_list": common_vendor.index.navigateTo({ url: `/pages/yuangongindex/simpleyaoqing?extend=${type.extend}` }); break; } } }; const checkRed = () => { if (hulijigouArray.value.every((item) => item.izRead == `0`)) { hong.value = false; } else { hong.value = true; } }; const goBack = () => { common_vendor.index.reLaunch({ url: "/pages/oldmanindex/index" }); }; const search = () => { pages_oldmanindex_api.getNotice().then((res) => { if (res.success) { hulijigouArray.value = res.result; checkRed(); } }); }; common_vendor.ref(false); const hong = common_vendor.ref(false); common_vendor.onShow(() => { search(); }); return (_ctx, _cache) => { return common_vendor.e({ a: common_vendor.o(goBack), b: `${common_vendor.index.getStorageSync("moveHeight") + 40}px`, c: `${common_vendor.index.getStorageSync("moveHeight") + 30}px`, d: hulijigouArray.value.length }, hulijigouArray.value.length ? common_vendor.e({ e: hong.value }, hong.value ? {} : {}) : {}, { f: !hulijigouArray.value.length }, !hulijigouArray.value.length ? {} : {}, { g: common_vendor.f(hulijigouArray.value, (item, index, i0) => { return common_vendor.e({ a: common_vendor.t(item.title), b: common_vendor.t(item.createTime.substring(item.createTime.indexOf("-") + 1, item.createTime.indexOf("-") + 6)), c: item.izRead == `1` }, item.izRead == `1` ? {} : {}, { d: common_vendor.t(item.content), e: index, f: common_vendor.o(($event) => clickCard(item), index) }); }) }); }; } }); const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-0715cf6e"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/oldmanindex/message.js.map