"use strict"; const common_vendor = require("../../common/vendor.js"); const pages_addstaff_api_addjigou = require("../addstaff/api/addjigou.js"); const pages_yuangongindex_api = require("./api.js"); if (!Math) { (model + downMenu)(); } const downMenu = () => "../../compontent/public/yuangongdownmenu.js"; const model = () => "../../compontent/public/model.js"; const _sfc_main = { __name: "index", setup(__props) { const show = common_vendor.ref(false); const content = common_vendor.ref(""); const buttonArray = common_vendor.ref(["信息变更", "员工功能", "员工功能"]); const statusarray = ["loading", "success", "fail"]; const which = common_vendor.ref(0); const clickSmallball = () => { common_vendor.index.setStorageSync("jumpIndex", 1); common_vendor.index.navigateTo({ url: "/pages/yuangongindex/message" }); }; const searchjigou = () => { common_vendor.index.requestSubscribeMessage({ // 这里填后台申请好的 templateId 数组 tmplIds: ["yvvhlRft1CAdtU-dWlCW8U63VnTwRU8w3gR0BUdqcWw"], success: (res) => { common_vendor.index.navigateTo({ url: "/pages/yuangongindex/searchjigou" }); }, fail: (err) => { common_vendor.index.navigateTo({ url: "/pages/yuangongindex/searchjigou" }); } }); }; const changecard = (e) => { which.value = e; whichMenu.value = which.value; }; const moveend = () => { which.value = menuArray.value.length; whichMenu.value = which.value; }; const look = (element) => { common_vendor.index.navigateTo({ url: `/pages/yuangongindex/workjoin` }); }; const again = (item) => { common_vendor.index.navigateTo({ url: "/pages/yuangongindex/searchjigou" }); }; const whichMenu = common_vendor.ref(0); const swiperchange = (res) => { whichMenu.value = res.detail.current; which.value = res.detail.current; }; const moveHeight = common_vendor.ref(0); common_vendor.onMounted(() => { let capsule = null; if (typeof common_vendor.index.getMenuButtonBoundingClientRect === "function") { try { capsule = common_vendor.index.getMenuButtonBoundingClientRect(); } catch (e) { capsule = null; } moveHeight.value = capsule.top; } }); common_vendor.onUnmounted(() => { }); const menuArray = common_vendor.ref([]); const loadingData = () => { common_vendor.index.getStorage({ key: "openid", success: function(res) { pages_yuangongindex_api.getIndex(res.data).then((res2) => { menuArray.value = []; res2.result.forEach((element) => { if (element.applyType == "0" && element.applyStatus == "3") ; else { menuArray.value.push(element); } }); menuArray.value.push({ applyStatus: `-1` }); }); pages_addstaff_api_addjigou.getMessageList().then((res2) => { common_vendor.index.setStorageSync("staff", res2.result[0]); }); } }); }; const hong = common_vendor.ref(0); const changeStatus = (item, status) => { let data = { employeeId: item.employeesId, status: status ? 2 : 3, orgCode: item.orgCode }; pages_yuangongindex_api.invitedConfirm(data).then((res) => { if (res.success) { loadingData(); } }); }; const clickButton = (item, index) => { if (index === 0) { pages_addstaff_api_addjigou.getMessageList(item.orgCode).then((res) => { common_vendor.index.setStorageSync("changeyuangongorgCode", item.orgCode); if (res.success) { common_vendor.index.navigateTo({ url: `/pages/addstaff/all?element=${JSON.stringify(res.result[0])}` }); } }); } }; const jumptolist = (res) => { if (res) { content.value = res; show.value = true; } }; common_vendor.onShow(() => { loadingData(); pages_yuangongindex_api.isRead().then((res) => { if (res.result) { hong.value = res.result; } }); }); common_vendor.onPullDownRefresh(() => { loadingData(); pages_yuangongindex_api.isRead().then((res) => { if (res.result) { hong.value = res.result; } }); common_vendor.index.stopPullDownRefresh(); }); return (_ctx, _cache) => { return common_vendor.e({ a: hong.value }, hong.value ? { b: common_vendor.t(hong.value) } : {}, { c: `${moveHeight.value}px`, d: common_vendor.o(clickSmallball), e: common_vendor.o(($event) => show.value = false), f: common_vendor.p({ show: show.value, content: content.value }), g: common_vendor.f(menuArray.value, (item, index, i0) => { return common_vendor.e({ a: !(item.applyStatus == "2" || item.applyType == "2") }, !(item.applyStatus == "2" || item.applyType == "2") ? {} : {}, { b: item.applyType == "1" && item.applyStatus == `1` }, item.applyType == "1" && item.applyStatus == `1` ? { c: `https://www.focusnu.com/media/directive/index/refresh.png`, d: common_vendor.o(loadingData, index) } : {}, { e: item.applyType == "0" && item.applyStatus == `1` }, item.applyType == "0" && item.applyStatus == `1` ? { f: `https://www.focusnu.com/media/directive/index/yuangonginvited.png`, g: common_vendor.t(item.comName), h: common_vendor.t(item.orgLeader), i: common_vendor.t(item.orgLeaderPhone), j: common_vendor.o(($event) => changeStatus(item, false), index), k: common_vendor.o(($event) => changeStatus(item, true), index) } : {}, { l: item.applyType == "1" && item.applyStatus == `1` }, item.applyType == "1" && item.applyStatus == `1` ? { m: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`, n: common_vendor.t(item.comName), o: common_vendor.o(($event) => look(), index) } : {}, { p: item.applyType == "1" && item.applyStatus == `3` }, item.applyType == "1" && item.applyStatus == `3` ? { q: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`, r: common_vendor.t(item.comName), s: common_vendor.o(($event) => jumptolist(item.auditContent), index), t: common_vendor.o(($event) => again(), index) } : {}, { v: item.applyStatus == `2` || item.applyType == `2` }, item.applyStatus == `2` || item.applyType == `2` ? { w: `https://www.focusnu.com/media/directive/index/addstaff/top.png`, x: `https://www.focusnu.com/media/directive/index/addstaff/more.png`, y: `https://www.focusnu.com/media/directive/index/addstaff/00.png`, z: `https://www.focusnu.com/media/directive/index/addstaff/01.png`, A: `https://www.focusnu.com/media/directive/index/addstaff/02.png`, B: `https://www.focusnu.com/media/directive/index/addstaff/kaoqin.png`, C: `https://www.focusnu.com/media/directive/index/addstaff/more.png`, D: `https://www.focusnu.com/media/directive/index/addstaff/jineng.png`, E: `https://www.focusnu.com/media/directive/index/addstaff/yuangong.png`, F: common_vendor.f(buttonArray.value, (item0, index2, i1) => { return { a: `https://www.focusnu.com/media/directive/index/addstaff/${index2 + 2}.png`, b: common_vendor.t(item0), c: index2, d: common_vendor.o(($event) => clickButton(item, index2), index2) }; }) } : {}, { G: item.applyType == "1" && item.applyStatus == `-1` }, item.applyType == "1" && item.applyStatus == `-1` ? {} : {}, { H: item.applyStatus == `-1` }, item.applyStatus == `-1` ? { I: common_vendor.o(($event) => searchjigou(), index) } : {}, { J: item.applyStatus == `2` || item.applyType == `2` }, item.applyStatus == `2` || item.applyType == `2` ? { K: common_vendor.t(item.comName) } : {}, { L: index }); }), h: `100vh`, i: which.value, j: common_vendor.o(swiperchange), k: common_vendor.f(menuArray.value, (item, index, i0) => { return common_vendor.e({ a: index != menuArray.value.length - 1 }, index != menuArray.value.length - 1 ? { b: common_vendor.n(whichMenu.value == index ? `black-box` : `gray-box`) } : {}, { c: index == menuArray.value.length - 1 }, index == menuArray.value.length - 1 ? { d: `https://www.focusnu.com/media/directive/index/bluejia.png`, e: common_vendor.o(moveend, index) } : {}, { f: index, g: common_vendor.o(($event) => changecard(index), index) }); }), l: common_vendor.p({ itemTarget: 0 }) }); }; } }; const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-f6d04c18"]]); wx.createPage(MiniProgramPage); //# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/yuangongindex/index.js.map