推荐阅读

This commit is contained in:
A1300399510
2023-12-20 12:00:24 +08:00
parent 30bd877e5b
commit 033c26d9ec
19 changed files with 298 additions and 165 deletions

View File

@@ -159,7 +159,7 @@ const client_manifest = {
"prefetch": true,
"preload": true,
"css": [],
"file": "error-404.2a39260c.js",
"file": "error-404.d814563b.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js"
],
@@ -185,7 +185,7 @@ const client_manifest = {
"prefetch": true,
"preload": true,
"css": [],
"file": "error-500.6c3f3d2a.js",
"file": "error-500.0d9fdced.js",
"imports": [
"node_modules/nuxt/dist/app/entry.js"
],
@@ -202,7 +202,7 @@ const client_manifest = {
"resourceType": "style",
"prefetch": true,
"preload": true,
"file": "entry.ed8eded5.css",
"file": "entry.331577b9.css",
"src": "node_modules/nuxt/dist/app/entry.css"
},
"node_modules/nuxt/dist/app/entry.js": {
@@ -234,19 +234,19 @@ const client_manifest = {
"triangle-icon.c39ff2e7.svg"
],
"css": [
"entry.ed8eded5.css"
"entry.331577b9.css"
],
"dynamicImports": [
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue",
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue"
],
"file": "entry.1dcf35e7.js",
"file": "entry.0819827f.js",
"isEntry": true,
"src": "node_modules/nuxt/dist/app/entry.js",
"_globalCSS": true
},
"entry.ed8eded5.css": {
"file": "entry.ed8eded5.css",
"entry.331577b9.css": {
"file": "entry.331577b9.css",
"resourceType": "style",
"prefetch": true,
"preload": true

View File

@@ -1,4 +1,4 @@
import { version, ref, watchEffect, watch, getCurrentInstance, defineComponent, hasInjectionContext, unref, inject, useSSRContext, createApp, effectScope, reactive, onUnmounted, toRef, isRef, nextTick, defineAsyncComponent, provide, onErrorCaptured, onServerPrefetch, createVNode, resolveDynamicComponent, h, isReadonly, isShallow, isReactive, toRaw, withCtx, createTextVNode, toDisplayString, mergeProps } from 'vue';
import { version, ref, watchEffect, watch, getCurrentInstance, defineComponent, hasInjectionContext, unref, inject, useSSRContext, createApp, effectScope, reactive, onUnmounted, nextTick, toRef, isRef, defineAsyncComponent, provide, onErrorCaptured, onServerPrefetch, createVNode, resolveDynamicComponent, h, isReadonly, isShallow, isReactive, toRaw, withCtx, createTextVNode, toDisplayString, mergeProps } from 'vue';
import { d as useRuntimeConfig$1, $ as $fetch, w as withQuery, l as hasProtocol, p as parseURL, m as isScriptProtocol, j as joinURL, h as createError$1, n as sanitizeStatusCode, o as createHooks, q as isEqual, r as stringifyParsedURL, t as stringifyQuery, v as parseQuery } from '../nitro/node-server.mjs';
import { getActiveHead } from 'unhead';
import { defineHeadPlugin, composableNames } from '@unhead/shared';
@@ -1223,6 +1223,7 @@ const _sfc_main$2 = {
let keyword = ref("");
let keywordText = ref("");
let list = ref([]);
let backupsList = [];
let page = 1;
let total = ref(0);
let loading = ref(false);
@@ -1244,6 +1245,7 @@ const _sfc_main$2 = {
return;
let data = res.data;
list.value = list.value.concat(data.data || []);
backupsList = backupsList.concat(data.data || []);
total.value = data.count || 0;
keywordText.value = keyword.value || "";
if (list.value.length >= data["count"])
@@ -1262,6 +1264,8 @@ const _sfc_main$2 = {
isSearchMode.value = true;
else
isSearchMode.value = false;
if (type.value == "details")
handleInsertRelatedlist();
}).finally(() => loading.value = false);
};
let typeList = ref([]);
@@ -1313,6 +1317,7 @@ const _sfc_main$2 = {
anonymous: 0
};
nextTick(() => detailsAreaScrollTop());
handleInsertRelatedlist(uniqid);
}).finally(() => detailLoading.value = false);
};
const detailsAreaScrollTop = () => {
@@ -1339,14 +1344,17 @@ const _sfc_main$2 = {
let content = "";
if (info["content"].indexOf("<img") == -1)
content = info["content"];
list.value.unshift({
const obj = {
answers: info["answers"],
content,
publicationdate: info["publicationdate"],
title: info["title"],
typename: info["typename"],
uniqid
});
};
list.value.unshift(obj);
if (!myModelState.value)
backupsList.unshift(obj);
cut(0);
}
};
@@ -1383,9 +1391,7 @@ const _sfc_main$2 = {
goLogin();
return;
}
$ajax("/api/operate/like", {
token
}).then((res) => {
$ajax("/api/operate/like", { token }).then((res) => {
if (res.code != 200)
return;
let data = res.data;
@@ -1971,7 +1977,7 @@ const _sfc_main$2 = {
let listHeight = ref(0);
let itemHeightLeft = 0;
let itemHeightRight = 0;
const itemStyle = (index, content) => {
const itemStyle = (index, content, typetype) => {
if (index == 0) {
itemHeightLeft = 0;
itemHeightRight = 0;
@@ -1990,8 +1996,13 @@ const _sfc_main$2 = {
}
} else {
obj["top"] = itemHeightLeft + "px";
itemHeightLeft += content == "" ? 107 : 136;
obj["height"] = content == "" ? "107px" : "136px";
if (!typetype) {
itemHeightLeft += content == "" ? 107 : 136;
obj["height"] = content == "" ? "107px" : "136px";
} else {
itemHeightLeft += typetype == "vote" ? 170 : 136;
obj["height"] = typetype == "vote" ? "170px" : "136px";
}
obj["left"] = 0;
obj["width"] = "100%";
obj["paddingLeft"] = "calc((100vw - 1200px) / 2)";
@@ -2088,10 +2099,11 @@ const _sfc_main$2 = {
openBottom();
pitchIndex.value = null;
seo.value = {};
list.value = JSON.parse(JSON.stringify(backupsList));
};
const handleListScroll = (e) => {
const el = e.target;
if (el.scrollHeight - el.scrollTop >= el.clientHeight + 40)
if (el.scrollHeight - el.scrollTop >= el.clientHeight + 40 || myModelState.value)
return;
getList();
};
@@ -2208,10 +2220,14 @@ const _sfc_main$2 = {
total: total.value,
keywordText: keywordText.value,
isSearchMode: isSearchMode.value,
inTheEndState: inTheEndState.value,
type: type.value,
pitchIndex: pitchIndex.value,
listlist: JSON.parse(JSON.stringify(list.value))
};
isSearchMode.value = false;
inTheEndState.value = false;
keyword.value = "";
list.value = JSON.parse(JSON.stringify(myModelList.value));
myModelState.value = true;
pitchIndex.value = null;
@@ -2221,15 +2237,20 @@ const _sfc_main$2 = {
};
const closeMyModel = () => {
myModelList.value = JSON.parse(JSON.stringify(list.value));
console.log(temporaryData.listlist, "listlist");
isSearchMode.value = temporaryData["isSearchMode"];
keywordText.value = temporaryData["keywordText"];
keyword.value = temporaryData["keywordText"];
total.value = temporaryData["total"];
type.value = temporaryData["type"];
pitchIndex.value = temporaryData["pitchIndex"];
inTheEndState.value = temporaryData["inTheEndState"];
list.value = JSON.parse(JSON.stringify(temporaryData.listlist));
myModelState.value = false;
let uniqid = list.value[pitchIndex.value]["uniqid"];
getDetails(uniqid);
if (pitchIndex.value) {
let uniqid = list.value[pitchIndex.value]["uniqid"];
getDetails(uniqid);
}
};
const handleDetailsScroll = (e) => {
const el = e.target;
@@ -2259,6 +2280,7 @@ const _sfc_main$2 = {
openBottom();
pitchIndex.value = null;
getList();
listHeight.value = 0;
};
const handleMenuState = (index, ind, i) => {
if (isNeedLogin.value) {
@@ -2337,6 +2359,7 @@ const _sfc_main$2 = {
return;
let data = res.data;
list.value = list.value.concat(data.data || []);
backupsList = backupsList.concat(data.data || []);
total.value = data.count || 0;
keywordText.value = keyword.value || "";
if (list.value.length != data["count"])
@@ -2444,7 +2467,65 @@ const _sfc_main$2 = {
else
setTimeout(() => openBottom(), 1e3);
};
let recommendList = [];
let recommendPage = 1;
const getRecommend = (uniqid) => {
$ajaxGET("/api/details/relatedlist", { page: recommendPage, limit: 20 }).then((res) => {
if (res.code != 200)
return;
let obj = {
offer: "Offer",
mj: "面经",
vote: "投票",
thread: "帖子"
};
let data = res.data;
data.forEach((element) => {
element["typename"] = obj[element["type"]];
element["isrecom"] = true;
});
recommendList = recommendList.concat(data);
recommendPage++;
handleInsertRelatedlist(uniqid);
});
};
const handleInsertRelatedlist = (uniqid) => {
console.log(myModelState.value, "myModelState");
if (myModelState.value)
return;
let insertCount = Math.ceil(backupsList.length / 5);
if (recommendList.length < insertCount) {
getRecommend(uniqid);
return;
}
let target = JSON.parse(JSON.stringify(backupsList));
let result = [];
let j = 0;
for (let i = 0; i < target.length; i++) {
result.push(target[i]);
if ((i + 1) % 4 === 0 && j < recommendList.length) {
result.push(recommendList[j]);
j++;
}
}
list.value = JSON.parse(JSON.stringify(result));
nextTick(() => {
if (uniqid) {
result.forEach((element, index) => {
if (element["uniqid"] == uniqid) {
pitchIndex.value = index;
}
});
}
});
};
const replaceNumberObj = {
0: "①",
1: "②",
2: "③"
};
return {
replaceNumberObj,
closeMyModel,
myModelList,
myModelState,
@@ -2657,38 +2738,76 @@ function _sfc_ssrRender(_ctx, _push, _parent, _attrs, $props, $setup, $data, $op
}
_push(`</div><div class="list" id="list" style="${ssrRenderStyle([$setup.listStyle(), { height: $setup.listHeight + "px" }])}"><!--[-->`);
ssrRenderList($setup.list, (item, index) => {
_push(`<a style="${ssrRenderStyle($setup.itemStyle(index, item["content"]))}" class="${ssrRenderClass([{ pitch: index === $setup.pitchIndex, upLevel: index === $setup.pitchIndex - 1 }, "item grid-item flexflex"])}"${ssrRenderAttr("href", $setup.setItemUrl(item["uniqid"]))}><img class="dot"${ssrRenderAttr("src", _imports_5)}><div class="content" style="${ssrRenderStyle({ width: $setup.type == "list" ? "531px" : "430px" })}"><div class="issue-title flexcenter">`);
if (item["ishot"] == 1) {
_push(`<img class="hot-icon"${ssrRenderAttr("src", _imports_6)}>`);
_push(`<!--[-->`);
if (item["isrecom"]) {
_push(`<a style="${ssrRenderStyle($setup.itemStyle(index, item["content"], item["type"]))}" class="${ssrRenderClass([{ pitch: index === $setup.pitchIndex, upLevel: index === $setup.pitchIndex - 1 }, "item grid-item flexflex"])}" target="_blank"${ssrRenderAttr("href", item["url"])}><img class="dot"${ssrRenderAttr("src", _imports_5)}><div class="content" style="${ssrRenderStyle({ width: $setup.type == "list" ? "531px" : "430px" })}"><div class="issue-title flexcenter"><div class="recommend flexcenter">推荐阅读</div><div class="issue ellipsis flex1">${item["title"]}</div></div>`);
if (item["type"] == "thread") {
_push(`<!--[-->`);
if (item["message"]) {
_push(`<div class="answer ellipsis">${item["message"]}</div>`);
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
} else if (item["type"] == "vote") {
_push(`<div class="answer" style="${ssrRenderStyle({ "height": "auto" })}"><!--[-->`);
ssrRenderList(item["option"].slice(0, 2), (ite, i) => {
_push(`<div>${ssrInterpolate($setup.replaceNumberObj[i] + ite)}</div>`);
});
_push(`<!--]--><div>${ssrInterpolate($setup.replaceNumberObj[2])} …</div></div>`);
} else {
_push(`<div class="answer ellipsis flexacenter">`);
if (item["profession"] || item["professional"]) {
_push(`<div class="value-value">${ssrInterpolate(item["profession"] || item["professional"])}</div>`);
} else {
_push(`<!---->`);
}
if (item["project"] || item["degree"]) {
_push(`<div class="value-value">${ssrInterpolate(item["project"] || item["degree"])}</div>`);
} else {
_push(`<!---->`);
}
if (item["interviewtime"] || item["semester"]) {
_push(`<div class="value-value">${ssrInterpolate(item["interviewtime"] || item["semester"])}</div>`);
} else {
_push(`<!---->`);
}
if (item["apply_results"]) {
_push(`<div class="value-value">${ssrInterpolate(item["apply_results"])}</div>`);
} else {
_push(`<!---->`);
}
_push(`</div>`);
}
_push(`<div class="bottom flexacenter"><div class="typename flexcenter">${ssrInterpolate(item["typename"])}</div></div></div></a>`);
} else {
_push(`<!---->`);
}
{
_push(`<!---->`);
}
_push(`<div class="issue ellipsis flex1">${item["title"]}</div></div>`);
{
_push(`<!--[-->`);
_push(`<a style="${ssrRenderStyle($setup.itemStyle(index, item["content"]))}" class="${ssrRenderClass([[{ pitch: index === $setup.pitchIndex, upLevel: index === $setup.pitchIndex - 1 }, `item${index}`], "item grid-item flexflex"])}"${ssrRenderAttr("href", $setup.setItemUrl(item["uniqid"]))}><img class="dot"${ssrRenderAttr("src", _imports_5)}><div class="content" style="${ssrRenderStyle({ width: $setup.type == "list" ? "531px" : "430px" })}"><div class="issue-title flexcenter">`);
if (item["ishot"] == 1) {
_push(`<img class="hot-icon"${ssrRenderAttr("src", _imports_6)}>`);
} else {
_push(`<!---->`);
}
_push(`<div class="issue ellipsis flex1">${item["title"]}</div></div>`);
if (item["content"]) {
_push(`<div class="answer ellipsis">${item["content"]}</div>`);
} else {
_push(`<!---->`);
}
_push(`<!--]-->`);
_push(`<div class="bottom flexacenter">`);
if (item["typename"]) {
_push(`<div class="typename flexcenter">${ssrInterpolate(item["typename"])}</div>`);
} else {
_push(`<div></div>`);
}
_push(`<div class="flexacenter"><div class="quantity">${ssrInterpolate(item["answers"] == 0 ? "暂无回答" : "共" + item["answers"] + "个回答")}</div>`);
if ($setup.type == "list") {
_push(`<!--[--><div class="longString"></div><div class="answer-btn">我来回答</div><!--]-->`);
} else {
_push(`<!---->`);
}
_push(`</div></div></div></a>`);
}
_push(`<div class="bottom flexacenter">`);
if (item["typename"]) {
_push(`<div class="typename flexcenter">${ssrInterpolate(item["typename"])}</div>`);
} else {
_push(`<div></div>`);
}
_push(`<div class="flexacenter"><div class="quantity">${ssrInterpolate(item["answers"] == 0 ? "暂无回答" : "共" + item["answers"] + "个回答")}</div>`);
if ($setup.type == "list") {
_push(`<!--[--><div class="longString"></div><div class="answer-btn">我来回答</div><!--]-->`);
} else {
_push(`<!---->`);
}
_push(`</div></div></div></a>`);
_push(`<!--]-->`);
});
_push(`<!--]--></div>`);
if ($setup.inTheEndState) {

File diff suppressed because one or more lines are too long

View File

@@ -1 +0,0 @@
{"version":3,"file":"entry-styles.a457ca3a.mjs","sources":["../../../../../.nuxt/dist/server/static/entry-styles-1.mjs-6ea54b9b.js","../../../../../.nuxt/dist/server/static/entry-styles.a457ca3a.mjs"],"sourcesContent":null,"names":["__buildAssetsURL","style_0"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAA,mCAAA,GAAA,+mMAAA,GAAAA,cAAA,CAAA,4BAAA,CAAA,GAAA,8qsCAAA;;ACCA,6BAAe,CAACC,mCAAO;;;;"}

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1 @@
{"version":3,"file":"entry-styles.e4c2d820.mjs","sources":["../../../../../.nuxt/dist/server/static/entry-styles-1.mjs-3d9a0929.js","../../../../../.nuxt/dist/server/static/entry-styles.e4c2d820.mjs"],"sourcesContent":null,"names":["__buildAssetsURL","style_0"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAA,mCAAA,GAAA,+mMAAA,GAAAA,cAAA,CAAA,4BAAA,CAAA,GAAA,y+sCAAA;;ACCA,6BAAe,CAACC,mCAAO;;;;"}

View File

@@ -1,8 +1,8 @@
const interopDefault = r => r.default || r || [];
const styles = {
"node_modules/nuxt/dist/app/entry.js": () => import('./static/entry-styles.a457ca3a.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue": () => import('./static/error-404-styles.1e0dde27.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue": () => import('./static/error-500-styles.cf4b3e80.mjs').then(interopDefault)
"node_modules/nuxt/dist/app/entry.js": () => import('./static/entry-styles.e4c2d820.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue": () => import('./static/error-500-styles.cf4b3e80.mjs').then(interopDefault),
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue": () => import('./static/error-404-styles.1e0dde27.mjs').then(interopDefault)
};
export { styles as default };