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

212 lines
7.2 KiB
PHTML
Executable File

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>新闻动态</title>
{include file="include/head" /}
<script type="text/javascript">
var navID = "1";
</script>
<style>
.news_list .right {
float: left;
width: 65%;
}
.news_list .left {
float: left;
width: 30%;
}
.news_list_share img {
vertical-align: bottom;
margin-right: 0.16rem;
width: 0.927rem;
height: 0.927rem;
margin-bottom: 0.05rem;
}
.m_Container_right {
float: right;
margin: 5px 0 0 0 !important;
}
.news_list_des_text {
font-size: 0.48rem;
color: #666;
line-height: 0.88rem;
text-align: left !important;
margin-bottom: 0.25rem;
}
</style>
</head>
<body>
<!-- 轮播 s -->
<div id="content">
<!--头部-->
{include file="include/top_back1" /}
<!--banner-->
<div class="banner img-responsive margin-top-90">
<img src="__PUBLIC__/m_web/images/news/news-banner.jpg">
</div>
<!--新闻列表-->
<div class="swt-Container">
<div class="news-vertu">
<?php if($cate_list): ?>
<div class="tab">
<?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="bg-blog-in" value="">
<button id="blog-btnput" class="search-button-blog">搜索</button>
</div>
<?php if (!empty($list)): ?>
<div class="blog_list">
<ul class="clearfix">
<?php foreach ($list as $key => $value): ?>
<?php
if($value['jump_link'] == ''){
$alink = "__ORICOROOT__/article/detail/".$value['id'].".html";
}
else{
$alink = $value['jump_link'];
}
?>
<li>
<a href="<?php echo $alink; ?>">
<img src="<?php echo getImage($value['picture']); ?>">
<h3><?php echo $value['name']; ?></h3>
<p>
<?php
if (utf8_strlen($value['description']) > 35) {
$value['description'] = msubstr($value['description'], 0, 35);
}
echo $value['description'];
?>
</p>
</a>
<span class="blue"><?php echo date("Y-m-d", $value['createtime']); ?></span>
</li>
<?php endforeach; ?>
<!-- 分页 s -->
<div class="Pages"><?php if ($page) echo $page; ?></div> <!-- 分页 e -->
</ul>
</div>
<?php else: ?>
<div class="news_list newfl">查询无此结果!</div>
<?php endif; ?>
<!-- Blog列表 e -->
<script>
$(function(){
$("#bg-blog-in").keyup(function(event) {
if (event && event.keyCode === 13) {
$("#blog-btnput").trigger("click");
}
});
//$("#search-btnput").click(function() {
$("#blog-btnput").bind("click", function(event) {
var keywords = $("#bg-blog-in").val();
if(keywords){
var href = "?name=" + encodeURIComponent(keywords);
location.href = href;
}
else{
var href = "/mobile/article.html";
location.href = href;
}
});
});
</script>
</div>
<!--精彩评论-->
<?php if (!empty($hot_comment)): ?>
<div class="m_Container">
<div class="news-comments">
<div class="title text_center title_margin-top">精彩评论</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/bottom1" /}
</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('__ORICOROOT__/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">点赞(' + data.data + ')');
}
}
});
} else {
alert('您已点过赞了!');
}
return false;
});
});
</script>
<script type="text/javascript">
/*function zan(id) {
var article_id = id;
$.ajax({
url: '/mobile/article/zan',
type: 'post',
data: {id: article_id},
dataType: 'json',
success: function(res) {
if (res) {
alert(res.msg);
if (res.code == 1) {
// 点赞成功
}
}
}
});
}*/
</script>