192 lines
8.2 KiB
PHTML
Executable File
192 lines
8.2 KiB
PHTML
Executable File
<!DOCTYPE html>
|
||
<html lang="en">
|
||
<head>
|
||
<meta charset="UTF-8">
|
||
{include file="include/head-seo" /}
|
||
{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-white">
|
||
|
||
{include file="include/top-head2023" /}
|
||
</div>
|
||
</header>
|
||
{include file="include/top-header-mobile" /}
|
||
<!--top End-->
|
||
<?php if ($category['picture']): ?>
|
||
<!-- 轮播 s -->
|
||
<div class="homeban">
|
||
<div class="bd">
|
||
<ul>
|
||
<li><img src="/frontend/web/images/ch-blog.jpg"/></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<!-- 轮播 e -->
|
||
<?php endif; ?>
|
||
|
||
<div class="swt-Container">
|
||
<div class="news-vertu">
|
||
<div class="tab">
|
||
<?php if(!empty($cate_list)): ?>
|
||
<?php foreach ($cate_list as $key => $value): ?>
|
||
<a href="__ORICOROOT__/article/category/<?php echo $value['id'] ?>.html" class="<?php if ($category['id'] == $value['id']): ?> on <?php endif; ?>"><?php echo $value['name']; ?></a>
|
||
<?php endforeach; ?>
|
||
<?php endif; ?>
|
||
</div>
|
||
<div class="search_box">
|
||
<i class="search_icon"></i>
|
||
<input type="text" placeholder="" class="search" id="article-search-in" value="">
|
||
</div>
|
||
<div class="content">
|
||
<?php if ($list):?>
|
||
<ul>
|
||
<li>
|
||
<div class="blog_list ">
|
||
<?php foreach ($list as $detail):?>
|
||
<?php
|
||
if($detail['jump_link'] == ''){
|
||
$alink = url_rewrite('articledetail', array('id' => $detail['id']));
|
||
}
|
||
else{
|
||
$alink = $detail['jump_link'];
|
||
}
|
||
?>
|
||
<div class="clearfix">
|
||
<a href="<?php echo $alink;?>">
|
||
<img src="<?php echo getImage($detail['picture'], 1500, 1000, 6); ?>">
|
||
<h3><?php echo $detail['name']; ?></h3>
|
||
<p><?php echo msubstr($detail['description'], 0, 200); ?></p>
|
||
</a>
|
||
<span class="blue"><?php echo date("Y-m-d H:i:s",$detail['createtime']); ?></span>
|
||
</div>
|
||
|
||
<?php endforeach;?>
|
||
|
||
</div>
|
||
</li>
|
||
</ul>
|
||
<!-- 新闻列表 s -->
|
||
<?php else:?>
|
||
<div class="clearfix"> 查询无此结果!</div>
|
||
<?php endif;?>
|
||
|
||
|
||
|
||
<!-- 分页 s -->
|
||
<?php
|
||
if ($page) {
|
||
echo $page;
|
||
}
|
||
?>
|
||
<!-- 分页 e -->
|
||
|
||
<script>
|
||
$(function() {
|
||
$(".newfl .addzan").click(function(event) {
|
||
event.preventDefault();
|
||
var love = $(this);
|
||
var id = love.data("id"); //对应id
|
||
if (!love.data("zan")) {
|
||
$.ajax({
|
||
type: "POST",
|
||
dataType: "json",
|
||
url: "<?php echo url('/index/article/zan'); ?>",
|
||
data: {id: id},
|
||
cache: false, //不缓存此页面
|
||
success: function(data) {
|
||
//console.log(data);
|
||
if (data.code) {
|
||
love.data("zan", true);
|
||
love.html('<i class="f2"></i>点赞(' + data.data + ')');
|
||
}
|
||
}
|
||
});
|
||
} else {
|
||
alert('您已点过赞了!');
|
||
}
|
||
return false;
|
||
});
|
||
});
|
||
</script>
|
||
<?php
|
||
$pingluns = getDifferentPinglun('ishot', 8);
|
||
if ($pingluns):
|
||
?>
|
||
<div class="newrh">
|
||
<div class="plun">精彩评论</div>
|
||
<ul class="pllist">
|
||
<?php foreach ($pingluns as $pinglun): ?>
|
||
<li>
|
||
<a href="<?php echo url('index/pinglun/lists', ['type' => strtolower($pinglun['typeid']), 'cid' => $pinglun['content_id']]); ?>">
|
||
<div class="plfl">
|
||
<div class="plimg"><img src="__PUBLIC__/web/uploadfiles/image/ns<?php echo $pinglun['tx']; ?>.jpg"></div>
|
||
<div class="peo1"><?php echo $pinglun['cname']; ?></div>
|
||
<div class="peo2"><?php echo $pinglun['createtime']; ?></div>
|
||
</div>
|
||
<div class="plrh">
|
||
<div class="plrh1"><?php echo msubstr($pinglun['content'], 0, 200); ?></div>
|
||
</div>
|
||
<div class="clear"></div>
|
||
</a>
|
||
</li>
|
||
<?php endforeach; ?>
|
||
</ul>
|
||
</div>
|
||
<?php endif; ?>
|
||
<div class="clear"></div>
|
||
</div>
|
||
<!-- 新闻列表 e -->
|
||
</div>
|
||
</div>
|
||
<!-- bottom s -->
|
||
{include file="include/bottom2023" /}
|
||
<!-- bottom e -->
|
||
|
||
|
||
<script>
|
||
$(function(){
|
||
$(".news-vertu .tab a").click(function(){
|
||
$(this).addClass('on').siblings().removeClass('on');
|
||
var index = $(this).index();
|
||
number = index;
|
||
$('.news-vertu .content li').hide();
|
||
$('.news-vertu .content li:eq('+index+')').show();
|
||
});
|
||
|
||
var auto = 1; //等于1则自动切换,其他任意数字则不自动切换
|
||
if(auto ==1){
|
||
var number = 0;
|
||
var maxNumber = $('.news-vertu .tab a').length;
|
||
function autotab(){
|
||
number++;
|
||
number == maxNumber? number = 0 : number;
|
||
$('.news-vertu .tab a:eq('+number+')').addClass('on').siblings().removeClass('on');
|
||
$('.news-vertu .content ul li:eq('+number+')').show().siblings().hide();
|
||
}
|
||
}
|
||
|
||
//新闻搜索
|
||
var article_search_input = $("#article-search-in");
|
||
|
||
$(article_search_input).on("keyup", function(e){
|
||
$("#article-search-in").keyup(function(event) {
|
||
if (event && event.keyCode === 13) {
|
||
var keywords = $("#article-search-in").val();
|
||
var href = "?skeyword=" + encodeURIComponent(keywords);
|
||
location.href = href;
|
||
|
||
}
|
||
});
|
||
});
|
||
|
||
|
||
});
|
||
</script>
|
||
</body>
|
||
</html>
|