Files
orico-official-website-old/app/usmobile/view/article/lists.phtml
2024-10-29 14:04:59 +08:00

163 lines
5.9 KiB
PHTML
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>News</title>
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
</head>
<body>
<!-- 轮播 s -->
<div id="content">
<!--头部-->
{include file="include/top" /}
<!--banner-->
<div class="banner img-responsive">
<img src="__PUBLIC__/m_web/images/news/news-banner.jpg">
</div>
<!--新闻列表-->
<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="m_Container">
<!-- Blog列表 s -->
<div class="search_box">
<input type="text" placeholder="" class="search" id="article-blog-in" value="">
<button id="blog-btnput" class="search-button-blog">Search</button>
</div>
<div class="blog_list">
<?php if ($list):?>
<ul class="clearfix">
<?php foreach ($list as $detail):?>
<?php
if($detail['jump_link'] == ''){
$alink = "__ORICOROOT__/article/detail/".$detail['id'].".html";
}
else{
$alink = $detail['jump_link'];
}
?>
<li>
<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("M j, Y",$detail['createtime']); ?></span>
</li>
<?php endforeach;?>
<?php else:?>
<div class="clearfix"> No Result</div>
<?php endif;?>
<!-- 分页 s -->
<?php
if ($page) {
echo $page;
}
?>
<!-- 分页 e -->
</div>
<!-- Blog列表 e -->
<!--精彩评论-->
<?php if (!empty($hot_comment)): ?>
<div class="m_Container">
<div class="news-comments">
<div class="title text_center title_margin-top">Wonderful commentary</div>
<?php foreach ($hot_comment as $key => $value): ?>
<div class="news-comment">
<div class="Customer-information">
<div class="left"><img src="<?php echo getImage($value['headimg']); ?>"></div>
<div class="right">
<span class="news_list_des_text"><?php echo $value['customer_name']; ?></span>
<span class="news_list_share"><?php echo $value['createtime'] ?></span>
</div>
</div>
<p><?php echo $value['content']; ?></p>
</div>
<?php endforeach; ?>
</div>
</div>
<?php endif; ?>
<br class="bottom-margin">
<!--底部文件-->
{include file="include/bottom" /}
</div>
</body>
</html>
<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('<img src="__PUBLIC__/m_web/images/news/news-Collection.png">Like(' + data.data + ')');
}
}
});
} else {
alert('您已点过赞了!');
}
return false;
});
});
</script>
<script>
$(function(){
//新闻搜索
var article_search_input = $("#article-search-in");
$("#article-blog-in").keyup(function(event) {
if (event && event.keyCode === 13) {
$("#blog-btnput").trigger("click");
}
});
$("#blog-btnput").bind("click", function(event) {
var keywords = $("#article-blog-in").val();
if(keywords){
var href = "?skeyword=" + encodeURIComponent(keywords);
location.href = href;
}
else{
var href = "/usmobile/article.html";
location.href = href;
}
});
});
</script>