This commit is contained in:
2024-10-29 14:04:59 +08:00
commit 48bf3e6f33
2839 changed files with 762707 additions and 0 deletions

428
app/us/view/search/index.phtml Executable file
View File

@@ -0,0 +1,428 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
{include file="include/head-product" /}
<script type="text/javascript">
var navID = "0";
</script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/web/scripts/bxslider/jquery.bxslider.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/swiper-bundle.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/modal.min.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/demo.css">
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/theme.css">
<script type="text/javascript" src="__PUBLIC__/weben/scripts/swiper-bundle.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/web/scripts/bxslider/jquery.bxslider.min.js"></script>
<script type="text/javascript" src="__PUBLIC__/weben/scripts/booNavigation.js"></script>
</head>
<body>
<!--top-->
<header class="header-PC header-Product">
<div id="header" class="theme-black">
{include file="include/top-header" /}
</div>
</header>
<!--top End-->
<!-- 搜索页 s -->
<div class="S-search-bg nsea">
<div class="swt-Container S-search-content secon secon1">
<div class="S-Searchbox">
<!--div class="Search">
<input type="text" name="textfield" class="ipt" placeholder="HDD enclosure" id="search-in">
<!--button type="submit" name="button" value="" class="searchbtn icon-search" id="search-btn"></button>
<div id="search" class="search_content search_default">
</div>
</div-->
</div>
<?php
if ($list):
?>
<ul class="seul">
<?php foreach ($list as $detail): ?>
<li>
<a href="/us<?php echo url_rewrite($detail['link'], ['id' => $detail['id']]); ?>">
<div class="sepic"><img src="<?php echo getImage($detail['picture']); ?>"></div>
<div class="seinfo">
<?php if (isset($search['skeyword'])): ?>
<p class="info1">
<?php
if (stripos($detail['name'], $name_word) !== false)
{
$replace_str = substr($detail['name'], stripos($detail['name'], $name_word), strlen($name_word));
echo str_replace($replace_str, '<font color=red><b>' . $replace_str . '</b></font>', $detail['name']);
}
else
echo $detail['name'];
?>
</p>
<p class="info2">
<?php
if (stripos($detail['description'], $name_word) !== false)
{
$replace_str = substr($detail['description'], stripos($detail['description'], $name_word), strlen($name_word));
echo str_replace($replace_str, '<font color=red><b>' . $replace_str . '</b></font>', $detail['description']);
}
else
echo $detail['description'];
?>
</p>
<p class="info3">
<?php
if (stripos($detail['brand_id'], $brand_word) !== false)
{
$replace_str = substr($detail['brand_id'], stripos($detail['brand_id'], $brand_word), strlen($brand_word));
echo str_replace($replace_str, '<font color=red><b>' . $replace_str . '</b></font>', $detail['brand_id']);
}
else
echo $detail['brand_id'];
?>
</p>
<?php else: ?>
<p class="info1"><?php echo $detail['name']; ?></p>
<p class="info2"><?php echo msubstr($detail['description'], 0, 160); ?></p>
<p class="info3"><?php echo $detail['brand_id']; ?></p>
<?php endif; ?>
</div>
<div class="clear"></div>
</a>
</li>
<?php endforeach; ?>
<div class="clear" style="margin-top:20px;"></div>
<!-- 分页 s -->
<?php
if ($page) {
echo $page;
}
?>
<!-- 分页 e -->
</ul>
<?php endif; ?>
</div>
</div>
<!-- 搜索页 e -->
<script>
$(function() {
$("#search-btn").bind("click", function(event) {
var skeyword = $("#search-in").val();
if (skeyword) {
var href = "<?php echo url('/us/search'); ?>?skeyword=" + encodeURIComponent(skeyword);
location.href = href;
}
});
});
</script>
<!-- bottom s -->
{include file="include/bottom" /}
<!-- bottom e -->
</body>
</html>
<script type="text/javascript">
var search_list = [];
$(function() {
$.ajax({
url: '/us/product/get_filter',
type: 'post',
dataType: 'json',
success: function(res) {
search_list = res.data.product_name;
}
})
});
/* function handle_mousemove(i)
{
index = i;
$(".ul_add li").removeClass("ul_search");
$(".ul_add li").eq(index).addClass('ul_search');
}
var index = -1; // 鼠标悬停位置
$(function() {
var search_input = $(".Search input");
var search_content = $(".search_content");
$(search_input).on("keyup", function(e)
{
if (e.keyCode != 38 && e.keyCode != 40 && e.keyCode != 13)
{
index = -1; // 鼠标悬停位置
}
var search_table_list = [];
var value = search_input.val();
if (value.length > 0) {
var search_list_len = search_list.length;
for (var i=0;i<search_list_len;i++)
{
if (search_table_list.length > 4)
break;
if(search_list[i].name.toLowerCase().indexOf(value.toLowerCase()) != -1 || search_list[i].brand_id.toLowerCase().indexOf(value.toLowerCase()) != -1)
{
search_table_list.push(search_list[i]);
}
}
var html = '<ul>';
var data_length = search_table_list.length;
for(var i=0;i<data_length;i++) {
html += '<li onmousemove="handle_mousemove(' + i + ')">';
html += search_table_list[i].name + '(' + search_table_list[i].brand_id + ')';
html += '</li>';
}
html += '</ul>';
$('#search').html(html);
}
else if (value.length == 0)
$('#search').html('');
if (data_length > 0)
$(search_content).show().addClass("ul_add");
else
$(search_content).hide();
if (e.keyCode == 38)
{
// 上键
if (search_table_list == '' || search_table_list == undefined)
{
return;
}
index = (index - 1) < 0 ? -1 : (index - 1);
if (index < 0)
{
return;
}
$(".ul_add li").removeClass("ul_search");
$(".ul_add li").eq(index).addClass('ul_search');
}
else if (e.keyCode == 40)
{
// 下键
if (search_table_list == '' || search_table_list == undefined)
{
return;
}
index += 1;
if (index >= search_table_list.length - 1)
{
index = search_table_list.length - 1;
}
$(".ul_add li").removeClass("ul_search");
$(".ul_add li").eq(index).addClass('ul_search');
}
$("#search-in").keyup(function(event) {
if (event && event.keyCode === 13) {
if (index >= 0)
{
var text = $(".ul_add li").eq(index)[0].innerText;
$("#search-in").val(text);
}
$("#search-btn").trigger("click");
}
});
});
});*/
/*点击获取提示关键字*/
$("#search ul li").live('click',function(){
//获取点击的值
var keywords = $(this).text();
if(keywords) {
$('#search-in').val(keywords);
var href = "<?php echo url('/us/search'); ?>?skeyword=" + encodeURIComponent(keywords);
location.href = href;
$(".search_content").hide();
}
});
//点击search以外部分隐藏
$("body").click(function (e) {
if (!$(e.target).closest(".Search").length) {
$(".search_content").hide()
}
});
$(function() {
$("#search-btn").bind("click", function(event) {
var skeyword = $("#search-in").val();
if (skeyword) {
var href = "<?php echo url('/us/search'); ?>?skeyword=" + encodeURIComponent(skeyword);
location.href = href;
}
else{
var href = "<?php echo url('/us/search'); ?>";
location.href = href;
}
});
});
$(document).ready(function() {
var widget = $('.tabs-vertical');
var tabs = widget.find('ul a'),
content = widget.find('.tabs-content-placeholder > div');
tabs.on('mouseover', function (e) {
e.preventDefault();
// Get the data-index attribute, and show the matching content div
var index = $(this).data('index');
tabs.removeClass('tab-active');
content.removeClass('tab-content-active');
$(this).addClass('tab-active');
content.eq(index).addClass('tab-content-active');
});
});
$(document).ready(function() {
$('#countrycheck').click(function() {
$('#top-country').toggleClass('hidden');
});
//
});
$(document).ready(function() {
// 点击打开按钮显示弹出框
$('#openModalBtn').click(function() {
$('#modal').fadeIn();
});
// 点击关闭按钮或背景模态框,隐藏弹出框
$('#closeModalBtn, .modal').click(function() {
$('#modal').fadeOut();
});
// 防止点击弹出框内容时关闭弹出框
$('.modal-content').click(function(e) {
e.stopPropagation();
});
});
</script>
<style>
#search-in{
margin-left: 10%;
margin-top: 5%;
width: 80%;
height: 44px;
border: 1px solid grey;
border-radius:22px;
background: url('__PUBLIC__/weben/images/indeximg/sousuo1.png') no-repeat;
background-position: 95% 50%;
padding-left: 5%;
}
.swiper-slide img:hover {
transform: scale(1.2);
}
.searchdiv{
position: flex;
/*display: none;*/
width: 40%;
height: 80%;
background-color: white;
}
.ba-slider .handle:after {
position: absolute;
top: 50%;
width: 48px;
height: 48px;
margin: -24px 0 0 -24px;
content: '';
display: flex;
align-items: center;
justify-content: center;
background: #fff url("__PUBLIC__/weben/images/indeximg/ba-arrow.png") center center / 22px 22px no-repeat;
border: 1px solid #fff;
border-radius: 50%;
transition: all .3s ease;
transform: scale(1);
z-index: 5;
}
.workshop_all .content1{ width:44.5%; height: 25.3125rem; z-index: 2; float:left;border-radius: 0 26px 26px 0 ; background: url('__PUBLIC__/weben/images/indeximg/pt1.png') ;
background-position: center!important;
background-repeat: no-repeat!important;
background-size: cover!important; }
.workshop_all .content11{ width:44.5%; height: 25.3125rem; z-index: 2; float:left;border-radius: 26px 0 0 26px ;background: url('__PUBLIC__/weben/images/indeximg/pt6.png');background-position: center!important;
background-repeat: no-repeat!important;
background-size: cover!important;}
.workshop_all .content111{background: url('__PUBLIC__/weben/images/indeximg/pt7.png') 100% 100% no-repeat;}
.docking1{
display: flex;
width: 100%;
height: 50rem;
}
.docking1:hover{
animation:zoombig 0.8s;
background-size: 110% 110% ;
overflow: hidden;
}
.docking2-1:hover{
animation:zoombig 0.5s;
background-size: auto 110%;
}
.docking2-1{
background-size: auto 100%;
}
.docking2-1:hover{
.docking2-2{
background: url('__PUBLIC__/weben/images/indeximg/pt3.png') 100% 100% no-repeat;
}
.docking2-3{
background: url('__PUBLIC__/weben/images/indeximg/pt4.png') 100% 100% no-repeat;
}
.docking2-4{
background: url('__PUBLIC__/weben/images/indeximg/pt5.png') 100% 100% no-repeat;
}
@keyframes zoombig{
0% {backgroud-size:auto 100%;}
100% {backgroud-size:auto 120%;}
}
#head-nav {
position: fixed;
top: 0;
transition: background-color 0.3s ease-in-out;
}
#navbar.scrolled {
background-color: black; /* 滚动时导航栏的背景颜色 */
}
</style>