init
This commit is contained in:
181
app/index/view/search/download.phtml
Executable file
181
app/index/view/search/download.phtml
Executable file
@@ -0,0 +1,181 @@
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!--top-->
|
||||
<header class="header-PC header-Index">
|
||||
<div id="header" class="theme-black">
|
||||
|
||||
{include file="include/top-head2023" /}
|
||||
</div>
|
||||
</header>
|
||||
<!--top End-->
|
||||
<img src="/uploads/default/ban2.jpg">
|
||||
<?php if (!empty($category['picture'])): ?>
|
||||
<!-- 轮播 s -->
|
||||
<div class="homeban">
|
||||
<a href="<?php //echo url_rewrite('download', ['id' => $category['id']]); ?>"><img src="<?php echo getImage($category['picture']); ?>"/></a>
|
||||
<!-- 搜索框 s
|
||||
<div class="lsea">
|
||||
<input id="dl-search-in" type="text" value="<?php echo $skeyword; ?>" name="skeyword" placeholder="输入关键字查找">
|
||||
<a id="dl-search-btn" href="#"></a>
|
||||
</div>-->
|
||||
<!-- 搜索框 e -->
|
||||
</div>
|
||||
</div>
|
||||
<!-- 轮播 e -->
|
||||
<?php endif; ?>
|
||||
<!-- 视频列表 s -->
|
||||
<div class="down">
|
||||
<div class="load">
|
||||
<div class="hd">
|
||||
<ul class="hdone">
|
||||
<li>驱动下载</li>
|
||||
<li><a href="<?php echo url('Download/catelists_down?id=3')?>">说明书下载</a></li>
|
||||
<li>Orico期刊</li>
|
||||
<li>其他</li>
|
||||
</ul>
|
||||
<a class="prev"><img src="__PUBLIC__/web/images/bfl.png"></a>
|
||||
<a class="next"><img src="__PUBLIC__/web/images/brh.png"></a>
|
||||
</div>
|
||||
|
||||
<!-- title s -->
|
||||
<div class="Download-title">软件驱动下载</div>
|
||||
<!-- title e -->
|
||||
|
||||
<div class="w1440 bd">
|
||||
<?php if ($list): ?>
|
||||
<ul class="bdone">
|
||||
<?php foreach ($list as $detail): ?>
|
||||
<li>
|
||||
<div class="loadfl">
|
||||
<img src="<?php echo getImage($detail['picture']); ?>">
|
||||
</div>
|
||||
<div class="loadrh">
|
||||
<div class="loada"><a href="<?php //echo url_rewrite('downloaddetail', array('id' => $detail['id'])); ?>"><?php echo $detail['name']; ?></a></div>
|
||||
<div class="load_destri"><?php echo msubstr($detail['description'], 0, 200); ?></div>
|
||||
|
||||
<div class="loadms1">适合型号:<?php echo $detail['app_model']; ?></div>
|
||||
<div class="loadms2">支持系统:<?php echo $detail['support_os']; ?></div>
|
||||
<div class="loadms3">
|
||||
<?php
|
||||
$downloadpath = explode(',', $detail['downloadpath']);
|
||||
$downloadpath64 = explode(',', $detail['downloadpath64']);
|
||||
foreach ($downloadpath as $k => $dl):
|
||||
$dlname = empty($downloadpath64[$k]) ? '下载' : $downloadpath64[$k];
|
||||
//$url=url('index/download/download', ['id' => $detail['id'], 'bit' => $k]);
|
||||
?>
|
||||
<a id="dl-search-btn" href="<?php echo url('/') . trim($dl, '/'); ?>" data-cod="dl" data-id="<?php echo $detail['id']; ?>" target="_blank"><?php echo $dlname; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<!-- 分页 s -->
|
||||
<div style="margin-top:60px"></div>
|
||||
<?php
|
||||
if ($page) {
|
||||
echo $page;
|
||||
}
|
||||
?>
|
||||
<!-- 分页 e -->
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
<?php if ($downloadCategory): ?>
|
||||
<ul class="bdtwo">
|
||||
<?php foreach ($downloadCategory as $k => $dc): ?>
|
||||
<li>
|
||||
<p class="datatitle"><?php echo $dc['name']; ?></p>
|
||||
<?php
|
||||
$downloads = getDifferentDownload('ishot', 8, ['cid' => $dc['id']]);
|
||||
if ($downloads):
|
||||
?>
|
||||
<dl>
|
||||
<?php foreach ($downloads as $download): ?>
|
||||
<dd>
|
||||
<div class="datafl">
|
||||
<img src="<?php echo getImage($download['picture']); ?>">
|
||||
</div>
|
||||
<div class="datarh">
|
||||
<div class="datams1"><?php echo $download['name']; ?></div>
|
||||
<div class="datams2"><?php echo msubstr($download['description'], 0, 200); ?></div>
|
||||
<div class="datams3">格式:<?php echo $download['format']; ?></div>
|
||||
<div class="datams4">
|
||||
<?php
|
||||
$downloadpath = explode(',', $download['downloadpath']);
|
||||
$downloadpath64 = explode(',', $download['downloadpath64']);
|
||||
foreach ($downloadpath as $k => $dl):
|
||||
$dlname = empty($downloadpath64[$k]) ? '下载' : $downloadpath64[$k];
|
||||
?>
|
||||
<a id="dl-search-btn" href="<?php echo url('/') . trim($dl, '/'); ?>" data-cod="dl" data-id="<?php echo $detail['id']; ?>" target="_blank"><?php echo $dlname; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
<?php endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</dl>
|
||||
<?php endif; ?>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ul>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<!-- Add Arrows -->
|
||||
<script>
|
||||
jQuery(".load .hd").slide({mainCell: "ul", autoPlay: false, effect: "left", vis: 8, scroll: 1, autoPage: false, prevCell: ".prev", nextCell: ".next"});
|
||||
$(".load").slide({trigger: "click", defaultIndex: 0, });
|
||||
$(function() {
|
||||
$("#dl-search-btn").bind("click", function(event) {
|
||||
var skeyword = $("#dl-search-in").val();
|
||||
if (skeyword) {
|
||||
var href = "<?php echo url('/dlsearch'); ?>?skeyword=" + encodeURIComponent(skeyword);
|
||||
location.href = href;
|
||||
}
|
||||
});
|
||||
$("#dl-search-in").keyup(function(event) {
|
||||
if (event && event.keyCode == 13) {
|
||||
$("#dl-search-btn").trigger("click");
|
||||
}
|
||||
});
|
||||
$("[data-cod='dl']").click(function(event) {
|
||||
var love = $(this), id = love.data("id"), dl = love.data("dl");
|
||||
dl = typeof (dl) == 'undefined' ? 0 : dl;
|
||||
if (dl < 10) {
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
dataType: "json",
|
||||
url: "<?php echo url('/index/download/dlcount'); ?>",
|
||||
data: {id: id},
|
||||
cache: false, //不缓存此页面
|
||||
success: function(data) {
|
||||
//console.log(data);
|
||||
love.data("dl", dl + 1);
|
||||
}
|
||||
});
|
||||
} else {
|
||||
event.preventDefault();
|
||||
alert('您已下载过了!');
|
||||
return false;
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 视频列表 e -->
|
||||
|
||||
<!-- bottom s -->
|
||||
{include file="include/bottom2023" /}
|
||||
<!-- bottom e -->
|
||||
</body>
|
||||
</html>
|
||||
270
app/index/view/search/index.phtml
Executable file
270
app/index/view/search/index.phtml
Executable file
@@ -0,0 +1,270 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
{include file="include/head-product" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "0";
|
||||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/web/css/subject/search.css">
|
||||
</head>
|
||||
<body>
|
||||
<!--top-->
|
||||
<header class="header-PC header-Product">
|
||||
<div id="header" class="theme-black">
|
||||
|
||||
{include file="include/top-head2023" /}
|
||||
</div>
|
||||
</header>
|
||||
<!--top End-->
|
||||
|
||||
|
||||
<!-- 搜索页 s -->
|
||||
<div class="S-search-bg banner-other 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="硬盘盒" id="search-input" value="">
|
||||
<button type="submit" name="button" value="" class="searchbtn icon-search" id="search-btnput"></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="<?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 -->
|
||||
|
||||
<!-- bottom s -->
|
||||
{include file="include/bottom2023" /}
|
||||
<!-- bottom e -->
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<script type="text/javascript">
|
||||
var search_list = [];
|
||||
$(function() {
|
||||
$.ajax({
|
||||
url: '/index/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-input").keyup(function(event) {
|
||||
if (event && event.keyCode === 13) {
|
||||
if (index >= 0)
|
||||
{
|
||||
var text = $(".ul_add li").eq(index)[0].innerText;
|
||||
$("#search-input").val(text);
|
||||
}
|
||||
|
||||
$("#search-btnput").trigger("click");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
/*点击获取提示关键字*/
|
||||
$("#search ul li").live('click',function(){
|
||||
//获取点击的值
|
||||
var keywords = $(this).text();
|
||||
if(keywords) {
|
||||
$('#search-input').val(keywords);
|
||||
var href = "<?php echo url('/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-btnput").bind("click", function(event) {
|
||||
var skeyword = $("#search-input").val();
|
||||
if (skeyword) {
|
||||
var href = "<?php echo url('/search'); ?>?skeyword=" + encodeURIComponent(skeyword);
|
||||
location.href = href;
|
||||
}
|
||||
else{
|
||||
var href = "<?php echo url('/search'); ?>";
|
||||
location.href = href;
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
<style>
|
||||
.S-search-bg {
|
||||
background-color: #f1f1f1;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
padding-bottom: 3.2% !important;
|
||||
}
|
||||
#search-btnput{
|
||||
right: 8% !important;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user