From 5c199bb8fea655e3719aed0a94580777d5b806e8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Thu, 6 Nov 2025 19:19:59 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E7=BB=84=E4=BB=B6):=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E9=93=BE=E6=8E=A5=E5=A4=84=E7=90=86=E5=B9=B6=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=A0=B7=E5=BC=8F=E7=BB=93=E6=9E=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 将硬编码的详情页链接改为通过item.url统一管理 - 将评论区域的div改为可点击的a标签 - 调整图标容器的样式结构,增加定位和尺寸控制 - 修复标签过滤逻辑,避免空值导致的错误 --- component/item-bottom/item-bottom.js | 2 +- component/item-bottom/item-bottom.txt | 8 ++++---- component/item-forum/item-forum.js | 5 ++++- component/item-forum/item-forum.txt | 4 ++-- component/item-head/item-head.js | 5 +++-- css/index.css | 11 +++++++++-- css/index.less | 12 ++++++++++-- 7 files changed, 33 insertions(+), 14 deletions(-) diff --git a/component/item-bottom/item-bottom.js b/component/item-bottom/item-bottom.js index 27dc297..82f8f60 100644 --- a/component/item-bottom/item-bottom.js +++ b/component/item-bottom/item-bottom.js @@ -120,5 +120,5 @@ export const itemBottom = defineComponent({ like, }, - template: `
{{ item?.commentreviews?.content || "[图]" }}
{{ item.likes || "赞" }}
{{ item.collections || "收藏" }}
{{ item.comments || "讨论" }}
{{ item.coins || "投币" }}
转发
`, + template: `
{{ item?.commentreviews?.content || "[图]" }}
{{ item.likes || "赞" }}
{{ item.collections || "收藏" }}
{{ item.comments || "讨论" }}
{{ item.coins || "投币" }}
转发
`, }); diff --git a/component/item-bottom/item-bottom.txt b/component/item-bottom/item-bottom.txt index 1bcedeb..ed65304 100644 --- a/component/item-bottom/item-bottom.txt +++ b/component/item-bottom/item-bottom.txt @@ -1,12 +1,12 @@ -
+
{{ item?.commentreviews?.content || "[图]" }}
-
+
diff --git a/component/item-forum/item-forum.js b/component/item-forum/item-forum.js index d1a9be1..097f5ae 100644 --- a/component/item-forum/item-forum.js +++ b/component/item-forum/item-forum.js @@ -25,6 +25,9 @@ export const itemForum = defineComponent({ res.content = res?.content?.replace(/\[.*?\../g, ""); let item = ref({ ...res }); + + item.value['url'] = '/details/' + item.value.uniqid; + return { item }; }, @@ -33,5 +36,5 @@ export const itemForum = defineComponent({ itemHead, }, - template: ``, + template: ``, }); diff --git a/component/item-forum/item-forum.txt b/component/item-forum/item-forum.txt index 194f85c..603461f 100644 --- a/component/item-forum/item-forum.txt +++ b/component/item-forum/item-forum.txt @@ -1,8 +1,8 @@ \ No newline at end of file diff --git a/component/item-head/item-head.js b/component/item-head/item-head.js index 45836bc..7f56106 100644 --- a/component/item-head/item-head.js +++ b/component/item-head/item-head.js @@ -33,7 +33,9 @@ export const itemHead = defineComponent({ sectionn.value = item.value.sectionn || []; const sectionNameSet = new Set(sectionn.value.map((item) => item.name)); - tags.value = item.value?.tags?.filter((tagName) => !sectionNameSet.has(tagName)) || []; + console.log(item.value.tags, "tags"); + tags.value = item.value?.tags || []; + tags.value = tags.value?.filter((tagName) => !sectionNameSet.has(tagName)) || []; // const sectionSet = new Set(sectionn.value); // tags.value = item.value.tags?.filter((tag) => !sectionSet.has(tag)); @@ -107,7 +109,6 @@ export const itemHead = defineComponent({ const parentItemBox = targetNode.parentElement; if (parentItemBox?.classList.contains("item-box")) parentItemBox.style.display = "none"; - }) .finally(() => { cutShow(); diff --git a/css/index.css b/css/index.css index 5bc17de..346fcfd 100644 --- a/css/index.css +++ b/css/index.css @@ -281,10 +281,17 @@ #appIndex .header-content-box .header-content-right .post-entrance .entrance-bottom .item:hover { background-color: #e7e7e7; } -#appIndex .header-content-box .header-content-right .post-entrance .entrance-bottom .item .icon { +#appIndex .header-content-box .header-content-right .post-entrance .entrance-bottom .item .icon-box { + position: relative; width: 16px; height: 16px; - margin-right: 6px; + margin-right: 8px; +} +#appIndex .header-content-box .header-content-right .post-entrance .entrance-bottom .item .icon-box .icon { + position: absolute; + width: 38px; + top: -8px; + left: -6px; } #appIndex .header-content-box .header-content-right .adv { width: 240px; diff --git a/css/index.less b/css/index.less index 258954c..92def3a 100644 --- a/css/index.less +++ b/css/index.less @@ -334,10 +334,18 @@ background-color: #e7e7e7; } - .icon { + .icon-box { + position: relative; width: 16px; height: 16px; - margin-right: 6px; + margin-right: 8px; + + .icon { + position: absolute; + width: 38px; + top: -8px; + left: -6px; + } } } }