init
This commit is contained in:
55
app/usmobile/view/article/online.2019.4.22/detail-2019-04-26.phtml
Executable file
55
app/usmobile/view/article/online.2019.4.22/detail-2019-04-26.phtml
Executable file
@@ -0,0 +1,55 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top" /}
|
||||
<!--banner-->
|
||||
<div class="m_Container news_detail">
|
||||
<div class="title text_center"><?php echo $detail['name']; ?></div>
|
||||
<div class="date text_center"><?php echo date("Y-m-d H:i", $detail['createtime']); ?></div>
|
||||
<div class="news_detail_content img-responsive">
|
||||
<p>
|
||||
<?php echo $detail['content']; ?>
|
||||
</p>
|
||||
<img src="<?php echo getImage($detail['picture']); ?>" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="m_Container">
|
||||
<div class="news-comments">
|
||||
<div class="title text_center title_margin-top">精彩评论</div>
|
||||
<?php if (!empty($list)): ?>
|
||||
<?php foreach ($list 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['cname']; ?></span>
|
||||
<span class="news_list_share"><?php echo $value['createtime']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><?php echo $value['content']; ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="news-replay">
|
||||
<textarea id="ccont" placeholder="请输入您的评论..."></textarea>
|
||||
<span class="Release">发布</span>
|
||||
</div>
|
||||
</div>
|
||||
<br class="bottom-margin">
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
99
app/usmobile/view/article/online.2019.4.22/detail.phtml
Executable file
99
app/usmobile/view/article/online.2019.4.22/detail.phtml
Executable file
@@ -0,0 +1,99 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top" /}
|
||||
<!--banner-->
|
||||
<div class="m_Container news_detail">
|
||||
<div class="title text_center"><?php echo $detail['name']; ?></div>
|
||||
<div class="date text_center"><?php echo date("Y-m-d H:i", $detail['createtime']); ?></div>
|
||||
<div class="news_detail_content img-responsive">
|
||||
<p>
|
||||
<?php echo $detail['content']; ?>
|
||||
</p>
|
||||
<img src="<?php echo getImage($detail['picture']); ?>" alt="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="m_Container">
|
||||
<div class="news-comments">
|
||||
<div class="title text_center title_margin-top">精彩评论</div>
|
||||
<?php if (!empty($list)): ?>
|
||||
<?php foreach ($list 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['cname']; ?></span>
|
||||
<span class="news_list_share"><?php echo $value['createtime']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<p><?php echo $value['content']; ?></p>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="news-replay">
|
||||
<textarea id="ccont" placeholder="请输入您的评论..."></textarea>
|
||||
<span class="Release">发布</span>
|
||||
</div>
|
||||
</div>
|
||||
<br class="bottom-margin">
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<input type="hidden" name="content_id" value="<?php echo $detail['id']; ?>">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(".Release").click(function() {
|
||||
var pid = 0;
|
||||
var cid = $("input[name = 'content_id']").val();
|
||||
var content = $("#ccont").val();
|
||||
$.ajax({
|
||||
url: '/mobile/pinglun/add',
|
||||
type: 'post',
|
||||
data: {pid: pid, cid: cid, typeid: 'Article', content: content},
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
if (res) {
|
||||
alert(res.msg);
|
||||
if (res.code == 1) {
|
||||
// 评论成功
|
||||
|
||||
}else if (res.code == -1) {
|
||||
// 未登录
|
||||
|
||||
}else if (res.code == -2) {
|
||||
// 前一分钟内评论过
|
||||
|
||||
}else if (res.code == -3) {
|
||||
// 未知错误
|
||||
|
||||
}else if (res.code == -4) {
|
||||
// 表单格式错误
|
||||
|
||||
}else if (res.code == -5) {
|
||||
// 插入数据库失败
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
137
app/usmobile/view/article/online.2019.4.22/lists.phtml
Executable file
137
app/usmobile/view/article/online.2019.4.22/lists.phtml
Executable file
@@ -0,0 +1,137 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{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="m_Container news">
|
||||
<div class="title text_center title_margin-top">新闻资讯</div>
|
||||
<?php if (!empty($list)): ?>
|
||||
<?php foreach ($list as $key => $value): ?>
|
||||
<div class="news_list newfl">
|
||||
<a href="/mobile/article/detail/id/<?php echo $value['id']; ?>">
|
||||
<div class="left img-responsive"><img src="<?php echo getImage($value['picture']); ?>"></div>
|
||||
<div class="right">
|
||||
<div class="news_list_title nowrap_ellipsis"><?php echo $value['name']; ?></div>
|
||||
<div class="news_list_des_text"><?php echo date("Y-m-d", $value['createtime']); ?></div>
|
||||
<div class="news_list_des_text">
|
||||
<?php
|
||||
if (utf8_strlen($value['description']) > 35) {
|
||||
$value['description'] = msubstr($value['description'], 0, 35);
|
||||
}
|
||||
echo $value['description'];
|
||||
?>
|
||||
</div>
|
||||
</a>
|
||||
<div class="news_list_share">
|
||||
<span><img src="__PUBLIC__/m_web/images/news/news-share.png">分享</span>
|
||||
<span><a href="javascript:void(0);" class="addzan text_gray" data-id="<?php echo $value['id']; ?>"><img src="__PUBLIC__/m_web/images/news/news-Collection.png">点赞 <span class="zan_count<?php echo $value['id']; ?>">(<?php echo $value['zancount']; ?>)</span></a></span>
|
||||
<a href="/mobile/article/detail/id/<?php echo $value['id']; ?>#ccont" class="text_gray">
|
||||
<span><img src="__PUBLIC__/m_web/images/news/news-comment.png">评论(<?php echo $value['commentcount']; ?>)</span>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
<div class="Pages">
|
||||
<span class="p_page">
|
||||
<?php if ($page) echo $page; ?>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<!--精彩评论-->
|
||||
<div class="m_Container">
|
||||
<div class="news-comments">
|
||||
<div class="title text_center title_margin-top">精彩评论</div>
|
||||
<?php if (!empty($hot_comment)): ?>
|
||||
<?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; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<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">点赞(' + 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>
|
||||
Reference in New Issue
Block a user