import { b as buildAssetsURL } from '../../handlers/renderer.mjs';
import { k as getListHttp, o as operateLikeHttp, H as Head, T as Title, M as Meta } from './cross-icon-3bfafba6.mjs';
import { h as handleDate, E as ElMessage, _ as __nuxt_component_3, a as __nuxt_component_4 } from './top-head-074f9e09.mjs';
import { useSSRContext, mergeProps, unref, inject, ref, watchEffect, nextTick, onUnmounted, withAsyncContext, withCtx, createTextVNode, createVNode } from 'vue';
import { ssrRenderAttrs, ssrRenderAttr, ssrInterpolate, ssrRenderComponent, ssrRenderList } from 'vue/server-renderer';
import { _ as _export_sfc, u as useHead } from './_plugin-vue_export-helper-e3874580.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 'lodash-unified';
import '@vue/shared';
import '@vueuse/core';
import 'axios';
import 'qs';
import '@vue/reactivity';
import 'vue-router';

const _imports_0$1 = "" + buildAssetsURL("time-icon.fef65a83.svg");
const _imports_1 = "" + buildAssetsURL("time-white-icon.805d0e12.svg");
const _imports_2 = "" + buildAssetsURL("eye-icon.efcf8c6f.svg");
const _imports_3 = "" + buildAssetsURL("like-no.23054eaf.svg");
const _imports_4 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAQKADAAQAAAABAAAAQAAAAABGUUKwAAAD30lEQVR4AeVa7XXaMBSVDANkBDxB6QRxJmg6QVmANp2gZAOaDBCYoGwQugGZAGUD+F9Q7zPIxxAZy7ZkG0vn5Ejoy/fe954+7HDWgrRbf/8FGPeMySFyIRmf9MOneR3QeB0PufQMkJ+AOAlwlvgqYMEdD6ebswarPwOrs5WaT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GstkvJ8gPyryzEQAGkQnJnwxvaMFJGeS+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 }) {
    const formatNumberWithCommas = (number) => {
      return number.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
    };
    return (_ctx, _push, _parent, _attrs) => {
      _push(`<a${ssrRenderAttrs(mergeProps({
        class: "box flexflex",
        target: "_blank",
        href: `./details/${__props.item["uniqid"]}`
      }, _attrs))} data-v-7a203ec0><img class="img"${ssrRenderAttr("src", __props.item["schoolimage"])} data-v-7a203ec0><div class="content flexflex" data-v-7a203ec0><div class="name" data-v-7a203ec0>${ssrInterpolate(__props.item["school"])}</div><div class="list flexflex" data-v-7a203ec0>`);
      if (__props.item["profession"]) {
        _push(`<div class="item flexacenter" data-v-7a203ec0><div class="item-name" data-v-7a203ec0>\u4E13\u4E1A</div><div class="item-value ellipsis" data-v-7a203ec0>${ssrInterpolate(__props.item["profession"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      if (__props.item["project"]) {
        _push(`<div class="item flexacenter" data-v-7a203ec0><div class="item-name" data-v-7a203ec0>\u9879\u76EE</div><div class="item-value ellipsis" data-v-7a203ec0>${ssrInterpolate(__props.item["project"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      if (__props.item["interviewtime"]) {
        _push(`<div class="item flexacenter" data-v-7a203ec0><div class="item-name" data-v-7a203ec0>\u65F6\u95F4</div><div class="item-value ellipsis" data-v-7a203ec0>${ssrInterpolate(__props.item["interviewtime"])}</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`</div><div class="text-box" data-v-7a203ec0><div class="text" data-v-7a203ec0>${ssrInterpolate(__props.item["message"])}</div><div class="time flexacenter" data-v-7a203ec0><img class="time-icon time-black-icon"${ssrRenderAttr("src", _imports_0$1)} data-v-7a203ec0><img class="time-icon time-white-icon"${ssrRenderAttr("src", _imports_1)} data-v-7a203ec0> ${ssrInterpolate(("handleDate" in _ctx ? _ctx.handleDate : unref(handleDate))(__props.item["releasetime"]))}\u53D1\u5E03 </div></div><div class="data-list flexacenter" data-v-7a203ec0><div class="data-item flexacenter" data-v-7a203ec0><img class="data-item-icon"${ssrRenderAttr("src", _imports_2)} data-v-7a203ec0> ${ssrInterpolate(formatNumberWithCommas(__props.item["views"] || 0))}</div><div class="data-item flexacenter" data-v-7a203ec0>`);
      if (__props.item["islike"] == 0) {
        _push(`<img class="data-item-icon"${ssrRenderAttr("src", _imports_3)} data-v-7a203ec0>`);
      } else {
        _push(`<img class="data-item-icon"${ssrRenderAttr("src", _imports_4)} data-v-7a203ec0>`);
      }
      _push(` ${ssrInterpolate(__props.item["likenum"] || 0)}</div><div class="data-item flexacenter" data-v-7a203ec0><img class="data-item-icon"${ssrRenderAttr("src", _imports_5)} data-v-7a203ec0> ${ssrInterpolate(__props.item["commentnum"] || 0)}</div></div></div></a>`);
    };
  }
};
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_5 = /* @__PURE__ */ _export_sfc(_sfc_main$1, [["__scopeId", "data-v-7a203ec0"]]);
const _imports_0 = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAAIKADAAQAAAABAAAAIAAAAACshmLzAAAED0lEQVRYCe2Wu09UQRTGdwlYWWMAIzEhWhCJhRgVAbHzAWil1sT/gK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ibECr2QLZ06CgnFKody0b9xPA+RkbaLALugT7AGvDbp5SRY1tFEonIY8F7UKVY56L/QG6mjn5mhkRrwjapatk7VWiocUq+4KSkK6KPvl6lzBc+xUhWcfZR+0+TZ4rISUGJIFEJiBLVeY9f0l6rPbf2xBA8KE5Qw1iOje36Wbm1c2x63cnPYk4A58QjVouvqVRm2l4TMAsQfZRZcXExOBCzQVXQjyWuYpAhpf+Gr6Pqnm2U3Jvx7brH/ZbYd+APZxM/2zgvhdQAAAABJRU5ErkJggg==";
const _sfc_main = {
  __name: "index",
  __ssrInlineRender: true,
  async setup(__props) {
    let __temp, __restore;
    let isNeedLogin = inject("isNeedLogin");
    const goLogin = inject("goLogin");
    useHead({ script: [{ src: "https://app.gter.net/bottom?tpl=header&menukey=mj" }, { src: "https://app.gter.net/bottom?tpl=footer", body: true }] });
    ref(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(() => {
        });
      }).finally(() => loading = false);
    };
    const handleLike = (token) => {
      if (isNeedLogin.value) {
        goLogin();
        return;
      }
      operateLikeHttp({ token }).then((res) => {
        if (res.code != 200)
          return;
        let data = res.data;
        list.value.forEach((element) => {
          if (element["token"] == token) {
            element["islike"] = data["status"];
            element["likenum"] = data["count"];
          }
        });
        ElMessage.success(res.message);
      });
    };
    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_Meta = Meta;
      const _component_TopHead = __nuxt_component_3;
      const _component_empty = __nuxt_component_4;
      const _component_Item = __nuxt_component_5;
      _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\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB`);
                } else {
                  return [
                    createTextVNode("\u5BC4\u6258\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB")
                  ];
                }
              }),
              _: 1
            }, _parent2, _scopeId));
            _push2(ssrRenderComponent(_component_Meta, {
              name: "keyword",
              content: "\u7559\u5B66\u8D44\u8BAF\uFF0C\u7559\u5B66\u4EA4\u6D41\u8BBA\u575B\uFF0C\u7559\u5B66\u9762\u7ECF\uFF0C\u9762\u8BD5\u7ECF\u9A8C\uFF0C\u5BC4\u6258\u5929\u4E0B"
            }, null, _parent2, _scopeId));
          } else {
            return [
              createVNode(_component_Title, null, {
                default: withCtx(() => [
                  createTextVNode("\u5BC4\u6258\u5929\u4E0B - \u9762\u7ECF\u5206\u4EAB")
                ]),
                _: 1
              }),
              createVNode(_component_Meta, {
                name: "keyword",
                content: "\u7559\u5B66\u8D44\u8BAF\uFF0C\u7559\u5B66\u4EA4\u6D41\u8BBA\u575B\uFF0C\u7559\u5B66\u9762\u7ECF\uFF0C\u9762\u8BD5\u7ECF\u9A8C\uFF0C\u5BC4\u6258\u5929\u4E0B"
              })
            ];
          }
        }),
        _: 1
      }, _parent));
      _push(ssrRenderComponent(_component_TopHead, null, null, _parent));
      if (unref(keyword)) {
        _push(`<div class="search-result flexacenter" data-v-f141c754><div class="keyword flexacenter" data-v-f141c754>${ssrInterpolate(unref(keyword))} <img class="keyword-icon"${ssrRenderAttr("src", _imports_0)} data-v-f141c754></div><div class="halving-line" data-v-f141c754></div><div class="total" data-v-f141c754>\u5171 ${ssrInterpolate(unref(count))} \u6761\u641C\u7D22\u6570\u636E</div></div>`);
      } else {
        _push(`<!---->`);
      }
      _push(`<div class="content" data-v-f141c754>`);
      if (unref(list).length == 0 && unref(page) == 0) {
        _push(`<div class="empty-box flexcenter" data-v-f141c754>`);
        _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(`</div>`);
      } else {
        _push(`<!--[-->`);
        ssrRenderList(unref(list), (item, index2) => {
          _push(ssrRenderComponent(_component_Item, {
            key: index2,
            item,
            onHandleLike: handleLike
          }, null, _parent));
        });
        _push(`<!--]-->`);
      }
      _push(`</div>`);
      if (unref(page) == 0 && unref(list).length > 0) {
        _push(`<div class="in-end" data-v-f141c754>- \u5230\u5E95\u4E86 -</div>`);
      } 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-f141c754"]]);

export { index as default };
//# sourceMappingURL=index-4b305871.mjs.map
