优化搜索

This commit is contained in:
李志强 2025-06-06 11:40:14 +08:00
parent 465fad3969
commit b5ac7e8f32
7 changed files with 63 additions and 14 deletions

View File

@ -0,0 +1,49 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>错误提示</title>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="/static/layui/css/layui.css">
<style>
.error-container {
text-align: center;
padding: 50px 20px;
}
.error-icon {
font-size: 48px;
color: #FF5722;
margin-bottom: 20px;
}
.error-message {
font-size: 18px;
color: #666;
margin-bottom: 30px;
}
.back-btn {
margin-top: 20px;
}
</style>
</head>
<body>
<div class="layui-fluid">
<div class="layui-row">
<div class="layui-col-md12">
<div class="error-container">
<div class="error-icon">
<i class="layui-icon layui-icon-face-cry"></i>
</div>
<div class="error-message">
<?php echo $msg; ?>
</div>
<div class="back-btn">
<a href="javascript:history.back();" class="layui-btn layui-btn-primary">返回上一页</a>
<a href="/" class="layui-btn">返回首页</a>
</div>
</div>
</div>
</div>
</div>
<script src="/static/layui/layui.js"></script>
</body>
</html>

View File

@ -156,8 +156,8 @@ $loginStatus = [
<div class="search-container"> <div class="search-container">
<div class="search-box"> <div class="search-box">
<select id="searchType" class="search-type"> <select id="searchType" class="search-type">
<option value="article">文章</option> <option value="articles">文章</option>
<option value="resource">资源</option> <option value="resources">资源</option>
</select> </select>
<input type="text" id="searchInput" placeholder="请输入搜索关键词"> <input type="text" id="searchInput" placeholder="请输入搜索关键词">
<button id="searchBtn">搜索</button> <button id="searchBtn">搜索</button>

View File

@ -77,8 +77,8 @@ $loginStatus = [
<div class="search-container"> <div class="search-container">
<div class="search-box"> <div class="search-box">
<select id="searchType" class="search-type"> <select id="searchType" class="search-type">
<option value="article">文章</option> <option value="articles">文章</option>
<option value="resource">资源</option> <option value="resources">资源</option>
</select> </select>
<input type="text" id="searchInput" placeholder="请输入搜索关键词"> <input type="text" id="searchInput" placeholder="请输入搜索关键词">
<button class="search-btn" id="searchBtn">搜索</button> <button class="search-btn" id="searchBtn">搜索</button>

View File

@ -19,7 +19,7 @@
{if $items} {if $items}
{volist name="items" id="item"} {volist name="items" id="item"}
<div class="layui-col-md12"> <div class="layui-col-md12">
<div class="search-result-item" onclick="window.location.href='<?php echo $type == 'article' ? url('article/detail', ['id' => $item['id']]) : $item['detail_url'] ?>'"> <div class="search-result-item" onclick="window.location.href='<?php echo $type == 'articles' ? url('articles/detail', ['id' => $item['id']]) : $item['detail_url'] ?>'">
<div class="search-result-image"> <div class="search-result-image">
<?php if($type == 'article'): ?> <?php if($type == 'article'): ?>
<img src="<?php echo $item['image'] ?: '/static/images/default.jpg' ?>" alt="<?php echo $item['title'] ?>"> <img src="<?php echo $item['image'] ?: '/static/images/default.jpg' ?>" alt="<?php echo $item['title'] ?>">

View File

@ -1,4 +1,4 @@
<?php /*a:5:{s:63:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\articles\detail.php";i:1748423296;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749174451;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?> <?php /*a:5:{s:63:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\articles\detail.php";i:1748423296;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749181062;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -176,8 +176,8 @@ $loginStatus = [
<div class="search-container"> <div class="search-container">
<div class="search-box"> <div class="search-box">
<select id="searchType" class="search-type"> <select id="searchType" class="search-type">
<option value="article">文章</option> <option value="articles">文章</option>
<option value="resource">资源</option> <option value="resources">资源</option>
</select> </select>
<input type="text" id="searchInput" placeholder="请输入搜索关键词"> <input type="text" id="searchInput" placeholder="请输入搜索关键词">
<button id="searchBtn">搜索</button> <button id="searchBtn">搜索</button>

View File

@ -1,4 +1,4 @@
<?php /*a:4:{s:59:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\index\index.php";i:1746865108;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header.php";i:1749178268;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\main.php";i:1749172174;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;}*/ ?> <?php /*a:4:{s:59:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\index\index.php";i:1746865108;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header.php";i:1749181124;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\main.php";i:1749172174;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;}*/ ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -95,8 +95,8 @@ $loginStatus = [
<div class="search-container"> <div class="search-container">
<div class="search-box"> <div class="search-box">
<select id="searchType" class="search-type"> <select id="searchType" class="search-type">
<option value="article">文章</option> <option value="articles">文章</option>
<option value="resource">资源</option> <option value="resources">资源</option>
</select> </select>
<input type="text" id="searchInput" placeholder="请输入搜索关键词"> <input type="text" id="searchInput" placeholder="请输入搜索关键词">
<button class="search-btn" id="searchBtn">搜索</button> <button class="search-btn" id="searchBtn">搜索</button>

View File

@ -1,4 +1,4 @@
<?php /*a:5:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\program\detail.php";i:1748423318;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749174451;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?> <?php /*a:5:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\program\detail.php";i:1748423318;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749181062;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?>
<!DOCTYPE html> <!DOCTYPE html>
<html> <html>
@ -176,8 +176,8 @@ $loginStatus = [
<div class="search-container"> <div class="search-container">
<div class="search-box"> <div class="search-box">
<select id="searchType" class="search-type"> <select id="searchType" class="search-type">
<option value="article">文章</option> <option value="articles">文章</option>
<option value="resource">资源</option> <option value="resources">资源</option>
</select> </select>
<input type="text" id="searchInput" placeholder="请输入搜索关键词"> <input type="text" id="searchInput" placeholder="请输入搜索关键词">
<button id="searchBtn">搜索</button> <button id="searchBtn">搜索</button>