From 13c3c8026bb282cce92c87fa2c9de90f5923059e Mon Sep 17 00:00:00 2001 From: "DESKTOP-RQ919RC\\Pc" <1300399510@qq.com> Date: Fri, 14 Nov 2025 19:43:23 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E4=B8=BB=E9=A1=B5=E8=B7=B3=E8=BD=AC=E9=93=BE=E6=8E=A5=E5=92=8C?= =?UTF-8?q?=E6=8A=95=E5=B8=81=E7=BB=84=E4=BB=B6z-index=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit refactor: 重构用户主页跳转逻辑使用uniqid替代uin/uid style: 为列表加载框添加底部边距 fix: 调整投币组件z-index为10004避免被遮挡 refactor: 更新最新列表API接口地址 fix: 为搜索输入框添加maxlength限制 --- component/bi/bi.js | 2 +- component/bi/bi.txt | 2 +- component/head-top/head-top.js | 2 +- component/head-top/head-top.txt | 2 +- component/item-head/item-head.js | 9 ++++---- component/item-head/item-head.txt | 2 +- component/latest-list/latest-list.js | 33 ++++------------------------ css/public.css | 1 + css/public.less | 1 + 9 files changed, 16 insertions(+), 38 deletions(-) diff --git a/component/bi/bi.js b/component/bi/bi.js index 04788f5..bfa2b2e 100644 --- a/component/bi/bi.js +++ b/component/bi/bi.js @@ -1,6 +1,6 @@ // 1. 创建组件模板和样式(内置到 JS 中,无需外部 HTML/Template) const template = document.createElement("template"); -template.innerHTML = `
已获得
个寄托币
投币
你当前共有
寄托币 [挣币攻略]
作者设置了阅读限制,解锁所有内容仅需 寄托币
投币解锁
你共有 寄托币
你的寄托币不够,快去发帖挣币吧
攒币指南
`; +template.innerHTML = `
已获得
个寄托币
投币
你当前共有
寄托币 [挣币攻略]
作者设置了阅读限制,解锁所有内容仅需 寄托币
投币解锁
你共有 寄托币
你的寄托币不够,快去发帖挣币吧
攒币指南
`; // 2. 定义组件类 class BiCard extends HTMLElement { diff --git a/component/bi/bi.txt b/component/bi/bi.txt index 5bc46a0..5e591cf 100644 --- a/component/bi/bi.txt +++ b/component/bi/bi.txt @@ -50,7 +50,7 @@ width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); - z-index: 99; + z-index: 10004; display: none; } diff --git a/component/head-top/head-top.js b/component/head-top/head-top.js index 69acd0f..fdb4545 100644 --- a/component/head-top/head-top.js +++ b/component/head-top/head-top.js @@ -174,5 +174,5 @@ export const headTop = defineComponent({ return { hotSearchWords, historySearchList, searchEvent, searchInputState, searchHistoryShowState, searchInputFocus, searchInputBlur, page, pitchState, state, signIn, input, currentIndex, pauseCarousel, resumeCarousel }; }, - template: `
大家都在搜:{{ item.keyword }}
大家都在搜:{{ item.keyword }}
历史搜索
{{ item }}
`, + template: `
大家都在搜:{{ item.keyword }}
大家都在搜:{{ item.keyword }}
历史搜索
{{ item }}
`, }); diff --git a/component/head-top/head-top.txt b/component/head-top/head-top.txt index 8d4b8ed..7a167ab 100644 --- a/component/head-top/head-top.txt +++ b/component/head-top/head-top.txt @@ -8,7 +8,7 @@
大家都在搜:{{ item.keyword }}
大家都在搜:{{ item.keyword }}
- +
历史搜索
diff --git a/component/item-head/item-head.js b/component/item-head/item-head.js index fb5cc69..b6d52c5 100644 --- a/component/item-head/item-head.js +++ b/component/item-head/item-head.js @@ -119,9 +119,10 @@ export const itemHead = defineComponent({ redirectToExternalWebsite(`/publish?uniqid=${target.uniqid}`); }; - const goPersonalHomepage = (uin, uid) => { - if (!uin && !uid) return; - redirectToExternalWebsite(`/space?uin=${uin}&uid=${uid}`); + const goPersonalHomepage = (token) => { + console.log("token", token); + if (!token) return; + redirectToExternalWebsite(`/u/${token}`); }; const openedit = (type) => { @@ -162,5 +163,5 @@ export const itemHead = defineComponent({ report, }, - template: `
{{ item?.user?.nickname || item.nickname || "匿名用户" }}
{{ timestamp }}
公开 匿名
{{ item.views }}
举报
删除
`, + template: `
{{ item?.user?.nickname || item.nickname || "匿名用户" }}
{{ timestamp }}
公开 匿名
{{ item.views }}
举报
删除
`, }); diff --git a/component/item-head/item-head.txt b/component/item-head/item-head.txt index ac98591..24534ad 100644 --- a/component/item-head/item-head.txt +++ b/component/item-head/item-head.txt @@ -1,5 +1,5 @@
-
+
{{ item?.user?.nickname || item.nickname || "匿名用户" }}
diff --git a/component/latest-list/latest-list.js b/component/latest-list/latest-list.js index bd4f52c..6c23f53 100644 --- a/component/latest-list/latest-list.js +++ b/component/latest-list/latest-list.js @@ -53,15 +53,14 @@ export const latestList = defineComponent({ let topList = ref([]); const topicHandpicked = () => { - ajaxGet(`/v2/api/forum/topicLists?simple=1&best=1&limit=15`).then((res) => { + ajaxGet(`/v2/api/forum/getHomebestRecommend?limit=15&type=thread`).then((res) => { const data = res.data; - topList.value = data.data; + console.log('data', data); + topList.value = data; nextTick(() => { count += 1; examineCount(); - if (props.boxtype == "essence") { - tabPostsItem("essence"); - } + if (props.boxtype == "essence") tabPostsItem("essence"); }); }); }; @@ -78,30 +77,6 @@ export const latestList = defineComponent({ boxbox.classList.add(`box-${key}`); boxbox.classList.remove(`box-${postsTab.value}`); - // let index = tabPostsArr.indexOf(key); - - // 修改 tab 状态的 - // if (postsTab.value) { - // let oldNode = boxbox.querySelector(`.slideshow-box .tab-item.${postsTab.value}`); - // oldNode.classList.toggle("pitch"); - // boxbox.classList.remove(`box-${postsTab.value}`); - // } - - // let targetTabNode = boxbox.querySelector(`.slideshow-box .tab-item.${key}`); - // targetTabNode.classList.toggle("pitch"); - - // // 修改全局背景状态的 - // let targetContentNode = boxbox.querySelector(`.slideshow-content .${key}-side-box`); - // let targetContentHeight = targetContentNode.offsetHeight; - - // boxbox.style.height = targetContentHeight + 66 + "px"; - - // let slideshowContent = boxbox.querySelector(".slideshow-content"); - // slideshowContent.scrollTo({ - // left: 290 * index, - // behavior: "smooth", - // }); - postsTab.value = key; }; diff --git a/css/public.css b/css/public.css index e784c94..bcf56a7 100644 --- a/css/public.css +++ b/css/public.css @@ -1756,6 +1756,7 @@ td { .list-load-box.show { height: 100px; border-width: 1px; + margin-bottom: 30px; } .list-load-box.show .list-load-icon { width: 30px; diff --git a/css/public.less b/css/public.less index e5975fd..3dad491 100644 --- a/css/public.less +++ b/css/public.less @@ -2079,6 +2079,7 @@ td { &.show { height: 100px; border-width: 1px; + margin-bottom: 30px; .list-load-icon { width: 30px;