feat: 添加推荐主题和标签搜索页面

refactor: 优化CSS媒体查询和响应式布局
fix: 移除重复的媒体查询规则
style: 调整搜索框和侧边栏样式
docs: 更新HTML文档结构和元信息
This commit is contained in:
DESKTOP-RQ919RC\Pc
2025-12-23 14:37:43 +08:00
parent 43556292d2
commit 2fd55c3e61
9 changed files with 1212 additions and 89 deletions

View File

@@ -65,7 +65,7 @@ export const itemBottom = defineComponent({
} }
let data = res.data; let data = res.data;
creationAlertBox("success", res.message); // creationAlertBox("success", res.message);
item.value["is_like"] = data.status; item.value["is_like"] = data.status;
item.value["likes"] = data.likes; item.value["likes"] = data.likes;

View File

@@ -335,6 +335,7 @@ body {
color: #000000; color: #000000;
line-height: 36px; line-height: 36px;
margin-bottom: 7px; margin-bottom: 7px;
display: block;
} }
.item-box.item-summary .message { .item-box.item-summary .message {
font-size: 14px; font-size: 14px;
@@ -2106,6 +2107,11 @@ td {
margin: 0 auto; margin: 0 auto;
box-sizing: content-box; box-sizing: content-box;
} }
@media screen and (max-width: 1218px) {
.index-footer {
min-width: inherit !important;
}
}
@media screen and (max-width: 1200px) { @media screen and (max-width: 1200px) {
header.page-header { header.page-header {
min-width: auto !important; min-width: auto !important;
@@ -2121,9 +2127,6 @@ td {
.head-top.flexacenter .input-box { .head-top.flexacenter .input-box {
margin-right: 10px; margin-right: 10px;
} }
.index-footer {
min-width: inherit !important;
}
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
header.page-header { header.page-header {
@@ -2138,25 +2141,6 @@ td {
.head-top .post-list { .head-top .post-list {
display: none !important; display: none !important;
} }
#search .search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
#search .classify {
margin-left: 10px;
margin-right: 10px;
}
#search .matter .matter-content {
margin: 0 10px;
}
#search .matter .sidebar-box {
display: none;
}
#search .matter .search-box {
margin-left: 10px;
margin-right: 10px;
}
.item-box { .item-box {
padding: 18px 10px 0; padding: 18px 10px 0;
} }
@@ -2167,15 +2151,6 @@ td {
margin-right: 30px; margin-right: 30px;
} }
} }
@media screen and (max-width: 500px) {
#search .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
.head-top.flexacenter { .head-top.flexacenter {
margin-bottom: 10px !important; margin-bottom: 10px !important;
@@ -2188,11 +2163,6 @@ td {
margin-right: 0; margin-right: 0;
} }
} }
@media screen and (max-width: 450px) {
#search .classify .item {
padding: 0 5px;
}
}
.huddle-box { .huddle-box {
position: fixed; position: fixed;
top: 0; top: 0;

View File

@@ -3,8 +3,6 @@
padding: 0; padding: 0;
box-sizing: border-box; box-sizing: border-box;
font-family: "PingFangSC-Regular", "PingFang SC", sans-serif; font-family: "PingFangSC-Regular", "PingFang SC", sans-serif;
// font-weight: 400;
// font-style: normal;
word-break: break-word; word-break: break-word;
} }
@@ -406,6 +404,7 @@ body {
color: #000000; color: #000000;
line-height: 36px; line-height: 36px;
margin-bottom: 7px; margin-bottom: 7px;
display: block;
} }
.message { .message {
@@ -2530,6 +2529,12 @@ td {
} }
} }
@media screen and (max-width: 1218px) {
.index-footer {
min-width: inherit !important;
}
}
@media screen and (max-width: 1200px) { @media screen and (max-width: 1200px) {
header.page-header { header.page-header {
min-width: auto !important; min-width: auto !important;
@@ -2547,10 +2552,6 @@ td {
margin-right: 10px; margin-right: 10px;
} }
} }
.index-footer {
min-width: inherit !important;
}
} }
// 媒体查询 最大宽度 768px 时 // 媒体查询 最大宽度 768px 时
@@ -2573,32 +2574,6 @@ td {
display: none !important; display: none !important;
} }
#search {
.search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
.classify {
margin-left: 10px;
margin-right: 10px;
}
.matter {
.matter-content {
margin: 0 10px;
}
.sidebar-box {
display: none;
}
.search-box {
margin-left: 10px;
margin-right: 10px;
}
}
}
.item-box { .item-box {
padding: 18px 10px 0; padding: 18px 10px 0;
.comment .text { .comment .text {
@@ -2610,16 +2585,6 @@ td {
} }
} }
@media screen and (max-width: 500px) {
#search .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 480px) { @media screen and (max-width: 480px) {
.head-top.flexacenter { .head-top.flexacenter {
margin-bottom: 10px !important; margin-bottom: 10px !important;
@@ -2635,12 +2600,6 @@ td {
} }
} }
@media screen and (max-width: 450px) {
#search .classify .item {
padding: 0 5px;
}
}
.huddle-box { .huddle-box {
position: fixed; position: fixed;
top: 0; top: 0;

View File

@@ -1,5 +1,5 @@
#search-tag { #search-tag {
width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
} }
#search-tag .label-title { #search-tag .label-title {
@@ -125,6 +125,7 @@
align-items: flex-start; align-items: flex-start;
} }
#search-tag .matter .matter-content { #search-tag .matter .matter-content {
min-width: 0;
margin-right: 12px; margin-right: 12px;
position: sticky; position: sticky;
z-index: 1; z-index: 1;
@@ -215,3 +216,72 @@
height: 24px; height: 24px;
margin-right: 8px; margin-right: 8px;
} }
@media screen and (max-width: 805px) {
.item-box .bottom .bottom-item:not(:last-child) {
margin-right: 40px;
}
}
@media screen and (max-width: 768px) {
#search-tag .search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
#search-tag .classify {
margin-left: 10px;
margin-right: 10px;
}
#search-tag .matter .matter-content {
margin: 0;
}
#search-tag .matter .sidebar-box {
display: none;
}
#search-tag .matter .search-box {
margin-left: 10px;
margin-right: 10px;
}
#search-tag {
padding: 0 10px;
}
}
@media screen and (max-width: 630px) {
.sign-in.flexacenter {
display: none !important;
}
}
@media screen and (max-width: 500px) {
#search-tag .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 480px) {
.item-box .bottom .bottom-item:not(:last-child) {
margin-right: 0;
}
.head-top.flexacenter .input-box {
width: inherit;
height: inherit;
background: none;
border: none;
padding: 5px;
}
.head-top.flexacenter .input-box .input {
display: none;
}
.head-top.flexacenter .input-box .placeholder {
display: none;
}
.head-top.flexacenter .input-box .icon {
margin-left: 0;
}
}
@media screen and (max-width: 450px) {
#search-tag .classify .item {
padding: 0 5px;
}
}

View File

@@ -1,5 +1,5 @@
#search-tag { #search-tag {
width: 1200px; max-width: 1200px;
margin: 0 auto; margin: 0 auto;
.label-title { .label-title {
@@ -7,7 +7,6 @@
.icon { .icon {
width: 25px; width: 25px;
// height: 20px;
margin-right: 12px; margin-right: 12px;
} }
@@ -148,6 +147,7 @@
align-items: flex-start; align-items: flex-start;
.matter-content { .matter-content {
min-width: 0;
margin-right: 12px; margin-right: 12px;
position: sticky; position: sticky;
z-index: 1; z-index: 1;
@@ -256,3 +256,89 @@
} }
} }
} }
@media screen and (max-width: 805px) {
.item-box .bottom .bottom-item:not(:last-child) {
margin-right: 40px;
}
}
@media screen and (max-width: 768px) {
#search-tag {
.search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
.classify {
margin-left: 10px;
margin-right: 10px;
}
.matter {
.matter-content {
margin: 0;
}
.sidebar-box {
display: none;
}
.search-box {
margin-left: 10px;
margin-right: 10px;
}
}
}
#search-tag {
padding: 0 10px;
}
}
@media screen and (max-width: 630px) {
.sign-in.flexacenter {
display: none !important;
}
}
@media screen and (max-width: 500px) {
#search-tag .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 480px) {
.item-box .bottom .bottom-item:not(:last-child) {
margin-right: 0;
}
.head-top.flexacenter .input-box {
width: inherit;
height: inherit;
background: none;
border: none;
padding: 5px;
.input {
display: none;
}
.placeholder {
display: none;
}
.icon {
margin-left: 0;
}
}
}
@media screen and (max-width: 450px) {
#search-tag .classify .item {
padding: 0 5px;
}
}

View File

@@ -276,6 +276,25 @@
margin-right: 10px; margin-right: 10px;
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
#search .search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
#search .classify {
margin-left: 10px;
margin-right: 10px;
}
#search .matter .matter-content {
margin: 0;
}
#search .matter .sidebar-box {
display: none;
}
#search .matter .search-box {
margin-left: 10px;
margin-right: 10px;
}
#search { #search {
padding: 0 10px; padding: 0 10px;
} }
@@ -330,3 +349,17 @@
width: 100%; width: 100%;
} }
} }
@media screen and (max-width: 500px) {
#search .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 450px) {
#search .classify .item {
padding: 0 5px;
}
}

View File

@@ -340,15 +340,42 @@
} }
@media screen and (max-width: 768px) { @media screen and (max-width: 768px) {
#search {
.search-box {
width: auto !important;
margin: 0 10px 20px;
height: 40px !important;
}
.classify {
margin-left: 10px;
margin-right: 10px;
}
.matter {
.matter-content {
margin: 0;
}
.sidebar-box {
display: none;
}
.search-box {
margin-left: 10px;
margin-right: 10px;
}
}
}
#search { #search {
padding: 0 10px; padding: 0 10px;
} }
#search .search-no .earth-icon { #search .search-no .earth-icon {
width: 60%; width: 60%;
max-width: 220px; max-width: 220px;
height: auto; height: auto;
margin-bottom: 10px; margin-bottom: 10px;
} }
#search .search-no .input-box { #search .search-no .input-box {
width: 100%; width: 100%;
height: 48px; height: 48px;
@@ -395,3 +422,19 @@
width: 100%; width: 100%;
} }
} }
@media screen and (max-width: 500px) {
#search .classify .item {
min-width: inherit;
font-size: 13px;
height: 28px;
line-height: 28px;
border-radius: 8px;
}
}
@media screen and (max-width: 450px) {
#search .classify .item {
padding: 0 5px;
}
}

480
recommend-V2.html Normal file
View File

@@ -0,0 +1,480 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>推荐主题 - 寄托天下 -- 寄托天下</title>
<link rel="stylesheet" href="/css/public.css?v=ObGK5aeS1LzH" />
<link rel="stylesheet" href="/css/search-tag.css?v=ObGK5aeS1LzH" />
<meta name="description" content="寄托天下留学论坛上查看推荐主题">
<meta name="keywords" content="推荐主题, 寄托天下, 留学论坛">
<meta name="author" content="">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:title" content="推荐主题 - 寄托天下">
<meta property="og:description" content="寄托天下留学论坛上查看推荐主题">
<meta property="og:image" content="">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:title" content="推荐主题 - 寄托天下">
<meta property="twitter:description" content="寄托天下留学论坛上查看推荐主题">
<meta property="twitter:image" content="">
<!-- 网站图标 -->
<link rel="icon" href="https://www.gter.net/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="https://www.gter.net/favicon.ico" type="image/x-icon">
<style>
[v-cloak] {
display: none !important;
}
#pre-loader {
height: 70vh;
display: flex;
justify-content: center;
align-items: center;
}
#pre-loader .three-bounce>div {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 100%;
top: 50%;
margin-top: -9px;
background: #aeadba;
animation: bouncedelay 1.4s infinite ease-in-out;
animation-fill-mode: both;
}
#pre-loader .three-bounce .one {
animation-delay: -0.32s;
}
#pre-loader .three-bounce .two {
animation-delay: -0.16s;
}
@keyframes bouncedelay {
0%,
100%,
80% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
</style>
<script type="text/javascript">
var STYLEID = '2',
STATICURL = 'static/',
IMGDIR = 'https://bbs.gter.net/template/archy_plt8/image',
VERHASH = 'Z62',
charset = 'gbk',
discuz_uid = '0',
cookiepre = '4B5x_c0ae_',
cookiedomain = 'gter.net',
cookiepath = '/',
showusercard = '1',
attackevasive = '0',
disallowfloat = '',
creditnotice = ',',
defaultstyle = '',
REPORTURL = 'aHR0cDovL2Jicy5ndGVyLm5ldC9mb3J1bS5waHA/dGlkPTI0MDYzNTYmZ290bz1sYXN0cG9zdA==',
SITEURL = 'https://app.gter.net/',
JSPATH = 'static/js/';
</script>
<script src="https://app.gter.net/bottom?tpl=header&menukey=bbs"></script>
<script src="https://framework.x-php.com/gter/bbs/static/js/common.js" charset="gbk"></script>
</head>
<body>
<script>
window.__ASSET_VERSION__ = 'Z69';
// 判断是否是移动端
window.isMobile = window.innerWidth <= 768;
</script>
<div id="ajaxwaitid"></div>
<div id="append_parent"></div>
<div class="head-top flexacenter" style="width: 1200px;margin: 20px auto 30px;">
<a href="/" class="flexacenter" target="_blank">
<img class="logo" src="https://oss.gter.net/logo" alt="" />
</a>
<div class="flex1"></div>
<div class="input-box flexacenter">
<div class="placeholder">
<div class="placeholder-box" style="transition: transform .3s ease"></div>
</div>
<input class="input flex1" type="text" maxlength="140" /> <img class="icon" onclick="searchEvent()" src="https://framework.x-php.com/gter/forum/img/search-icon.svg?v=ObGK5aeS1LzH" />
<div class="search-box-history">
<div class="search-box-history-title">历史搜索</div>
<div class="search-box-history-list"></div>
</div>
</div>
<div class="post-list flexacenter"> </div>
<div class="sign-in sign-in-no flexacenter"></div>
<div class="head-more flexcenter" onclick="openHeadPop()">
<img class="more-icon" style="width: 18px;height: 15px;" src="https://framework.x-php.com/gter/forum/img/threeAcross.svg?v=ObGK5aeS1LzH" />
</div>
<div class="head-pop" style="display: none;">
<div class="head-more-pop">
<div class="head-more-userinfo flex1 flexacenter">
<div class="head-more-left flexacenter"><img class="head-more-userinfo-avatar" src="" alt="">
<div class="head-more-userinfo-username"></div>
</div>
<div class="head-more-right">
<div class="loginBtn flexcenter" onclick="go_ajax_Login()">登录/注册</div>
</div>
</div>
<div class="tab-list"><a class="tab-item flexacenter" href="https://www.gter.net" target="_blank">寄托首页</a><a class="tab-item flexacenter pitch" href="https://f.gter.net" target="_blank">论坛</a><a class="tab-item flexacenter" href="https://app.gter.net/admissionOfficer" target="_blank">招生官</a><a class="tab-item flexacenter" href="https://bbs.gter.net/thread-2345065-1-1.html" target="_blank">加群</a><a class="tab-item flexacenter" href="https://offer.gter.net" target="_blank">Offer榜</a></div>
<a class="head-more-post flexcenter" href="/publish" target="" onclick="skipLoginUrl(event)">
<div class="head-more-post-icon flexcenter"><img class="head-more-post-img" src="https://framework.x-php.com/gter/forum/img/addyellow.svg?v=ObGK5aeS1LzH" /></div>发布帖子
</a>
<img class="cross-icon" onclick="crossHeadPop()" src="https://framework.x-php.com/gter/forum/img/cross.svg?v=ObGK5aeS1LzH">
</div>
</div>
</div>
<div class="valueA" style="display: none;">https://framework.x-php.com/gter/forum/</div>
<div class="container" id="search-tag">
<div class="templateValue" ref="tagValue"></div>
<div class="templateValue" ref="typeValue"></div>
<!-- <div class="set-hint-box flexacenter">
<img class="set-hint-icon" src="./img/recommend-icon.png">
<div class="set-hint-text">被小编设置为"推荐"的帖子</div>
</div> -->
<div class="label-title flexacenter">
<img class="icon" src="https://framework.x-php.com/gter/forum/img/recommend-head-icon.png?v=ObGK5aeS1LzH" />
<div class="text">编辑推荐</div>
</div>
<div class="classify flexacenter" v-cloak>
<div class="item" :class="{'pitch': key == tabValue}" v-for="(item, key) in tabList" :key="key" @click="cutTab(key)">{{ item }}</div>
</div>
<div id="pre-loader">
<div class="three-bounce" p-id="11">
<div class="one" p-id="12"></div>
<div class="two" p-id="13"></div>
<div class="three" p-id="14"></div>
</div>
</div>
<div class="matter flexflex" ref="matterRef" v-cloak>
<div class="matter-content flex1" ref="contentRef" :style="{'top': matterHeight + 'px'}">
<div class="quantity flexacenter" v-cloak>
{{ tabList[tabValue] }}
<div class="line"></div>
<div class="num">{{ count }}</div>
<div class="sort-area">
<div class="sort-head flexacenter" @click="toggleSort()">
<div class="text">{{ currentSortText }}</div>
<img class="icon " :class="{'rotate': showSort}" src="https://app.gter.net/image/miniApp/offer/triangle-black.svg" />
</div>
<div class="sort-mask" @click="hideSort()" v-if="showSort"></div>
<div class="sort-box" v-if="showSort">
<div class="item" :class="{'pitch': orderBy == '_score'}" @click="selectSort('_score')">按综合排序</div>
<div class="item" :class="{'pitch': orderBy == 'id'}" @click="selectSort('id')">按最新发布排序</div>
</div>
</div>
</div>
<div class="list-box" v-if="list.length != 0">
<template v-for="(item,index) in list" :key="index">
<item-offer v-if=" item.type == 'offer'" :itemdata="item"></item-offer>
<item-summary v-else-if="item.type == 'offer_summary'" :itemdata="item"></item-summary>
<item-vote v-else-if="item.type == 'vote'" :itemdata="item"></item-vote>
<item-mj v-else-if="item.type == 'interviewexperience'" :itemdata="item"></item-mj>
<item-tenement v-else-if="item.type == 'tenement'" :itemdata="item"></item-tenement>
<item-forum v-else :itemdata="item"></item-forum>
</template>
</div>
<load-box :loading="loading"></load-box>
<div v-if="list.length == 0 && page == null" class="empty flexcenter">
<img class="empty-icon" src="https://framework.x-php.com/gter/forum/img/empty-icon.png?v=ObGK5aeS1LzH" />
<div class="empty-text">- 暂无内容 -</div>
</div>
<div class="pages-box flexcenter" v-if="pagination.length != 0">
<img v-if="page == 1" class="arrows" src="https://framework.x-php.com/gter/forum/img/arrows-gray-simple.svg?v=ObGK5aeS1LzH" alt="">
<img @click="prevPage" v-else class="arrows rotate180" src="https://framework.x-php.com/gter/forum/img/arrows-gray-deep.svg?v=ObGK5aeS1LzH" alt="">
<div class="item" :class="{'pitch': item == page }" v-for="(item, index) in pagination" @click="cutPage(item)">{{ item }}</div>
<img v-if="page == maxPage" class="arrows rotate180" src="https://framework.x-php.com/gter/forum/img/arrows-gray-simple.svg?v=ObGK5aeS1LzH" alt="">
<img @click="nextPage" v-else v-else class="arrows" src="https://framework.x-php.com/gter/forum/img/arrows-gray-deep.svg?v=ObGK5aeS1LzH" alt="">
</div>
</div>
<div class="sidebar-box" ref="sidebarRef" :style="{'top': sidebarHeight + 'px'}" style="padding-top: 40px;">
<hot-tag></hot-tag>
<hot-search></hot-search>
<slideshow-box></slideshow-box>
<latest-list></latest-list>
</div>
</div>
</div>
<script src="https://framework.x-php.com/gter/forum/js/vue.global.js?v=ObGK5aeS1LzH"></script>
<script src="https://framework.x-php.com/gter/forum/js/axios.min.js?v=ObGK5aeS1LzH"></script>
<script src="https://framework.x-php.com/gter/forum/js/public.js?v=ObGK5aeS1LzH"></script>
<!-- <script src="https://f.gter.net/js/public.js"></script> -->
<!-- <script type="module" src="https://framework.x-php.com/gter/forum/js/search-tag.js?v=ObGK5aeS1LzH"></script> -->
<script type="module" src="https://framework.x-php.com/gter/forum/js/recommend.js?v=ObGK5aeS1LzH"></script>
<!-- <script type="module" src="https://f.gter.net/js/recommend.js"></script> -->
<script type="module" src="https://framework.x-php.com/gter/forum/../image/gter/commonCom/sign-in/sign-in.js?v=ObGK5aeS1LzH"></script>
<script src="https://app.gter.net/bottom?tpl=footer,popupnotification"></script>
<script>
console.log(location.href.indexOf('details') != -1);
if (location.href.indexOf('details') != -1) {
const postList = document.querySelector('.head-top .post-list')
postList.innerHTML = `<a href="/publish" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-thread.png?v=ObGK5aeS1LzH" /> </a> <a href="https://offer.gter.net/post" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-offer.png?v=ObGK5aeS1LzH" /> </a> <a href="https://offer.gter.net/post/summary" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-summary.png?v=ObGK5aeS1LzH" /> </a> <a href="https://interviewexperience.gter.net/publish" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-mj.png?v=ObGK5aeS1LzH" /> </a> <a href="https://vote.gter.net/publish" target="_blank"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-vote.png?v=ObGK5aeS1LzH" /> </a>`
console.log(postList);
postList.style.display = 'flex'
} else if (location.href.indexOf('search') != -1) {
const box = document.querySelector(".head-top")
box.querySelector(".input-box").style.display = "none"
box.querySelector(".sign-in").style.display = "none"
} else if (location.href.indexOf("publish") != -1) {
const box = document.querySelector(".head-top")
if (box) document.body.removeChild(box)
} else {
const signIn = document.querySelector('.head-top .sign-in')
signIn.innerHTML = `<div class="sign-in-no-box" onclick="headSignIn()">
<img class="sign-in-bj" src="https://framework.x-php.com/gter/forum/img/sign-in-bj.svg?v=ObGK5aeS1LzH" /><img class="coin-bj" src="https://framework.x-php.com/gter/forum/img/coin-bj.svg?v=ObGK5aeS1LzH" />
<img class="coin-icon" src="https://framework.x-php.com/gter/forum/img/coin-icon.png?v=ObGK5aeS1LzH" /><span class="text flex1">签到领寄托币</span>
<div class="sign-go flexcenter">
<img class="sign-go-bj" src="https://framework.x-php.com/gter/forum/img/sign-go.svg?v=ObGK5aeS1LzH" /> GO
</div>
<img class="petal1" src="https://framework.x-php.com/gter/forum/img/petal1.png?v=ObGK5aeS1LzH" />
<img class="petal2" src="https://framework.x-php.com/gter/forum/img/petal2.png?v=ObGK5aeS1LzH" />
<img class="petal3" src="https://framework.x-php.com/gter/forum/img/petal3.png?v=ObGK5aeS1LzH" />
</div>
<div class="sign-in-already-box">
<img class="sign-icon" src="https://framework.x-php.com/gter/forum/img/sign-icon.png?v=ObGK5aeS1LzH" />
<span>已签到,明天再来</span>
</div>`
signIn.style.display = 'flex'
let userInfoWinTimerCount = 0;
const userInfoWinTimer = setInterval(() => {
if (location.host == "127.0.0.1:5501") return;
if (todaysignedState) {
clearInterval(userInfoWinTimer);
if (todaysigned == 1) {
signIn.classList.add('sign-in-already')
signIn.classList.remove("sign-in-no");
}
}
userInfoWinTimerCount++;
if (userInfoWinTimerCount >= 3000) clearInterval(userInfoWinTimer);
}, 50);
}
function headSignIn() {
SignInComponent.initComponent();
}
const searchInput = document.querySelector('.head-top .input')
// 绑定 blur 和 focus 事件
if (searchInput) {
searchInput.addEventListener('blur', function () {
setTimeout(() => {
const historyBox = document.querySelector('.head-top .search-box-history')
if (historyBox) historyBox.style.display = 'none'
}, 300);
const inputBox = document.querySelector('.head-top .input-box')
if (inputBox) inputBox.classList.remove('pitch')
startCarousel();
})
searchInput.addEventListener('focus', () => {
const historyBox = document.querySelector('.head-top .search-box-history')
const historyItem = historyBox.querySelectorAll(".search-box-history-item")
if (historyBox && historyItem.length > 0) historyBox.style.display = 'block'
const inputBox = document.querySelector('.head-top .input-box')
if (inputBox) inputBox.classList.add('pitch')
if (carouselTimer) clearInterval(carouselTimer);
})
// 绑定回车事件
searchInput.addEventListener('keydown', (e) => {
if (e.key == 'Enter') searchEvent()
})
searchInput.addEventListener('input', (e) => {
const value = e.target.value || ''
const placeholder = document.querySelector(".head-top .placeholder")
if (value) placeholder.style.display = 'none'
else placeholder.style.display = 'block'
})
}
let historySearchList = []
// 获取历史搜索
const getHistorySearch = () => {
const data = JSON.parse(localStorage.getItem("history-search")) || [];
historySearchList = data;
let itemAll = ``
data.forEach((item, index) => itemAll += `<div class="search-box-history-item one-line-display" onclick="searchEvent('${item}')">${item}</div>`) // 绑定事件 searchEvent 点击搜索)
const historyList = document.querySelector('.search-box-history-list')
historyList.innerHTML = itemAll
};
if (location.href.indexOf("/publish") == -1 && location.href.indexOf("/search") == -1) getHistorySearch();
const searchEvent = (value) => {
if (window.innerWidth <= 480) {
redirectToExternalWebsite("/search");
return
}
const kw = value || searchInput.value || hotSearchWords[currentIndex]?.keyword || "";;
if (!kw) return;
historySearchList.unshift(kw);
historySearchList = [...new Set(historySearchList)];
if (historySearchList.length > 10) historySearchList = historySearchList.splice(0, 10);
localStorage.setItem("history-search", JSON.stringify(historySearchList));
redirectToExternalWebsite("/search/" + kw);
searchInput.value = ""
}
let hotSearchWords = [];
const renderingPlaceholder = () => {
let itemAll = ``
hotSearchWords.forEach(item => {
itemAll += `<div class="item one-line-display" >大家都在搜:${item.keyword}</div>`
})
const sliceHotSearchWords = hotSearchWords.slice(0, 2)
sliceHotSearchWords.forEach(item => {
itemAll += `<div class="item one-line-display" >大家都在搜:${item.keyword}</div>`
})
const placeholderBox = document.querySelector('.placeholder .placeholder-box')
placeholderBox.innerHTML = itemAll
}
const getWConfigg = () => {
ajaxGet("/v2/api/config/website").then((res) => {
if (res.code == 200) {
let data = res["data"] || {};
hotSearchWords = data.hotSearchWords || [];
renderingPlaceholder()
data.time = new Date().toISOString();
localStorage.setItem("wConfig", JSON.stringify(data));
}
});
};
const checkWConfig = () => {
const wConfig = JSON.parse(localStorage.getItem("wConfig")) || {};
if (wConfig.time) {
const time = new Date(wConfig.time);
const now = new Date();
if (now - time > 24 * 60 * 60 * 1000) getWConfigg();
else {
hotSearchWords = wConfig.hotSearchWords || [];
renderingPlaceholder()
}
} else getWConfigg();
};
checkWConfig()
const renderCurrentIndex = () => {
const placeholderBox = document.querySelector('.placeholder .placeholder-box')
if (placeholderBox) placeholderBox.style.transform = `translateY(${-currentIndex * 36}px)`
}
let currentIndex = 0; // 当前显示的关键词索引
let carouselTimer = null; // 轮播定时器
// 启动轮播函数
const startCarousel = () => {
// 清除已有的定时器
if (carouselTimer) clearInterval(carouselTimer);
// 设置新的定时器,每秒滚动一次
carouselTimer = setInterval(() => {
if (hotSearchWords.length > 1) {
if (currentIndex >= hotSearchWords.length - 1) {
currentIndex++;
setTimeout(() => {
currentIndex = 0;
}, 2300);
} else currentIndex++;
}
renderCurrentIndex()
}, 2300);
};
startCarousel();
const openHeadPop = () => {
if (window["userInfoWin"]?.uin > 0 || window["userInfoWin"]?.uid > 0) {
// 登录
const headMoreLeft = document.querySelector(".head-pop .head-more-left")
headMoreLeft.innerHTML = `<img class="head-more-userinfo-avatar" src="${window["userInfoWin"]?.avatar}" alt=""><div class="head-more-userinfo-username">${window["userInfoWin"]?.nickname}</div>`
} else {
const avatar = document.querySelector(".head-pop .head-more-userinfo-avatar")
avatar.src = "/img/defaultAvatar.png"
const headMoreRight = document.querySelector(".head-pop .head-more-right")
headMoreRight.style.display = "block"
}
document.querySelector(".head-pop").classList.add("head-pop-show");
}
const skipLoginUrl = (e) => {
if (window["userInfoWin"]?.uin > 0 || window["userInfoWin"]?.uid > 0) { }
else {
e.preventDefault();
go_ajax_Login();
}
}
const crossHeadPop = () => document.querySelector(".head-pop").classList.remove("head-pop-show");
</script>
</body>
</html>

482
search-tag-V2.html Normal file
View File

@@ -0,0 +1,482 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>标签:硕士 -- 寄托天下</title>
<link rel="stylesheet" href="/css/public.css" />
<link rel="stylesheet" href="/css/search-tag.css" />
<meta name="description" content="寄托天下留学论坛上查看硕士标签">
<meta name="keywords" content="硕士, 寄托天下, 留学论坛">
<meta name="author" content="">
<!-- Open Graph / Facebook -->
<meta property="og:type" content="website">
<meta property="og:title" content="标签:硕士">
<meta property="og:description" content="寄托天下留学论坛上查看硕士标签">
<meta property="og:image" content="">
<!-- Twitter -->
<meta property="twitter:card" content="summary_large_image">
<meta property="twitter:title" content="标签:硕士">
<meta property="twitter:description" content="寄托天下留学论坛上查看硕士标签">
<meta property="twitter:image" content="">
<!-- 网站图标 -->
<link rel="icon" href="https://www.gter.net/favicon.ico" type="image/x-icon">
<link rel="shortcut icon" href="https://www.gter.net/favicon.ico" type="image/x-icon">
<style>
[v-cloak] {
display: none !important;
}
#pre-loader {
height: 70vh;
display: flex;
justify-content: center;
align-items: center;
}
#pre-loader .three-bounce>div {
display: inline-block;
width: 18px;
height: 18px;
border-radius: 100%;
top: 50%;
margin-top: -9px;
background: #aeadba;
animation: bouncedelay 1.4s infinite ease-in-out;
animation-fill-mode: both;
}
#pre-loader .three-bounce .one {
animation-delay: -0.32s;
}
#pre-loader .three-bounce .two {
animation-delay: -0.16s;
}
@keyframes bouncedelay {
0%,
100%,
80% {
transform: scale(0);
-webkit-transform: scale(0);
}
40% {
transform: scale(1);
-webkit-transform: scale(1);
}
}
</style>
<script type="text/javascript">
var STYLEID = '2',
STATICURL = 'static/',
IMGDIR = 'https://bbs.gter.net/template/archy_plt8/image',
VERHASH = 'Z62',
charset = 'gbk',
discuz_uid = '0',
cookiepre = '4B5x_c0ae_',
cookiedomain = 'gter.net',
cookiepath = '/',
showusercard = '1',
attackevasive = '0',
disallowfloat = '',
creditnotice = ',',
defaultstyle = '',
REPORTURL = 'aHR0cDovL2Jicy5ndGVyLm5ldC9mb3J1bS5waHA/dGlkPTI0MDYzNTYmZ290bz1sYXN0cG9zdA==',
SITEURL = 'https://app.gter.net/',
JSPATH = 'static/js/';
</script>
<script src="https://app.gter.net/bottom?tpl=header&menukey=bbs"></script>
<script src="https://framework.x-php.com/gter/bbs/static/js/common.js" charset="gbk"></script>
</head>
<body>
<script>
window.__ASSET_VERSION__ = 'Z69';
// 判断是否是移动端
window.isMobile = window.innerWidth <= 768;
</script>
<div id="ajaxwaitid"></div>
<div id="append_parent"></div>
<div class="head-top flexacenter" style="width: 1200px;margin: 20px auto 30px;">
<a href="/" class="flexacenter" target="_blank">
<img class="logo" src="https://oss.gter.net/logo" alt="" />
</a>
<div class="flex1"></div>
<div class="input-box flexacenter">
<div class="placeholder">
<div class="placeholder-box" style="transition: transform .3s ease"></div>
</div>
<input class="input flex1" type="text" maxlength="140" /> <img class="icon" onclick="searchEvent()" src="https://framework.x-php.com/gter/forum/img/search-icon.svg?v=uj0T1euj8ufe" />
<div class="search-box-history">
<div class="search-box-history-title">历史搜索</div>
<div class="search-box-history-list"></div>
</div>
</div>
<div class="post-list flexacenter"> </div>
<div class="sign-in sign-in-no flexacenter"></div>
<div class="head-more flexcenter" onclick="openHeadPop()">
<img class="more-icon" style="width: 18px;height: 15px;" src="https://framework.x-php.com/gter/forum/img/threeAcross.svg?v=uj0T1euj8ufe" />
</div>
<div class="head-pop" style="display: none;">
<div class="head-more-pop">
<div class="head-more-userinfo flex1 flexacenter">
<div class="head-more-left flexacenter"><img class="head-more-userinfo-avatar" src="" alt="">
<div class="head-more-userinfo-username"></div>
</div>
<div class="head-more-right">
<div class="loginBtn flexcenter" onclick="go_ajax_Login()">登录/注册</div>
</div>
</div>
<div class="tab-list"><a class="tab-item flexacenter" href="https://www.gter.net" target="_blank">寄托首页</a><a class="tab-item flexacenter pitch" href="https://f.gter.net" target="_blank">论坛</a><a class="tab-item flexacenter" href="https://app.gter.net/admissionOfficer" target="_blank">招生官</a><a class="tab-item flexacenter" href="https://bbs.gter.net/thread-2345065-1-1.html" target="_blank">加群</a><a class="tab-item flexacenter" href="https://offer.gter.net" target="_blank">Offer榜</a></div>
<a class="head-more-post flexcenter" href="/publish" target="" onclick="skipLoginUrl(event)">
<div class="head-more-post-icon flexcenter"><img class="head-more-post-img" src="https://framework.x-php.com/gter/forum/img/addyellow.svg?v=uj0T1euj8ufe" /></div>发布帖子
</a>
<img class="cross-icon" onclick="crossHeadPop()" src="https://framework.x-php.com/gter/forum/img/cross.svg?v=uj0T1euj8ufe">
</div>
</div>
</div>
<div class="valueA" style="display: none;">https://framework.x-php.com/gter/forum/</div>
<div class="container" id="search-tag">
<div class="templateValue" ref="tagValue">硕士</div>
<div class="templateValue" ref="typeValue"></div>
<div class="label-title flexacenter">
<img class="icon" src="https://framework.x-php.com/gter/forum/img/well-number.svg?v=uj0T1euj8ufe" />
<div class="text">硕士</div>
</div>
<div class="classify flexacenter" v-cloak>
<div class="item" :class="{'pitch': key == tabValue}" v-for="(item, key) in tabList" :key="key" @click="cutTab(key)">{{ item }}</div>
</div>
<div id="pre-loader">
<div class="three-bounce" p-id="11">
<div class="one" p-id="12"></div>
<div class="two" p-id="13"></div>
<div class="three" p-id="14"></div>
</div>
</div>
<div class="matter flexflex" ref="matterRef" v-cloak>
<div class="matter-content flex1" ref="contentRef" :style="{'top': matterHeight + 'px'}">
<div class="quantity flexacenter">
{{ tabList[tabValue] }}
<div class="line"></div>
<div class="num">{{ count }}</div>
<div class="sort-area">
<div class="sort-head flexacenter" @click="toggleSort()">
<div class="text">{{ currentSortText }}</div>
<img class="icon " :class="{'rotate': showSort}" src="https://app.gter.net/image/miniApp/offer/triangle-black.svg" />
</div>
<div class="sort-mask" @click="hideSort()" v-if="showSort"></div>
<div class="sort-box" v-if="showSort">
<div class="item" :class="{'pitch': orderBy == '_score'}" @click="selectSort('_score')">按综合排序</div>
<div class="item" :class="{'pitch': orderBy == 'id'}" @click="selectSort('id')">按最新发布排序</div>
</div>
</div>
</div>
<div class="list-box" v-if="list.length != 0">
<template v-for="(item,index) in list" :key="index">
<item-offer v-if=" item.type == 'offer'" :itemdata="item"></item-offer>
<item-summary v-else-if="item.type == 'offer_summary'" :itemdata="item"></item-summary>
<item-vote v-else-if="item.type == 'vote'" :itemdata="item"></item-vote>
<item-mj v-else-if="item.type == 'interviewexperience'" :itemdata="item"></item-mj>
<item-tenement v-else-if="item.type == 'tenement'" :itemdata="item"></item-tenement>
<item-forum v-else :itemdata="item"></item-forum>
</template>
</div>
<load-box :loading="loading"></load-box>
<div v-if="list.length == 0 && page == null" class="empty flexcenter">
<img class="empty-icon" src="https://framework.x-php.com/gter/forum/img/empty-icon.png?v=uj0T1euj8ufe" />
<div class="empty-text">- 暂无内容 -</div>
</div>
<div class="pages-box flexcenter" v-if="pagination.length != 0">
<img v-if="page == 1" class="arrows" src="https://framework.x-php.com/gter/forum/img/arrows-gray-simple.svg?v=uj0T1euj8ufe" alt="">
<img @click="prevPage" v-else class="arrows rotate180" src="https://framework.x-php.com/gter/forum/img/arrows-gray-deep.svg?v=uj0T1euj8ufe" alt="">
<div class="item" :class="{'pitch': item == page }" v-for="(item, index) in pagination" @click="cutPage(item)">{{ item }}</div>
<img v-if="page == maxPage" class="arrows rotate180" src="https://framework.x-php.com/gter/forum/img/arrows-gray-simple.svg?v=uj0T1euj8ufe" alt="">
<img @click="nextPage" v-else v-else class="arrows" src="https://framework.x-php.com/gter/forum/img/arrows-gray-deep.svg?v=uj0T1euj8ufe" alt="">
</div>
</div>
<div class="sidebar-box" ref="sidebarRef" :style="{'top': sidebarHeight + 'px'}" style="padding-top: 40px;">
<div class="recommend-and-essence flexacenter">
<a class="item flexcenter" target="_blank" href="/recommend">
<img class="icon" src="/img/recommend-head-icon.png" />
<div class="text">编辑推荐</div>
</a>
<a class="item flexcenter" target="_blank" href="/best">
<img class="icon" src="/img/essence-head-icon.png" />
<div class="text">精华帖</div>
</a>
</div>
<hot-tag></hot-tag>
<hot-search></hot-search>
<slideshow-box></slideshow-box>
<latest-list></latest-list>
</div>
</div>
</div>
<script src="https://framework.x-php.com/gter/forum/js/vue.global.js?v=uj0T1euj8ufe"></script>
<script src="https://framework.x-php.com/gter/forum/js/axios.min.js?v=uj0T1euj8ufe"></script>
<script src="https://framework.x-php.com/gter/forum/js/public.js?v=uj0T1euj8ufe"></script>
<!-- <script src="https://f.gter.net/js/public.js"></script> -->
<script type="module" src="https://framework.x-php.com/gter/forum/js/search-tag.js?v=uj0T1euj8ufe"></script>
<!-- <script type="module" src="https://f.gter.net/js/search-tag.js"></script> -->
<script type="module" src="https://framework.x-php.com/gter/forum/../image/gter/commonCom/sign-in/sign-in.js?v=uj0T1euj8ufe"></script>
<script src="https://app.gter.net/bottom?tpl=footer,popupnotification"></script>
<script>
console.log(location.href.indexOf('details') != -1);
if (location.href.indexOf('details') != -1) {
const postList = document.querySelector('.head-top .post-list')
postList.innerHTML = `<a href="/publish" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-thread.png?v=uj0T1euj8ufe" /> </a> <a href="https://offer.gter.net/post" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-offer.png?v=uj0T1euj8ufe" /> </a> <a href="https://offer.gter.net/post/summary" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-summary.png?v=uj0T1euj8ufe" /> </a> <a href="https://interviewexperience.gter.net/publish" target="_blank" style="margin-right: 10px"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-mj.png?v=uj0T1euj8ufe" /> </a> <a href="https://vote.gter.net/publish" target="_blank"> <img class="post-item" src="https://framework.x-php.com/gter/forum/img/post-vote.png?v=uj0T1euj8ufe" /> </a>`
console.log(postList);
postList.style.display = 'flex'
} else if (location.href.indexOf('search') != -1) {
const box = document.querySelector(".head-top")
box.querySelector(".input-box").style.display = "none"
box.querySelector(".sign-in").style.display = "none"
} else if (location.href.indexOf("publish") != -1) {
const box = document.querySelector(".head-top")
if (box) document.body.removeChild(box)
} else {
const signIn = document.querySelector('.head-top .sign-in')
signIn.innerHTML = `<div class="sign-in-no-box" onclick="headSignIn()">
<img class="sign-in-bj" src="https://framework.x-php.com/gter/forum/img/sign-in-bj.svg?v=uj0T1euj8ufe" /><img class="coin-bj" src="https://framework.x-php.com/gter/forum/img/coin-bj.svg?v=uj0T1euj8ufe" />
<img class="coin-icon" src="https://framework.x-php.com/gter/forum/img/coin-icon.png?v=uj0T1euj8ufe" /><span class="text flex1">签到领寄托币</span>
<div class="sign-go flexcenter">
<img class="sign-go-bj" src="https://framework.x-php.com/gter/forum/img/sign-go.svg?v=uj0T1euj8ufe" /> GO
</div>
<img class="petal1" src="https://framework.x-php.com/gter/forum/img/petal1.png?v=uj0T1euj8ufe" />
<img class="petal2" src="https://framework.x-php.com/gter/forum/img/petal2.png?v=uj0T1euj8ufe" />
<img class="petal3" src="https://framework.x-php.com/gter/forum/img/petal3.png?v=uj0T1euj8ufe" />
</div>
<div class="sign-in-already-box">
<img class="sign-icon" src="https://framework.x-php.com/gter/forum/img/sign-icon.png?v=uj0T1euj8ufe" />
<span>已签到,明天再来</span>
</div>`
signIn.style.display = 'flex'
let userInfoWinTimerCount = 0;
const userInfoWinTimer = setInterval(() => {
if (location.host == "127.0.0.1:5501") return;
if (todaysignedState) {
clearInterval(userInfoWinTimer);
if (todaysigned == 1) {
signIn.classList.add('sign-in-already')
signIn.classList.remove("sign-in-no");
}
}
userInfoWinTimerCount++;
if (userInfoWinTimerCount >= 3000) clearInterval(userInfoWinTimer);
}, 50);
}
function headSignIn() {
SignInComponent.initComponent();
}
const searchInput = document.querySelector('.head-top .input')
// 绑定 blur 和 focus 事件
if (searchInput) {
searchInput.addEventListener('blur', function () {
setTimeout(() => {
const historyBox = document.querySelector('.head-top .search-box-history')
if (historyBox) historyBox.style.display = 'none'
}, 300);
const inputBox = document.querySelector('.head-top .input-box')
if (inputBox) inputBox.classList.remove('pitch')
startCarousel();
})
searchInput.addEventListener('focus', () => {
const historyBox = document.querySelector('.head-top .search-box-history')
const historyItem = historyBox.querySelectorAll(".search-box-history-item")
if (historyBox && historyItem.length > 0) historyBox.style.display = 'block'
const inputBox = document.querySelector('.head-top .input-box')
if (inputBox) inputBox.classList.add('pitch')
if (carouselTimer) clearInterval(carouselTimer);
})
// 绑定回车事件
searchInput.addEventListener('keydown', (e) => {
if (e.key == 'Enter') searchEvent()
})
searchInput.addEventListener('input', (e) => {
const value = e.target.value || ''
const placeholder = document.querySelector(".head-top .placeholder")
if (value) placeholder.style.display = 'none'
else placeholder.style.display = 'block'
})
}
let historySearchList = []
// 获取历史搜索
const getHistorySearch = () => {
const data = JSON.parse(localStorage.getItem("history-search")) || [];
historySearchList = data;
let itemAll = ``
data.forEach((item, index) => itemAll += `<div class="search-box-history-item one-line-display" onclick="searchEvent('${item}')">${item}</div>`) // 绑定事件 searchEvent 点击搜索)
const historyList = document.querySelector('.search-box-history-list')
historyList.innerHTML = itemAll
};
if (location.href.indexOf("/publish") == -1 && location.href.indexOf("/search") == -1) getHistorySearch();
const searchEvent = (value) => {
if (window.innerWidth <= 480) {
redirectToExternalWebsite("/search");
return
}
const kw = value || searchInput.value || hotSearchWords[currentIndex]?.keyword || "";;
if (!kw) return;
historySearchList.unshift(kw);
historySearchList = [...new Set(historySearchList)];
if (historySearchList.length > 10) historySearchList = historySearchList.splice(0, 10);
localStorage.setItem("history-search", JSON.stringify(historySearchList));
redirectToExternalWebsite("/search/" + kw);
searchInput.value = ""
}
let hotSearchWords = [];
const renderingPlaceholder = () => {
let itemAll = ``
hotSearchWords.forEach(item => {
itemAll += `<div class="item one-line-display" >大家都在搜:${item.keyword}</div>`
})
const sliceHotSearchWords = hotSearchWords.slice(0, 2)
sliceHotSearchWords.forEach(item => {
itemAll += `<div class="item one-line-display" >大家都在搜:${item.keyword}</div>`
})
const placeholderBox = document.querySelector('.placeholder .placeholder-box')
placeholderBox.innerHTML = itemAll
}
const getWConfigg = () => {
ajaxGet("/v2/api/config/website").then((res) => {
if (res.code == 200) {
let data = res["data"] || {};
hotSearchWords = data.hotSearchWords || [];
renderingPlaceholder()
data.time = new Date().toISOString();
localStorage.setItem("wConfig", JSON.stringify(data));
}
});
};
const checkWConfig = () => {
const wConfig = JSON.parse(localStorage.getItem("wConfig")) || {};
if (wConfig.time) {
const time = new Date(wConfig.time);
const now = new Date();
if (now - time > 24 * 60 * 60 * 1000) getWConfigg();
else {
hotSearchWords = wConfig.hotSearchWords || [];
renderingPlaceholder()
}
} else getWConfigg();
};
checkWConfig()
const renderCurrentIndex = () => {
const placeholderBox = document.querySelector('.placeholder .placeholder-box')
if (placeholderBox) placeholderBox.style.transform = `translateY(${-currentIndex * 36}px)`
}
let currentIndex = 0; // 当前显示的关键词索引
let carouselTimer = null; // 轮播定时器
// 启动轮播函数
const startCarousel = () => {
// 清除已有的定时器
if (carouselTimer) clearInterval(carouselTimer);
// 设置新的定时器,每秒滚动一次
carouselTimer = setInterval(() => {
if (hotSearchWords.length > 1) {
if (currentIndex >= hotSearchWords.length - 1) {
currentIndex++;
setTimeout(() => {
currentIndex = 0;
}, 2300);
} else currentIndex++;
}
renderCurrentIndex()
}, 2300);
};
startCarousel();
const openHeadPop = () => {
if (window["userInfoWin"]?.uin > 0 || window["userInfoWin"]?.uid > 0) {
// 登录
const headMoreLeft = document.querySelector(".head-pop .head-more-left")
headMoreLeft.innerHTML = `<img class="head-more-userinfo-avatar" src="${window["userInfoWin"]?.avatar}" alt=""><div class="head-more-userinfo-username">${window["userInfoWin"]?.nickname}</div>`
} else {
const avatar = document.querySelector(".head-pop .head-more-userinfo-avatar")
avatar.src = "/img/defaultAvatar.png"
const headMoreRight = document.querySelector(".head-pop .head-more-right")
headMoreRight.style.display = "block"
}
document.querySelector(".head-pop").classList.add("head-pop-show");
}
const skipLoginUrl = (e) => {
if (window["userInfoWin"]?.uin > 0 || window["userInfoWin"]?.uid > 0) { }
else {
e.preventDefault();
go_ajax_Login();
}
}
const crossHeadPop = () => document.querySelector(".head-pop").classList.remove("head-pop-show");
</script>
</body>
</html>