99 lines
2.6 KiB
PHTML
Executable File
99 lines
2.6 KiB
PHTML
Executable File
<!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>
|