init
This commit is contained in:
269
app/usmobile/view/article/detail.phtml
Executable file
269
app/usmobile/view/article/detail.phtml
Executable file
@@ -0,0 +1,269 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
{include file="include/head-seo" /}
|
||||
{include file="include/head" /}
|
||||
<script type="text/javascript">
|
||||
var navID = "1";
|
||||
</script>
|
||||
</head>
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/m_web/css/jquery.bxslider.css">
|
||||
<link rel="stylesheet" type="text/css" href="__PUBLIC__/m_web/js/jquery.bxslider.min.js">
|
||||
<style>
|
||||
.bx-wrapper {margin-bottom:2rem !important;}
|
||||
.bx-wrapper .bx-pager, .bx-wrapper .bx-controls-auto {bottom: 0 !important;}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a {width:10px !important;height:10px !important;color: transparent;margin-right:0.5rem;border-radius: 7px !important;border:none !important;background: #c6ced6; display:inline-block;}
|
||||
.bx-wrapper .bx-pager.bx-default-pager a.active { background: #004bfa;width: 20px;height: 10px;color: transparent;}
|
||||
.bx-wrapper .bx-pager {text-align: center;font-size: .85em;font-family: Arial;font-weight: bold;color: #666;padding-top: 20px;}
|
||||
.slide a {color: #333;}
|
||||
.slide a:hover {color: #333;}
|
||||
.slide p {height:32px; overflow: hidden;}
|
||||
</style>
|
||||
<body>
|
||||
|
||||
<div id="content">
|
||||
<!--头部-->
|
||||
{include file="include/top" /}
|
||||
<!-- 详情页 s -->
|
||||
<div class="content" style="margin-top: 60px;">
|
||||
<input type="hidden" class="b_id">
|
||||
<div class="clearfix">
|
||||
<div class="blog_detail">
|
||||
<div class="blog_title">
|
||||
<h2><?php echo $detail['name']; ?></h2>
|
||||
<p><?php echo date("M j, Y",$detail['createtime']); ?> </p>
|
||||
</div>
|
||||
<div class="blog_content">
|
||||
<?php echo $detail['content']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="share_box">
|
||||
<div class="blog_share">
|
||||
<h3>SHARE</h3>
|
||||
<ul class="share_list clearfix">
|
||||
<li><a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&t=1709023114"><img src="/frontend/weben/images/blog/share1.png"/></a></li>
|
||||
<li><a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&ro=true&title=<?php echo $detail['name']; ?>&url=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&source=&summary=&armin=armin"><img src="/frontend/weben/images/blog/share2.png"/></a></li>
|
||||
<li><a target="_blank" href="https://twitter.com/ORICO_Official"><img src="/frontend/weben/images/blog/share3.png"/></a></li>
|
||||
<li><a href="http://www.reddit.com/submit?url=__ORICOROOT__<?php echo url_rewrite('articledetail', array('id' => $detail['id'])); ?>&title=<?php echo $detail['name'];?>" title="submit to reddit" ><img src="/frontend/weben/images/blog/share4.png"/></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="comment">
|
||||
<h3>Leave a Reply</h3>
|
||||
<form class="comment_form clearfix">
|
||||
<div style="margin-right: 0.625rem; margin-bottom: 0.5rem;">Name:<br>
|
||||
<input class="form-control itinp new_name" type="text" name="name">
|
||||
</div>
|
||||
<div>Email:<br>
|
||||
<input class="form-control itinp new_email" type="email" name="email">
|
||||
<p style="color: #C6C7C9; font-size: 0.75rem; margin-bottom: 0.5rem; ">Your email address will not be pulished.</p>
|
||||
</div>
|
||||
<div class="comment_area">Comment:<br>
|
||||
<textarea class="form-control itinp new_comment" style="height: 3rem;border: 1px solid #DBDBDB;" name="comment"></textarea>
|
||||
</div>
|
||||
</form>
|
||||
<div class="comment_btn" style="color:#ffffff;">POST COMMENT</div>
|
||||
</div>
|
||||
<div class="xq">
|
||||
<div class="swt-Container">
|
||||
<?php
|
||||
$articles = getDifferentArticle('default', 3, ['cid' => ["in",['16','32']], 'id' => ['neq', $detail['id']]]);
|
||||
if ($articles):
|
||||
|
||||
?>
|
||||
<!-- 猜您喜欢 -->
|
||||
<div class="love">
|
||||
<div class="love1">
|
||||
<p>Recommended for you</p>
|
||||
<p><img src="/frontend/web/images/1line.png"></p>
|
||||
</div>
|
||||
<div class="love2 clearfix">
|
||||
<!--图片滑动-->
|
||||
<div class="loves">
|
||||
<?php foreach ($articles as $article): ?>
|
||||
<?php
|
||||
if($article['jump_link'] == ''){
|
||||
$rlink = "__ORICOROOT__/article/detail/".$article['id'].".html";
|
||||
}
|
||||
else{
|
||||
$rlink = $article['jump_link'];
|
||||
}
|
||||
?>
|
||||
<div class="slide">
|
||||
<a href="<?php echo $rlink; ?>">
|
||||
<img src="<?php echo getImage($article['picture']); ?>">
|
||||
<p class="lvtit"><?php echo msubstr($article['name'], 0, 40); ?></p>
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; ?>
|
||||
|
||||
</div>
|
||||
<!--图片滑动-->
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<!--底部-->
|
||||
{include file="include/bottom" /}
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
<input type="hidden" name="content_id" value="<?php echo $detail['id']; ?>">
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
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('Link copied successfully')
|
||||
}
|
||||
document.body.removeChild(input)
|
||||
}
|
||||
|
||||
$(document).ready(function() {
|
||||
|
||||
|
||||
|
||||
$(".Release").click(function() {
|
||||
var customer_id = localStorage.getItem("uer_id");
|
||||
var firstname = localStorage.getItem("user_info") ? localStorage.getItem("user_info").firstname : '';
|
||||
var pid = 0;
|
||||
var cid = $("input[name = 'content_id']").val();
|
||||
var content = $("#ccont").val();
|
||||
var customer_id = 1;
|
||||
var firstname = 'abc';
|
||||
$.ajax({
|
||||
url: '__ORICOROOT__/pinglun/add',
|
||||
type: 'post',
|
||||
data: {customer_id: customer_id, firstname: firstname, 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) {
|
||||
// 插入数据库失败
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// 提交表单
|
||||
$('.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: "/us/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>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
$('.loves').bxSlider({
|
||||
slideWidth: 200,
|
||||
minSlides: 2,
|
||||
maxSlides: 2,
|
||||
infiniteLoop: false,
|
||||
slideMargin: 10
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user