init
This commit is contained in:
219
app/index/view/article/detail.phtml
Executable file
219
app/index/view/article/detail.phtml
Executable file
@@ -0,0 +1,219 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head" /}
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/weben/css/cooperation.css">
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
function shareCustomers(){
|
||||
// 复制到粘贴板
|
||||
const input = document.createElement('input')
|
||||
input.setAttribute('readonly', 'readonly')
|
||||
let url=window.location.href
|
||||
input.setAttribute('value', url)
|
||||
document.body.appendChild(input)
|
||||
input.select()
|
||||
if (document.execCommand('copy')) {
|
||||
document.execCommand('copy')
|
||||
alert('链接复制成功')
|
||||
}
|
||||
document.body.removeChild(input)
|
||||
}
|
||||
</script>
|
||||
|
||||
</head>
|
||||
<body>
|
||||
<!--top-->
|
||||
<header class="header-PC header-Product">
|
||||
<div id="header" class="theme-black">
|
||||
</div>
|
||||
</header>
|
||||
{include file="include/top-head2023" /}
|
||||
<!-- 新闻详情页 s -->
|
||||
|
||||
<div class="content-detail">
|
||||
<input type="hidden" value="58" class="b_id">
|
||||
<div class="detail_box clearfix">
|
||||
<div class="blog_detail" >
|
||||
<div class="blog_title">
|
||||
<h2><?php echo $detail['name']; ?></h2>
|
||||
<p><?php echo date("Y-m-d H:i:s",$detail['createtime']); ?></p>
|
||||
</div>
|
||||
<div class="blog_content">
|
||||
<?php echo $detail['content']; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="share_box">
|
||||
<div class="blog_share">
|
||||
<h3>分享</h3>
|
||||
<ul class="share_list clearfix">
|
||||
<!-- Go to www.addthis.com/dashboard to customize your tools -->
|
||||
<li><a target="_blank" href="https://weibo.com/"><img src="/frontend/web/images/blog/share1.png"></a></li>
|
||||
<li class="wechat"><img src="/frontend/web/images/blog/share2.png"> <div class="wechat_code" ><img src="/frontend/web/images/erweima-blog.png"></div></li>
|
||||
<li><a target="_blank" href="https://creator.xiaohongshu.com/login?redirectReason=401"><img src="/frontend/web/images/blog/share3.png"></a></li>
|
||||
<li><a href="javascript:shareCustomers();" title="submit to reddit"><img src="/frontend/web/images/blog/share4.png"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="repply">
|
||||
<h3>留言</h3>
|
||||
<form>
|
||||
<span>名称</span>
|
||||
<input class="form-control itinp new_name" type="text" name="name" style="text-indent: 10px;">
|
||||
<span>电子邮件</span>
|
||||
<input class="form-control itinp new_email" type="email" name="email" style="text-indent: 10px; margin-bottom:0;">
|
||||
<p style="color: #C6C7C9; font-size: 0.75rem; margin-bottom: 0.625rem;">您的电子邮件地址不会被公开</p>
|
||||
<span>留言</span>
|
||||
<textarea class="form-control itinp new_comment" rows="3" style="text-indent: 10px;width: 98%; margin-top: 0.625rem;margin-bottom: 0.625rem;border: 1px solid #DBDBDB;" name="comment"></textarea>
|
||||
<div class="comment_btn" style="color:#ffffff;">提交留言</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="xq">
|
||||
<?php
|
||||
$articles = getDifferentArticle('default', 3, ['id' => ['neq', $detail['id']]], ['createtime'=>'desc']);
|
||||
if ($articles):
|
||||
|
||||
?>
|
||||
<!-- 猜您喜欢 -->
|
||||
<div class="love">
|
||||
<div class="love1">
|
||||
<p>你可能还喜欢</p>
|
||||
<p><img src="/frontend/web/images/1line.png"></p>
|
||||
</div>
|
||||
<ul class="love2">
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<?php
|
||||
if($article['jump_link'] == ''){
|
||||
$rlink = "__ORICOROOT__/article/detail/".$article['id'].".html";
|
||||
}
|
||||
else{
|
||||
$rlink = $article['jump_link'];
|
||||
}
|
||||
?>
|
||||
<li>
|
||||
<a href="<?php echo $rlink; ?>">
|
||||
<div class="lvimg"><img src="<?php echo getImage($article['picture']); ?>"></div>
|
||||
<p class="lvtit"><?php echo msubstr($article['name'], 0, 40); ?></p>
|
||||
</a>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
<div class="clear"></div>
|
||||
</ul>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
|
||||
$(function() {
|
||||
var fix = $('.share_box'); //滚动悬浮块
|
||||
var end = $('.xq'); //滚动到这个元素后结束固定
|
||||
var fixTop = fix.offset().top, //滚动悬浮块与顶部的距离
|
||||
fixHeight = fix.height(); //滚动悬浮块高度
|
||||
var endTop, miss; //结束元素与顶部的距离
|
||||
$(window).scroll(function() {
|
||||
//页面与顶部高度
|
||||
var docTop = Math.max(document.body.scrollTop, document.documentElement.scrollTop);
|
||||
//如果有结束块
|
||||
if (end.length > 0) {
|
||||
endTop = end.offset().top;
|
||||
miss = endTop - docTop - fixHeight;
|
||||
}
|
||||
if (fixTop < docTop) {
|
||||
fix.css({'position': 'fixed'});
|
||||
if ((end.length > 0) && (endTop < (docTop + fixHeight))) {
|
||||
fix.css({top: miss}); //滚动悬浮块滑到结束块上时,top值为负,即慢慢隐藏出浏览器
|
||||
} else{
|
||||
fix.css({top: 100}); //滚动悬浮块未到结束块上时,top为0
|
||||
}
|
||||
} else {
|
||||
fix.css({'position': 'fixed'});
|
||||
}
|
||||
})
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
// 提交表单
|
||||
$('.comment_btn').click(function(){
|
||||
var new_name = $('.new_name').val();
|
||||
var new_email = $('.new_email').val();
|
||||
var new_comment = $('.new_comment').val();
|
||||
|
||||
console.log('message');
|
||||
if (new_name == '') {
|
||||
//alert("The Name is Empty!");
|
||||
|
||||
$('.new_name').addClass('error');
|
||||
$('.new_name').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_name').removeClass('error');
|
||||
$('.new_name').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
|
||||
if (new_comment == '') {
|
||||
//alert("The Comment is Empty!");
|
||||
|
||||
$('.new_comment').addClass('error');
|
||||
$('.new_comment').next('span').removeClass('hide');
|
||||
return false;
|
||||
}else{
|
||||
$('.new_comment').removeClass('error');
|
||||
$('.new_comment').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
if (new_email == '') {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
}
|
||||
else{
|
||||
if (/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(new_email) == false) {
|
||||
$('.new_email').addClass('error');
|
||||
$('.new_email').next('span').removeClass('hide');
|
||||
return false;
|
||||
}
|
||||
else{
|
||||
$('.new_email').removeClass('error');
|
||||
$('.new_email').next('span').addClass('hide');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
var bid = "<?php echo $detail['id'];?>";
|
||||
//点击创建申请块
|
||||
if(new_name && new_email && new_comment && bid) {
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/index/article/addcomment",
|
||||
data: {'name':new_name, 'email':new_email,'comment':new_comment,'article_id':bid},
|
||||
dataType: "json",
|
||||
success: function(data){
|
||||
if(data.code == 200) {
|
||||
alert("留言提交成功!");
|
||||
$(".new_name").val("");
|
||||
$(".new_email").val("");
|
||||
$(".new_comment").val("");
|
||||
}
|
||||
else{
|
||||
alert(data.msg);
|
||||
}
|
||||
}
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
})
|
||||
|
||||
</script>
|
||||
<!-- bottom s -->
|
||||
{include file="include/bottom2023" /}
|
||||
<!-- bottom e -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user