import { b as buildAssetsURL } from '../../handlers/renderer.mjs';
import { h as handleDate, _ as _imports_2, E as ElMessage, H as Head, T as Title, a as __nuxt_component_2, b as __nuxt_component_3 } from './eye-icon-a9d07a5c.mjs';
import { useSSRContext, mergeProps, unref, ref, watchEffect, nextTick, onUnmounted, withAsyncContext, withCtx, createTextVNode, createVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { _ as _export_sfc } from './_plugin-vue_export-helper-cc2b3d55.mjs';
import { m as getListHttp, o as operateLikeHttp } from './cross-icon-a29366ee.mjs';
import { e as useRoute, u as useRouter } from '../server.mjs';
import 'vue-bundle-renderer/runtime';
import '../../nitro/node-server.mjs';
import 'node:http';
import 'node:https';
import 'fs';
import 'path';
import 'node:fs';
import 'node:url';
import 'devalue';
import '@unhead/ssr';
import 'unhead';
import '@unhead/shared';
import './index-6a088328.mjs';
import '@vue/shared';
import '@vueuse/core';
import 'lodash-unified';
import '@vue/reactivity';
import 'vue-router';
import 'axios';
import 'qs';
const _imports_0$1 = "" + buildAssetsURL("time-icon.fef65a83.svg");
const _imports_1 = "" + buildAssetsURL("time-white-icon.805d0e12.svg");
const _imports_3 = "" + buildAssetsURL("like-no.23054eaf.svg");
const _imports_4 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABGUUKwAAAD30lEQVR4AeVa7XXaMBSVDANkBDxB6QRxJmg6QVmANp2gZAOaDBCYoGwQugGZAGUD+F9Q7zPIxxAZy7ZkG0vn5Ejoy/fe954+7HDWgrRbf/8FGPeMySFyIRmf9MOneR3QeB0PufQMkJ+AOAlwlvgqYMEdD6ebswarPwOrs5WaTP7QD5PDPdu/6tvs1bZAAHaTTU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MFJGeS+GHnbobfC8b475yxNpvfD1j5I3AP8P+E06KT/wdPOffX7me6UQAAAABJRU5ErkJggg==";
const _imports_5 = "" + buildAssetsURL("comment-icon.f7b16ad3.svg");
const _sfc_main$1 = {
__name: "Item",
__ssrInlineRender: true,
props: {
item: Object
},
emits: ["childEvent"],
setup(__props, { emit: __emit }) {
return (_ctx, _push, _parent, _attrs) => {
_push(`${ssrInterpolate(__props.item["school"])}
`);
if (__props.item["profession"]) {
_push(`
\u4E13\u4E1A
${ssrInterpolate(__props.item["profession"])}
`);
} else {
_push(``);
}
if (__props.item["project"]) {
_push(`
\u9879\u76EE
${ssrInterpolate(__props.item["project"])}
`);
} else {
_push(``);
}
if (__props.item["interviewtime"]) {
_push(`
\u65F6\u95F4
${ssrInterpolate(__props.item["interviewtime"])}
`);
} else {
_push(``);
}
_push(`
${ssrInterpolate(__props.item["message"])}
${ssrInterpolate(("handleDate" in _ctx ? _ctx.handleDate : unref(handleDate))(__props.item["releasetime"]))}\u53D1\u5E03
${ssrInterpolate(__props.item["views"] || 0)}
`);
if (__props.item["islike"] == 0) {
_push(`
`);
} else {
_push(`
`);
}
_push(` ${ssrInterpolate(__props.item["likenum"] || 0)}
${ssrInterpolate(__props.item["commentnum"] || 0)}
`);
};
}
};
const _sfc_setup$1 = _sfc_main$1.setup;
_sfc_main$1.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("components/Item.vue");
return _sfc_setup$1 ? _sfc_setup$1(props, ctx) : void 0;
};
const __nuxt_component_4 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-0d09629d"]]);
const _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIA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/g8s8CCSvPqke+NiatixeYsPd0AAq5hBTEqH6aj/Zgs7TFMOJn/pYsf9yYVFCAhg4ibECr2QLZ06CgnFKody0b9xPA+RkbaLALugT7AGvDbp5SRY1tFEonIY8F7UKVY56L/QG6mjn5mhkRrwjapatk7VWiocUq+4KSkK6KPvl6lzBc+xUhWcfZR+0+TZ4rISUGJIFEJiBLVeY9f0l6rPbf2xBA8KE5Qw1iOje36Wbm1c2x63cnPYk4A58QjVouvqVRm2l4TMAsQfZRZcXExOBCzQVXQjyWuYpAhpf+Gr6Pqnm2U3Jvx7brH/ZbYd+APZxM/2zgvhdQAAAABJRU5ErkJggg==";
const _sfc_main = {
__name: "index",
__ssrInlineRender: true,
async setup(__props) {
let __temp, __restore;
ref(null);
let masonryInstance = null;
const route = useRoute();
let keyword = ref("");
keyword.value = route.query["keyword"];
watchEffect(() => {
if (keyword.value != route.query["keyword"]) {
list.value = [];
page.value = 1;
keyword.value = route.query["keyword"];
getList(route.query["keyword"]);
}
});
const handleScroll = () => {
const scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
const scrollHeight = document.documentElement.scrollHeight;
const clientHeight = document.documentElement.clientHeight;
if (scrollTop + clientHeight >= scrollHeight - 40)
getList();
};
let page = ref(1);
let count = ref(0);
let list = ref([]);
let loading = false;
const getList = () => {
if (page.value == 0 || loading)
return;
loading = true;
getListHttp({ page: page.value, keyword: keyword.value }).then((res) => {
if (res.code != 200) {
page.value = 0;
ElMessage({
message: res.message,
type: "error"
});
return;
}
let data = res.data;
list.value = list.value.concat(data.data || []);
if (data.count > list.value.length)
page.value++;
else
page.value = 0;
count.value = data["count"];
nextTick(() => {
masonryInstance.reloadItems();
masonryInstance.layout();
});
}).finally(() => loading = false);
};
getList();
const handleLike = (token) => {
operateLikeHttp({ token }).then((res) => {
if (res.code != 200)
return;
let data = res.data;
list.value.forEach((element) => {
console.log(element, "element");
if (element["token"] == token) {
element["islike"] = data["status"];
element["likenum"] = data["count"];
}
});
ElMessage({
message: res.message,
type: "success"
});
});
};
onUnmounted(() => {
window.removeEventListener("scroll", handleScroll);
});
useRouter();
try {
if (true) {
[__temp, __restore] = withAsyncContext(() => getListHttp({ page: 1, keyword: keyword.value }).then((res) => {
if (res.code != 200) {
page.value = 0;
ElMessage({
message: res.message,
type: "error"
});
return;
}
let data = res.data;
list.value = list.value.concat(data.data || []);
})), await __temp, __restore();
}
} catch (error) {
}
return (_ctx, _push, _parent, _attrs) => {
const _component_Head = Head;
const _component_Title = Title;
const _component_Header = __nuxt_component_2;
const _component_empty = __nuxt_component_3;
const _component_Item = __nuxt_component_4;
_push(``);
_push(ssrRenderComponent(_component_Head, null, {
default: withCtx((_, _push2, _parent2, _scopeId) => {
if (_push2) {
_push2(ssrRenderComponent(_component_Title, null, {
default: withCtx((_2, _push3, _parent3, _scopeId2) => {
if (_push3) {
_push3(`\u5BC4\u6258\u9762\u7ECF`);
} else {
return [
createTextVNode("\u5BC4\u6258\u9762\u7ECF")
];
}
}),
_: 1
}, _parent2, _scopeId));
} else {
return [
createVNode(_component_Title, null, {
default: withCtx(() => [
createTextVNode("\u5BC4\u6258\u9762\u7ECF")
]),
_: 1
})
];
}
}),
_: 1
}, _parent));
_push(ssrRenderComponent(_component_Header, null, null, _parent));
if (unref(keyword)) {
_push(`
${ssrInterpolate(unref(keyword))}
\u5171 ${ssrInterpolate(unref(count))} \u6761\u641C\u7D22\u6570\u636E
`);
} else {
_push(``);
}
_push(``);
if (unref(list).length == 0 && unref(page) == 0) {
_push(`
`);
_push(ssrRenderComponent(_component_empty, { hint: "\u6CA1\u6709\u627E\u5230\u76F8\u5173\u7ED3\u679C\uFF0C\u8BF7\u66F4\u6362\u641C\u7D22\u5173\u952E\u8BCD" }, null, _parent));
_push(`
`);
} else {
_push(``);
ssrRenderList(unref(list), (item, index2) => {
_push(ssrRenderComponent(_component_Item, {
key: index2,
item,
onHandleLike: handleLike
}, null, _parent));
});
_push(``);
}
_push(`
`);
if (unref(page) == 0 && unref(list).length > 0) {
_push(`- \u5230\u5E95\u4E86 -
`);
} else {
_push(``);
}
_push(``);
};
}
};
const _sfc_setup = _sfc_main.setup;
_sfc_main.setup = (props, ctx) => {
const ssrContext = useSSRContext();
(ssrContext.modules || (ssrContext.modules = /* @__PURE__ */ new Set())).add("pages/index.html/index.vue");
return _sfc_setup ? _sfc_setup(props, ctx) : void 0;
};
const index = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-8afe84d1"]]);
export { index as default };
//# sourceMappingURL=index-408a84e4.mjs.map