177 lines
6.3 KiB
JavaScript
177 lines
6.3 KiB
JavaScript
|
|
"use strict";
|
||
|
|
const common_vendor = require("../../common/vendor.js");
|
||
|
|
const pages_addstaff_api_addjigou = require("../addstaff/api/addjigou.js");
|
||
|
|
const pages_oldmanindex_api = require("./api.js");
|
||
|
|
if (!Math) {
|
||
|
|
(model + downMenu)();
|
||
|
|
}
|
||
|
|
const downMenu = () => "../../compontent/public/oldmandownmenu.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 jumpSaoyisao = () => {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/oldmanindex/saoyisao"
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const clickSmallball = () => {
|
||
|
|
common_vendor.index.navigateTo({
|
||
|
|
url: "/pages/yuangongindex/message"
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const changecard = (e) => {
|
||
|
|
which.value = e;
|
||
|
|
whichMenu.value = which.value;
|
||
|
|
};
|
||
|
|
const moveend = () => {
|
||
|
|
which.value = menuArray.value.length;
|
||
|
|
whichMenu.value = which.value;
|
||
|
|
};
|
||
|
|
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_oldmanindex_api.getIndex(res.data).then((res2) => {
|
||
|
|
menuArray.value = [];
|
||
|
|
res2.result.forEach((element) => {
|
||
|
|
if (element.isInvited == 1 || element.isInvited == 0 && element.applyStatus == 2) {
|
||
|
|
menuArray.value.push(element);
|
||
|
|
}
|
||
|
|
});
|
||
|
|
menuArray.value.push({
|
||
|
|
applyStatus: `-1`
|
||
|
|
});
|
||
|
|
});
|
||
|
|
pages_addstaff_api_addjigou.getMessageList(res.data).then((res2) => {
|
||
|
|
common_vendor.index.setStorageSync("staff", res2.result[0]);
|
||
|
|
});
|
||
|
|
}
|
||
|
|
});
|
||
|
|
};
|
||
|
|
const hong = common_vendor.ref(0);
|
||
|
|
common_vendor.onShow(() => {
|
||
|
|
loadingData();
|
||
|
|
pages_oldmanindex_api.isRead().then((res) => {
|
||
|
|
if (res.result) {
|
||
|
|
hong.value = res.result;
|
||
|
|
}
|
||
|
|
});
|
||
|
|
});
|
||
|
|
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: `${moveHeight.value}px`,
|
||
|
|
f: common_vendor.o(clickSmallball),
|
||
|
|
g: `${moveHeight.value}px`,
|
||
|
|
h: common_vendor.o(clickSmallball),
|
||
|
|
i: common_vendor.o(($event) => show.value = false),
|
||
|
|
j: common_vendor.p({
|
||
|
|
show: show.value,
|
||
|
|
content: content.value
|
||
|
|
}),
|
||
|
|
k: common_vendor.f(menuArray.value, (item, index, i0) => {
|
||
|
|
return common_vendor.e({
|
||
|
|
a: item.applyStatus == `1`
|
||
|
|
}, item.applyStatus == `1` ? {
|
||
|
|
b: `https://www.focusnu.com/media/directive/index/refresh.png`,
|
||
|
|
c: common_vendor.o(loadingData, index)
|
||
|
|
} : {}, {
|
||
|
|
d: item.applyStatus == `1`
|
||
|
|
}, item.applyStatus == `1` ? {
|
||
|
|
e: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`,
|
||
|
|
f: common_vendor.t(item.comName)
|
||
|
|
} : {}, {
|
||
|
|
g: item.applyStatus == `3`
|
||
|
|
}, item.applyStatus == `3` ? {
|
||
|
|
h: `https://www.focusnu.com/media/directive/index/${statusarray[Number(item.applyStatus) - 1]}.png`,
|
||
|
|
i: common_vendor.t(item.comName),
|
||
|
|
j: common_vendor.o(($event) => again(), index)
|
||
|
|
} : {}, {
|
||
|
|
k: item.applyStatus == `2`
|
||
|
|
}, item.applyStatus == `2` ? {
|
||
|
|
l: common_vendor.f(buttonArray.value, (item2, index2, i1) => {
|
||
|
|
return {
|
||
|
|
a: `https://www.focusnu.com/media/directive/index/addstaff/${index2}.png`,
|
||
|
|
b: common_vendor.t(item2),
|
||
|
|
c: index2
|
||
|
|
};
|
||
|
|
})
|
||
|
|
} : {}, {
|
||
|
|
m: item.applyStatus == `-1`
|
||
|
|
}, item.applyStatus == `-1` ? {
|
||
|
|
n: `https://www.focusnu.com/media/directive/index/saoyisaowhite.png`,
|
||
|
|
o: common_vendor.o(jumpSaoyisao, index),
|
||
|
|
p: `https://www.focusnu.com/media/directive/index/shoudong.png`
|
||
|
|
} : {}, {
|
||
|
|
q: item.applyStatus == `2`
|
||
|
|
}, item.applyStatus == `2` ? {
|
||
|
|
r: common_vendor.t(item.comName)
|
||
|
|
} : {}, {
|
||
|
|
s: index
|
||
|
|
});
|
||
|
|
}),
|
||
|
|
l: `100vh`,
|
||
|
|
m: which.value,
|
||
|
|
n: common_vendor.o(swiperchange),
|
||
|
|
o: 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)
|
||
|
|
});
|
||
|
|
}),
|
||
|
|
p: common_vendor.p({
|
||
|
|
itemTarget: 0
|
||
|
|
})
|
||
|
|
});
|
||
|
|
};
|
||
|
|
}
|
||
|
|
};
|
||
|
|
const MiniProgramPage = /* @__PURE__ */ common_vendor._export_sfc(_sfc_main, [["__scopeId", "data-v-9cf2c967"]]);
|
||
|
|
wx.createPage(MiniProgramPage);
|
||
|
|
//# sourceMappingURL=../../../.sourcemap/mp-weixin/pages/oldmanindex/index.js.map
|