no message
This commit is contained in:
parent
c188fa2334
commit
a982cb6b9c
@ -1,5 +1,5 @@
|
||||
{
|
||||
"date": "2023-12-20T04:10:19.053Z",
|
||||
"date": "2023-12-20T07:14:28.906Z",
|
||||
"preset": "node-server",
|
||||
"framework": {
|
||||
"name": "nuxt",
|
||||
|
@ -1 +1 @@
|
||||
{"id":"cdcec7ce-6382-4a2a-8b1e-49c9669d80e8","timestamp":1703045406527}
|
||||
{"id":"67bcfb3e-21e1-4c75-b4cb-93517b3b88a7","timestamp":1703056458524}
|
@ -0,0 +1 @@
|
||||
{"id":"67bcfb3e-21e1-4c75-b4cb-93517b3b88a7","timestamp":1703056458524,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
@ -1 +0,0 @@
|
||||
{"id":"cdcec7ce-6382-4a2a-8b1e-49c9669d80e8","timestamp":1703045406527,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
@ -1 +0,0 @@
|
||||
{"id":"dev","timestamp":1703045406930,"matcher":{"static":{},"wildcard":{},"dynamic":{}},"prerendered":[]}
|
7
.output/public/static/entry.6de421df.js
Normal file
7
.output/public/static/entry.6de421df.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -1 +1 @@
|
||||
import{_ as i,t as a,v as r,x as n,y as e,z as s,D as l,E as d}from"./entry.ea24b46f.js";const c=t=>(l("data-v-df79c84d"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},f=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(u,b)=>(r(),n("div",p,[f,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},w=i(x,[["__scopeId","data-v-df79c84d"]]);export{w as default};
|
||||
import{_ as i,t as a,v as r,x as n,y as e,z as s,D as l,E as d}from"./entry.6de421df.js";const c=t=>(l("data-v-df79c84d"),t=t(),d(),t),p={class:"font-sans antialiased bg-white dark:bg-black text-black dark:text-white grid min-h-screen place-content-center overflow-hidden"},f=c(()=>e("div",{class:"fixed -bottom-1/2 left-0 right-0 h-1/2 spotlight"},null,-1)),h={class:"max-w-520px text-center"},g=["textContent"],m=["textContent"],x={__name:"error-500",props:{appName:{type:String,default:"Nuxt"},version:{type:String,default:""},statusCode:{type:Number,default:500},statusMessage:{type:String,default:"Server error"},description:{type:String,default:"This page is temporarily unavailable."}},setup(t){const o=t;return a({title:`${o.statusCode} - ${o.statusMessage} | ${o.appName}`,script:[],style:[{children:'*,:before,:after{-webkit-box-sizing:border-box;box-sizing:border-box;border-width:0;border-style:solid;border-color:#e0e0e0}*{--tw-ring-inset:var(--tw-empty, );--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:rgba(14, 165, 233, .5);--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000}:root{-moz-tab-size:4;-o-tab-size:4;tab-size:4}body{margin:0;font-family:inherit;line-height:inherit}html{-webkit-text-size-adjust:100%;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";line-height:1.5}h1,p{margin:0}h1{font-size:inherit;font-weight:inherit}'}]}),(u,b)=>(r(),n("div",p,[f,e("div",h,[e("h1",{class:"text-8xl sm:text-10xl font-medium mb-8",textContent:s(t.statusCode)},null,8,g),e("p",{class:"text-xl px-8 sm:px-0 sm:text-4xl font-light mb-16 leading-tight",textContent:s(t.description)},null,8,m)])]))}},w=i(x,[["__scopeId","data-v-df79c84d"]]);export{w as default};
|
@ -159,7 +159,7 @@ const client_manifest = {
|
||||
"prefetch": true,
|
||||
"preload": true,
|
||||
"css": [],
|
||||
"file": "error-404.3a5b1949.js",
|
||||
"file": "error-404.232c554a.js",
|
||||
"imports": [
|
||||
"node_modules/nuxt/dist/app/entry.js"
|
||||
],
|
||||
@ -185,7 +185,7 @@ const client_manifest = {
|
||||
"prefetch": true,
|
||||
"preload": true,
|
||||
"css": [],
|
||||
"file": "error-500.ce86dcb4.js",
|
||||
"file": "error-500.e5de71fc.js",
|
||||
"imports": [
|
||||
"node_modules/nuxt/dist/app/entry.js"
|
||||
],
|
||||
@ -240,7 +240,7 @@ const client_manifest = {
|
||||
"node_modules/@nuxt/ui-templates/dist/templates/error-404.vue",
|
||||
"node_modules/@nuxt/ui-templates/dist/templates/error-500.vue"
|
||||
],
|
||||
"file": "entry.ea24b46f.js",
|
||||
"file": "entry.6de421df.js",
|
||||
"isEntry": true,
|
||||
"src": "node_modules/nuxt/dist/app/entry.js",
|
||||
"_globalCSS": true
|
||||
|
@ -1143,6 +1143,10 @@ const _sfc_main$2 = {
|
||||
const route = useRoute();
|
||||
let detailsInfoDataVuex = useState("detailsInfoData", () => {
|
||||
});
|
||||
let relatedlistDataVuex = useState("relatedlistData", () => {
|
||||
});
|
||||
let listDataVuex = useState("listData", () => {
|
||||
});
|
||||
const baseURL2 = "https://ask.gter.net";
|
||||
let type = ref("list");
|
||||
let originUrl = ref("");
|
||||
@ -1987,21 +1991,21 @@ const _sfc_main$2 = {
|
||||
if (newtype == "list") {
|
||||
if (itemHeightLeft <= itemHeightRight) {
|
||||
obj["top"] = itemHeightLeft + "px";
|
||||
itemHeightLeft += content == "" ? 107 : 136;
|
||||
itemHeightLeft += content == "" ? 107 : 137;
|
||||
obj["left"] = 0;
|
||||
} else {
|
||||
obj["top"] = itemHeightRight + "px";
|
||||
itemHeightRight += content == "" ? 107 : 136;
|
||||
itemHeightRight += content == "" ? 107 : 137;
|
||||
obj["left"] = "649px";
|
||||
}
|
||||
} else {
|
||||
obj["top"] = itemHeightLeft + "px";
|
||||
if (!typetype) {
|
||||
itemHeightLeft += content == "" ? 107 : 136;
|
||||
obj["height"] = content == "" ? "107px" : "136px";
|
||||
itemHeightLeft += content == "" ? 107 : 137;
|
||||
obj["height"] = content == "" ? "107px" : "137px";
|
||||
} else {
|
||||
itemHeightLeft += typetype == "vote" ? 170 : 136;
|
||||
obj["height"] = typetype == "vote" ? "170px" : "136px";
|
||||
itemHeightLeft += typetype == "vote" ? 170 : 137;
|
||||
obj["height"] = typetype == "vote" ? "170px" : "137px";
|
||||
}
|
||||
obj["left"] = 0;
|
||||
obj["width"] = "100%";
|
||||
@ -2316,6 +2320,62 @@ const _sfc_main$2 = {
|
||||
handleMsg("success", "举报成功");
|
||||
});
|
||||
};
|
||||
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) => {
|
||||
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: "③"
|
||||
};
|
||||
let seo = ref({});
|
||||
try {
|
||||
const params = route.query;
|
||||
@ -2323,61 +2383,103 @@ const _sfc_main$2 = {
|
||||
keyword.value = params["keyword"];
|
||||
if (params["tid"])
|
||||
typePitch.value = params["tid"];
|
||||
if (params["uniqid"]) {
|
||||
if (true) {
|
||||
await axios.post(baseURL2 + "/api/details", { uniqid: params["uniqid"] }).then((response) => {
|
||||
let res = response.data;
|
||||
let data = res.data;
|
||||
detailsInfoDataVuex.value = data;
|
||||
detailsInfo.value = data["info"] || {};
|
||||
detailsIsanswered.value = data["isanswered"] || 0;
|
||||
detailsIscollection.value = data["iscollection"] || 0;
|
||||
detailsIsmyself.value = data["ismyself"] || 0;
|
||||
detailsToken = data["token"] || "";
|
||||
detailShare.value = data["share"] || {};
|
||||
type.value = "details";
|
||||
calculateListIndex(data.info, params["uniqid"]);
|
||||
answerList.value = [];
|
||||
answerPage.value = 1;
|
||||
getAnswerList();
|
||||
closeAllTransmitState();
|
||||
replaceState({ uniqid: params["uniqid"] });
|
||||
seo.value = data.seo;
|
||||
}).catch((error) => {
|
||||
console.error(error);
|
||||
});
|
||||
}
|
||||
if (params["uniqid"] && true) {
|
||||
await axios.post(baseURL2 + "/api/details", { uniqid: params["uniqid"] }).then((response) => {
|
||||
let res = response.data;
|
||||
let data = res.data;
|
||||
detailsInfoDataVuex.value = data;
|
||||
detailsInfo.value = data["info"] || {};
|
||||
detailsIsanswered.value = data["isanswered"] || 0;
|
||||
detailsIscollection.value = data["iscollection"] || 0;
|
||||
detailsIsmyself.value = data["ismyself"] || 0;
|
||||
detailsToken = data["token"] || "";
|
||||
detailShare.value = data["share"] || {};
|
||||
type.value = "details";
|
||||
calculateListIndex(data.info, params["uniqid"]);
|
||||
answerList.value = [];
|
||||
answerPage.value = 1;
|
||||
getAnswerList();
|
||||
closeAllTransmitState();
|
||||
replaceState({ uniqid: params["uniqid"] });
|
||||
seo.value = data.seo;
|
||||
}).catch((error) => console.error(error));
|
||||
}
|
||||
if (true) {
|
||||
await $ajax("/api/lists", {
|
||||
page,
|
||||
limit: 20,
|
||||
keyword: keyword.value,
|
||||
type: typePitch.value
|
||||
}).then((res) => {
|
||||
if (res.code != 200)
|
||||
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"])
|
||||
page++;
|
||||
else
|
||||
page = 0;
|
||||
if (page == 0 && list.value.length != 0)
|
||||
inTheEndState.value = true;
|
||||
else
|
||||
inTheEndState.value = false;
|
||||
if (list.value.length == 0)
|
||||
isListEmptyState.value = true;
|
||||
else
|
||||
isListEmptyState.value = false;
|
||||
if (keyword.value)
|
||||
isSearchMode.value = true;
|
||||
else
|
||||
isSearchMode.value = false;
|
||||
listDataVuex.value = {
|
||||
list: list.value,
|
||||
backupsList,
|
||||
total: total.value,
|
||||
keywordText: keywordText.value,
|
||||
page,
|
||||
inTheEndState: inTheEndState.value,
|
||||
isListEmptyState: isListEmptyState.value,
|
||||
isSearchMode: isSearchMode.value
|
||||
};
|
||||
});
|
||||
await $ajaxGET("/api/details/relatedlist", { page: 1, 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++;
|
||||
relatedlistDataVuex.value = {
|
||||
list: data,
|
||||
page: recommendPage
|
||||
};
|
||||
if (params["uniqid"]) {
|
||||
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));
|
||||
}
|
||||
});
|
||||
}
|
||||
await $ajax("/api/lists", {
|
||||
page,
|
||||
limit: 20,
|
||||
keyword: keyword.value,
|
||||
type: typePitch.value
|
||||
}).then((res) => {
|
||||
if (res.code != 200)
|
||||
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"])
|
||||
page++;
|
||||
else
|
||||
page = 0;
|
||||
if (page == 0 && list.value.length != 0)
|
||||
inTheEndState.value = true;
|
||||
else
|
||||
inTheEndState.value = false;
|
||||
if (list.value.length == 0)
|
||||
isListEmptyState.value = true;
|
||||
else
|
||||
isListEmptyState.value = false;
|
||||
if (keyword.value)
|
||||
isSearchMode.value = true;
|
||||
else
|
||||
isSearchMode.value = false;
|
||||
});
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
}
|
||||
@ -2466,62 +2568,6 @@ 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) => {
|
||||
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,
|
||||
|
@ -1,8 +1,8 @@
|
||||
const interopDefault = r => r.default || r || [];
|
||||
const styles = {
|
||||
"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)
|
||||
"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)
|
||||
};
|
||||
|
||||
export { styles as default };
|
||||
|
@ -3059,7 +3059,7 @@ function klona(x) {
|
||||
|
||||
const inlineAppConfig = {
|
||||
"nuxt": {
|
||||
"buildId": "cdcec7ce-6382-4a2a-8b1e-49c9669d80e8"
|
||||
"buildId": "67bcfb3e-21e1-4c75-b4cb-93517b3b88a7"
|
||||
}
|
||||
};
|
||||
|
||||
@ -4949,212 +4949,205 @@ const assets = {
|
||||
"/static/add-icon.0b0b5313.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"d67-gajxuGcy6aHIeWAbO0RazX03p90\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.183Z",
|
||||
"size": 3431,
|
||||
"path": "../public/static/add-icon.0b0b5313.svg"
|
||||
},
|
||||
"/static/arrows-icon.271dd0d3.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"5a0-yAit7q5lcKJMd35iOMMifZv2uno\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 1440,
|
||||
"path": "../public/static/arrows-icon.271dd0d3.svg"
|
||||
},
|
||||
"/static/close-icon.86743366.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"2d4-QYrulZl33jopLCT37UdJfnzXOVg\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 724,
|
||||
"path": "../public/static/close-icon.86743366.svg"
|
||||
},
|
||||
"/static/collect-icon-colours.6d2ade7f.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"7ab-av9D1DgxgD5cvY5wd30haD7c1q0\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 1963,
|
||||
"path": "../public/static/collect-icon-colours.6d2ade7f.svg"
|
||||
},
|
||||
"/static/comment-icon-gray.2c8779f9.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"816-HEGvNjvS0TeA/3uJweilvZfCqlk\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 2070,
|
||||
"path": "../public/static/comment-icon-gray.2c8779f9.svg"
|
||||
},
|
||||
"/static/delete-icon.4d386dce.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"17fe-RGKa0+MaUqOqlbPlXlig67fGkaY\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 6142,
|
||||
"path": "../public/static/delete-icon.4d386dce.svg"
|
||||
},
|
||||
"/static/dot-gray.86cdd7b5.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"2af-sBMsuPZbsh28jzlFWO9lVYMVDk8\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 687,
|
||||
"path": "../public/static/dot-gray.86cdd7b5.svg"
|
||||
},
|
||||
"/static/dot-yellow.4b5e135b.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"2af-6L7YsWhGTHBB6NqQztB/l2OFRfE\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 687,
|
||||
"path": "../public/static/dot-yellow.4b5e135b.svg"
|
||||
},
|
||||
"/static/dot.1026a040.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"217-dx6xqUT4D9pCoKc6nr20aXeJQXQ\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 535,
|
||||
"path": "../public/static/dot.1026a040.svg"
|
||||
},
|
||||
"/static/edit-icon-white.29b27582.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"8be-EnEF3CQI46JkMNAXbPf3H6T7pzU\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 2238,
|
||||
"path": "../public/static/edit-icon-white.29b27582.svg"
|
||||
},
|
||||
"/static/empty-icon.24a01ae2.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"d028-Our2UxxUiciRSduORd8JZCt5Prw\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 53288,
|
||||
"path": "../public/static/empty-icon.24a01ae2.svg"
|
||||
},
|
||||
"/static/entry.331577b9.css": {
|
||||
"type": "text/css; charset=utf-8",
|
||||
"etag": "\"b137-CiBBmkrj29X3YskD6pYoIg3OTDk\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 45367,
|
||||
"path": "../public/static/entry.331577b9.css"
|
||||
},
|
||||
"/static/entry.ea24b46f.js": {
|
||||
"/static/entry.6de421df.js": {
|
||||
"type": "application/javascript",
|
||||
"etag": "\"3c0d6-GXhhs7DILj9tkDDQB3Mcu5VzsDE\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"size": 245974,
|
||||
"path": "../public/static/entry.ea24b46f.js"
|
||||
"etag": "\"3c0f8-o1TonQDLpc9xoaTa14/ME8E5E2E\"",
|
||||
"mtime": "2023-12-20T07:14:22.188Z",
|
||||
"size": 246008,
|
||||
"path": "../public/static/entry.6de421df.js"
|
||||
},
|
||||
"/static/error-404.3a5b1949.js": {
|
||||
"/static/error-404.232c554a.js": {
|
||||
"type": "application/javascript",
|
||||
"etag": "\"18de-6H1inelb7bwBamgWvm4L+X7zg1w\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"etag": "\"18de-6LuQJ1dTWty8A8UaUTnGER3yHuQ\"",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 6366,
|
||||
"path": "../public/static/error-404.3a5b1949.js"
|
||||
"path": "../public/static/error-404.232c554a.js"
|
||||
},
|
||||
"/static/error-404.7fc72018.css": {
|
||||
"type": "text/css; charset=utf-8",
|
||||
"etag": "\"e2e-iNt1cqPQ0WDudfCTZVQd31BeRGs\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 3630,
|
||||
"path": "../public/static/error-404.7fc72018.css"
|
||||
},
|
||||
"/static/error-500.c5df6088.css": {
|
||||
"type": "text/css; charset=utf-8",
|
||||
"etag": "\"79e-ByRo+49BgcevWdRjJy3CMx2IA5k\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 1950,
|
||||
"path": "../public/static/error-500.c5df6088.css"
|
||||
},
|
||||
"/static/error-500.ce86dcb4.js": {
|
||||
"/static/error-500.e5de71fc.js": {
|
||||
"type": "application/javascript",
|
||||
"etag": "\"756-S1Lj7wHsZRFk6tPRoGWSrotqE4s\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"etag": "\"756-gKKIASppsV1Bt8MQps+in7zcB08\"",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 1878,
|
||||
"path": "../public/static/error-500.ce86dcb4.js"
|
||||
"path": "../public/static/error-500.e5de71fc.js"
|
||||
},
|
||||
"/static/issue-bj.44adad8c.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"926-lK6rrraYIC+9Yxyy0subzOK8XpE\"",
|
||||
"mtime": "2023-12-20T04:10:11.810Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 2342,
|
||||
"path": "../public/static/issue-bj.44adad8c.svg"
|
||||
},
|
||||
"/static/logo.6622f82d.png": {
|
||||
"type": "image/png",
|
||||
"etag": "\"843f-FSXGFGigIHmtzjdcQzuMz/a7E+o\"",
|
||||
"mtime": "2023-12-20T04:10:11.808Z",
|
||||
"mtime": "2023-12-20T07:14:22.185Z",
|
||||
"size": 33855,
|
||||
"path": "../public/static/logo.6622f82d.png"
|
||||
},
|
||||
"/static/menu-icon-gray.d61f02b1.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"6de-kmXhltPHfF4W1gmV7wT4aZCZ6gg\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 1758,
|
||||
"path": "../public/static/menu-icon-gray.d61f02b1.svg"
|
||||
},
|
||||
"/static/QRCode-icon.a105d5fc.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"9c1-qGg9jZ5wmHJGzh2A00nHIGWHMh4\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 2497,
|
||||
"path": "../public/static/QRCode-icon.a105d5fc.svg"
|
||||
},
|
||||
"/static/tick-no.179037b3.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"1ea-YISAWqJD56jxoQT8N812fDJfkMw\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 490,
|
||||
"path": "../public/static/tick-no.179037b3.svg"
|
||||
},
|
||||
"/static/tick-option.e092d22f.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"29a-UVjuq3WHs6mhu1KGQ7gQmJH2Bc4\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 666,
|
||||
"path": "../public/static/tick-option.e092d22f.svg"
|
||||
},
|
||||
"/static/tick-orange.233abc69.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"60a-VrP9K+TQp6JbNcrU5k1Dor/Kq/E\"",
|
||||
"mtime": "2023-12-20T04:10:11.810Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 1546,
|
||||
"path": "../public/static/tick-orange.233abc69.svg"
|
||||
},
|
||||
"/static/title.98892974.png": {
|
||||
"type": "image/png",
|
||||
"etag": "\"1723-0OwkVass/2nFB99dRT4w0sPUvI0\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 5923,
|
||||
"path": "../public/static/title.98892974.png"
|
||||
},
|
||||
"/static/triangle-icon.c39ff2e7.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"446-ylQ81DOJ3joSbsS9atyrW6pZsBY\"",
|
||||
"mtime": "2023-12-20T04:10:11.811Z",
|
||||
"mtime": "2023-12-20T07:14:22.187Z",
|
||||
"size": 1094,
|
||||
"path": "../public/static/triangle-icon.c39ff2e7.svg"
|
||||
},
|
||||
"/static/view-icon.da7fef35.svg": {
|
||||
"type": "image/svg+xml",
|
||||
"etag": "\"f39-5Jwx14wB0jgB0Du25KRZbkEEXvI\"",
|
||||
"mtime": "2023-12-20T04:10:11.809Z",
|
||||
"mtime": "2023-12-20T07:14:22.186Z",
|
||||
"size": 3897,
|
||||
"path": "../public/static/view-icon.da7fef35.svg"
|
||||
},
|
||||
"/static/builds/latest.json": {
|
||||
"type": "application/json",
|
||||
"etag": "\"47-tPaP4F6Gy2zkzzmUqYUEpbbU02Q\"",
|
||||
"mtime": "2023-12-20T04:10:13.395Z",
|
||||
"etag": "\"47-kYeNtvNfiwBsATEv6eUQEtn6OyI\"",
|
||||
"mtime": "2023-12-20T07:14:23.613Z",
|
||||
"size": 71,
|
||||
"path": "../public/static/builds/latest.json"
|
||||
},
|
||||
"/static/builds/meta/cdcec7ce-6382-4a2a-8b1e-49c9669d80e8.json": {
|
||||
"/static/builds/meta/67bcfb3e-21e1-4c75-b4cb-93517b3b88a7.json": {
|
||||
"type": "application/json",
|
||||
"etag": "\"8b-MNEml0Iy4B3QRDZDtS2tLQ2kN2U\"",
|
||||
"mtime": "2023-12-20T04:10:13.395Z",
|
||||
"etag": "\"8b-1b82y3RkoM2YKmnxgn3xRDPC8m0\"",
|
||||
"mtime": "2023-12-20T07:14:23.613Z",
|
||||
"size": 139,
|
||||
"path": "../public/static/builds/meta/cdcec7ce-6382-4a2a-8b1e-49c9669d80e8.json"
|
||||
},
|
||||
"/static/builds/meta/dev.json": {
|
||||
"type": "application/json",
|
||||
"etag": "\"6a-X2YrJeu0nTLDtsAsWPDPkkp0xYA\"",
|
||||
"mtime": "2023-12-20T04:10:10.322Z",
|
||||
"size": 106,
|
||||
"path": "../public/static/builds/meta/dev.json"
|
||||
"path": "../public/static/builds/meta/67bcfb3e-21e1-4c75-b4cb-93517b3b88a7.json"
|
||||
}
|
||||
};
|
||||
|
||||
|
337
app.vue
337
app.vue
@ -813,6 +813,8 @@ export default {
|
||||
const route = useRoute()
|
||||
|
||||
let detailsInfoDataVuex = useState("detailsInfoData", () => {})
|
||||
let relatedlistDataVuex = useState("relatedlistData", () => {})
|
||||
let listDataVuex = useState("listData", () => {})
|
||||
|
||||
const baseURL = "https://ask.gter.net"
|
||||
|
||||
@ -833,10 +835,32 @@ export default {
|
||||
|
||||
listenPageBack()
|
||||
|
||||
if (listDataVuex.value) hanleServerListData()
|
||||
if (detailsInfoDataVuex.value) hanleServerRequestData()
|
||||
if (relatedlistDataVuex.value) hanleServerRelatedlistData()
|
||||
})
|
||||
|
||||
// 处理在服务端已经请求了接口 数据
|
||||
// 列表的
|
||||
const hanleServerListData = () => {
|
||||
list.value = listDataVuex.value["list"]
|
||||
console.log(list.value,"list.value");
|
||||
backupsList = listDataVuex.value["backupsList"]
|
||||
total.value = listDataVuex.value["total"]
|
||||
keywordText.value = listDataVuex.value["keywordText"]
|
||||
page = listDataVuex.value["page"]
|
||||
inTheEndState.value = listDataVuex.value["inTheEndState"]
|
||||
isListEmptyState.value = listDataVuex.value["isListEmptyState"]
|
||||
isSearchMode.value = listDataVuex.value["isSearchMode"]
|
||||
}
|
||||
|
||||
// 处理在服务端已经请求了详情接口的数据
|
||||
const hanleServerRelatedlistData = () => {
|
||||
recommendList = relatedlistDataVuex.value["list"]
|
||||
recommendPage = relatedlistDataVuex.value["page"]
|
||||
handleInsertRelatedlist()
|
||||
}
|
||||
|
||||
// 处理在服务端已经请求了详情接口 数据
|
||||
const hanleServerRequestData = () => {
|
||||
const params = route.query
|
||||
|
||||
@ -863,8 +887,6 @@ export default {
|
||||
|
||||
replaceState({uniqid: params["uniqid"]})
|
||||
seo.value = data.seo
|
||||
|
||||
getRecommend()
|
||||
}
|
||||
|
||||
// 是否是后退 状态
|
||||
@ -1974,24 +1996,22 @@ export default {
|
||||
if (itemHeightLeft <= itemHeightRight) {
|
||||
obj["top"] = itemHeightLeft + "px"
|
||||
|
||||
itemHeightLeft += content == "" ? 107 : 136
|
||||
itemHeightLeft += content == "" ? 107 : 137
|
||||
obj["left"] = 0
|
||||
} else {
|
||||
obj["top"] = itemHeightRight + "px"
|
||||
itemHeightRight += content == "" ? 107 : 136
|
||||
itemHeightRight += content == "" ? 107 : 137
|
||||
obj["left"] = 649 + "px"
|
||||
}
|
||||
} else {
|
||||
obj["top"] = itemHeightLeft + "px"
|
||||
|
||||
if (!typetype) {
|
||||
itemHeightLeft += content == "" ? 107 : 136
|
||||
|
||||
obj["height"] = content == "" ? 107 + "px" : 136 + "px"
|
||||
itemHeightLeft += content == "" ? 107 : 137
|
||||
obj["height"] = content == "" ? 107 + "px" : 137 + "px"
|
||||
} else {
|
||||
itemHeightLeft += typetype == "vote" ? 170 : 136
|
||||
|
||||
obj["height"] = typetype == "vote" ? 170 + "px" : 136 + "px"
|
||||
itemHeightLeft += typetype == "vote" ? 170 : 137
|
||||
obj["height"] = typetype == "vote" ? 170 + "px" : 137 + "px"
|
||||
}
|
||||
|
||||
obj["left"] = 0
|
||||
@ -2402,6 +2422,79 @@ export default {
|
||||
else document.body.style.overflow = "auto"
|
||||
})
|
||||
})
|
||||
|
||||
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 => {
|
||||
if (myModelState.value) return
|
||||
|
||||
// 计算需要插入元素的数量
|
||||
let insertCount = Math.ceil(backupsList.length / 5)
|
||||
// 检查数组B的长度是否足够
|
||||
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
|
||||
scrollLeftInMiddle()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const replaceNumberObj = {
|
||||
0: "①",
|
||||
1: "②",
|
||||
2: "③",
|
||||
}
|
||||
|
||||
let seo = ref({})
|
||||
|
||||
try {
|
||||
@ -2411,41 +2504,36 @@ export default {
|
||||
const params = route.query
|
||||
if (params["keyword"]) keyword.value = params["keyword"]
|
||||
if (params["tid"]) typePitch.value = params["tid"]
|
||||
if (params["uniqid"]) {
|
||||
if (process.server) {
|
||||
// const headers = useRequestHeaders(["cookie"])
|
||||
await axios
|
||||
.post(baseURL + "/api/details", {uniqid: params["uniqid"]})
|
||||
.then(response => {
|
||||
let res = response.data
|
||||
let data = res.data
|
||||
if (params["uniqid"] && process.server) {
|
||||
await axios
|
||||
.post(baseURL + "/api/details", {uniqid: params["uniqid"]})
|
||||
.then(response => {
|
||||
let res = response.data
|
||||
let data = res.data
|
||||
|
||||
detailsInfoDataVuex.value = data
|
||||
detailsInfoDataVuex.value = data
|
||||
|
||||
detailsInfo.value = data["info"] || {}
|
||||
detailsIsanswered.value = data["isanswered"] || 0
|
||||
detailsIscollection.value = data["iscollection"] || 0
|
||||
detailsIsmyself.value = data["ismyself"] || 0
|
||||
detailsToken = data["token"] || ""
|
||||
detailShare.value = data["share"] || {}
|
||||
detailsInfo.value = data["info"] || {}
|
||||
detailsIsanswered.value = data["isanswered"] || 0
|
||||
detailsIscollection.value = data["iscollection"] || 0
|
||||
detailsIsmyself.value = data["ismyself"] || 0
|
||||
detailsToken = data["token"] || ""
|
||||
detailShare.value = data["share"] || {}
|
||||
|
||||
type.value = "details"
|
||||
type.value = "details"
|
||||
|
||||
calculateListIndex(data.info, params["uniqid"])
|
||||
calculateListIndex(data.info, params["uniqid"])
|
||||
|
||||
answerList.value = []
|
||||
answerPage.value = 1
|
||||
getAnswerList()
|
||||
answerList.value = []
|
||||
answerPage.value = 1
|
||||
getAnswerList()
|
||||
|
||||
closeAllTransmitState()
|
||||
closeAllTransmitState()
|
||||
|
||||
replaceState({uniqid: params["uniqid"]})
|
||||
seo.value = data.seo
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(error)
|
||||
})
|
||||
}
|
||||
replaceState({uniqid: params["uniqid"]})
|
||||
seo.value = data.seo
|
||||
})
|
||||
.catch(error => console.error(error))
|
||||
|
||||
// if (process.server) {
|
||||
// await $ajax("/api/details", {uniqid: params["uniqid"]})
|
||||
@ -2479,34 +2567,91 @@ export default {
|
||||
// }
|
||||
}
|
||||
|
||||
await $ajax("/api/lists", {
|
||||
page,
|
||||
limit: 20,
|
||||
keyword: keyword.value,
|
||||
type: typePitch.value,
|
||||
}).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
if (process.server) {
|
||||
await $ajax("/api/lists", {
|
||||
page,
|
||||
limit: 20,
|
||||
keyword: keyword.value,
|
||||
type: typePitch.value,
|
||||
}).then(res => {
|
||||
if (res.code != 200) return
|
||||
let data = res.data
|
||||
|
||||
list.value = list.value.concat(data.data || [])
|
||||
backupsList = backupsList.concat(data.data || [])
|
||||
list.value = list.value.concat(data.data || [])
|
||||
backupsList = backupsList.concat(data.data || [])
|
||||
|
||||
total.value = data.count || 0
|
||||
total.value = data.count || 0
|
||||
|
||||
keywordText.value = keyword.value || ""
|
||||
keywordText.value = keyword.value || ""
|
||||
|
||||
if (list.value.length != data["count"]) page++
|
||||
else page = 0
|
||||
if (list.value.length != data["count"]) page++
|
||||
else page = 0
|
||||
|
||||
if (page == 0 && list.value.length != 0) inTheEndState.value = true
|
||||
else inTheEndState.value = false
|
||||
if (page == 0 && list.value.length != 0) inTheEndState.value = true
|
||||
else inTheEndState.value = false
|
||||
|
||||
if (list.value.length == 0) isListEmptyState.value = true
|
||||
else isListEmptyState.value = false
|
||||
if (list.value.length == 0) isListEmptyState.value = true
|
||||
else isListEmptyState.value = false
|
||||
|
||||
if (keyword.value) isSearchMode.value = true
|
||||
else isSearchMode.value = false
|
||||
})
|
||||
if (keyword.value) isSearchMode.value = true
|
||||
else isSearchMode.value = false
|
||||
|
||||
listDataVuex.value = {
|
||||
list: list.value,
|
||||
backupsList: backupsList,
|
||||
total: total.value,
|
||||
keywordText: keywordText.value,
|
||||
page: page,
|
||||
inTheEndState: inTheEndState.value,
|
||||
isListEmptyState: isListEmptyState.value,
|
||||
isSearchMode: isSearchMode.value,
|
||||
}
|
||||
|
||||
// if (!process.server && params["uniqid"]) handleInsertRelatedlist()
|
||||
})
|
||||
|
||||
await $ajaxGET("/api/details/relatedlist", {page: 1, 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++
|
||||
|
||||
relatedlistDataVuex.value = {
|
||||
list: data,
|
||||
page: recommendPage,
|
||||
}
|
||||
|
||||
if (params["uniqid"]) {
|
||||
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))
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error)
|
||||
}
|
||||
@ -2622,78 +2767,6 @@ export default {
|
||||
else setTimeout(() => openBottom(), 1000)
|
||||
}
|
||||
|
||||
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 => {
|
||||
if (myModelState.value) return
|
||||
|
||||
// 计算需要插入元素的数量
|
||||
let insertCount = Math.ceil(backupsList.length / 5)
|
||||
// 检查数组B的长度是否足够
|
||||
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
|
||||
scrollLeftInMiddle()
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const replaceNumberObj = {
|
||||
0: "①",
|
||||
1: "②",
|
||||
2: "③",
|
||||
}
|
||||
|
||||
return {
|
||||
replaceNumberObj,
|
||||
closeMyModel,
|
||||
|
Loading…
x
Reference in New Issue
Block a user