refactor: 文章
This commit is contained in:
@@ -89,6 +89,10 @@ class Article extends Common
|
|||||||
->find();
|
->find();
|
||||||
View::assign('detail', $detail);
|
View::assign('detail', $detail);
|
||||||
|
|
||||||
|
// 获取分享配置相关
|
||||||
|
$share_config = $this->getSysConfig($this->lang_id, ['article_share']);
|
||||||
|
View::assign('share_config', $share_config['article_share']);
|
||||||
|
|
||||||
// 获取倒序或发布时间倒序3篇文章做为推荐文章
|
// 获取倒序或发布时间倒序3篇文章做为推荐文章
|
||||||
$recommends = ArticleModel::field([
|
$recommends = ArticleModel::field([
|
||||||
'id',
|
'id',
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
{/notempty}
|
{/notempty}
|
||||||
{/block}
|
{/block}
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<link rel="stylesheet" href="__CSS__/articleDetail.css">
|
<link rel="stylesheet" href="__CSS__/article_detail.css">
|
||||||
{/block}
|
{/block}
|
||||||
{block name="main"}
|
{block name="main"}
|
||||||
<div class="orico_Page_articleDetail">
|
<div class="orico_Page_articleDetail">
|
||||||
@@ -26,23 +26,23 @@
|
|||||||
<div class="blog_content">{$detail.content|raw}</div>
|
<div class="blog_content">{$detail.content|raw}</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="atmright">
|
<div class="atmright">
|
||||||
|
{notempty name="share_config"}
|
||||||
<div class="blog_share">
|
<div class="blog_share">
|
||||||
<h3>{:lang('article.detail_share')}</h3>
|
<h3>{:lang('article.detail_share')}</h3>
|
||||||
<div class="share_list clearfix">
|
<div class="share_list">
|
||||||
<a class="atdit" target="_blank" href="https://weibo.com/">
|
{volist name="share_config" id="sc"}
|
||||||
<img src="__IMAGES__/share1.png" />
|
<a class="atdit" {if condition="!empty($sc.is_blank) && $sc.is_blank.value == 1"}target="_blank"{/if} {notempty name="sc.url.value"}href="{$sc.url.value}"{/notempty}>
|
||||||
</a>
|
<img src="{$sc.image.value}" />
|
||||||
<a class="atdit">
|
{eq name=":array_key_exists('triggered_qrcode', $sc)" value="true"}
|
||||||
<img src="__IMAGES__/share2.png" />
|
<div class="triggered_qrcode">
|
||||||
</a>
|
<img src="{$sc.triggered_qrcode.value}" />
|
||||||
<a class="atdit" target="_blank" href="https://creator.xiaohongshu.com/login?redirectReason=401">
|
</div>
|
||||||
<img src="__IMAGES__/share3.png" />
|
{/eq}
|
||||||
</a>
|
|
||||||
<a class="atdit" href="javascript:shareCustomers();">
|
|
||||||
<img src="__IMAGES__/share4.png" />
|
|
||||||
</a>
|
</a>
|
||||||
|
{/volist}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{/notempty}
|
||||||
<div class="repply">
|
<div class="repply">
|
||||||
<h3>{:lang('article.detail_leave_reply')}</h3>
|
<h3>{:lang('article.detail_leave_reply')}</h3>
|
||||||
<form action="{:url('article/comment', ['id' => $detail.id])}" method="POST" autocomplete="off">
|
<form action="{:url('article/comment', ['id' => $detail.id])}" method="POST" autocomplete="off">
|
||||||
@@ -102,5 +102,19 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
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>
|
</script>
|
||||||
{/block}
|
{/block}
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{extend name="public/base" /}
|
{extend name="public/base" /}
|
||||||
{block name="style"}
|
{block name="style"}
|
||||||
<link rel="stylesheet" type="text/css" href="__CSS__/category.css" />
|
<link rel="stylesheet" type="text/css" href="__CSS__/article_category.css" />
|
||||||
{/block}
|
{/block}
|
||||||
{block name="main"}
|
{block name="main"}
|
||||||
<div class="orico_Page_category">
|
<div class="orico_Page_category">
|
||||||
|
|||||||
@@ -89,11 +89,21 @@
|
|||||||
.orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit {
|
.orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit {
|
||||||
float: left;
|
float: left;
|
||||||
margin-right: 3.125rem;
|
margin-right: 3.125rem;
|
||||||
|
position: relative;
|
||||||
}
|
}
|
||||||
.orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit img {
|
.orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit img {
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
.orico_Page_articleDetail .articleDetailMain .atmright .atdit .triggered_qrcode {
|
||||||
|
display: none;
|
||||||
|
position: absolute;
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
}
|
||||||
|
.orico_Page_articleDetail .articleDetailMain .atmright .atdit:hover .triggered_qrcode {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
.orico_Page_articleDetail .articleDetailMain .atmright .repply {
|
.orico_Page_articleDetail .articleDetailMain .atmright .repply {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
Reference in New Issue
Block a user