diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 8dda8f58..367444cb 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -89,6 +89,10 @@ class Article extends Common ->find(); View::assign('detail', $detail); + // 获取分享配置相关 + $share_config = $this->getSysConfig($this->lang_id, ['article_share']); + View::assign('share_config', $share_config['article_share']); + // 获取倒序或发布时间倒序3篇文章做为推荐文章 $recommends = ArticleModel::field([ 'id', diff --git a/app/index/view/article/detail.html b/app/index/view/article/detail.html index f4f84554..ea195d5c 100644 --- a/app/index/view/article/detail.html +++ b/app/index/view/article/detail.html @@ -11,7 +11,7 @@ {/notempty} {/block} {block name="style"} - + {/block} {block name="main"}
@@ -26,23 +26,23 @@
{$detail.content|raw}
+ {notempty name="share_config"}

{:lang('article.detail_share')}

- + {/notempty}

{:lang('article.detail_leave_reply')}

@@ -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) + } {/block} \ No newline at end of file diff --git a/app/index/view/article/index.html b/app/index/view/article/index.html index 9703f86e..a917f3a6 100644 --- a/app/index/view/article/index.html +++ b/app/index/view/article/index.html @@ -1,6 +1,6 @@ {extend name="public/base" /} {block name="style"} - + {/block} {block name="main"}
diff --git a/public/static/index/css/category.css b/public/static/index/css/article_category.css similarity index 100% rename from public/static/index/css/category.css rename to public/static/index/css/article_category.css diff --git a/public/static/index/css/articleDetail.css b/public/static/index/css/article_detail.css similarity index 94% rename from public/static/index/css/articleDetail.css rename to public/static/index/css/article_detail.css index 70d3ed88..002358f5 100755 --- a/public/static/index/css/articleDetail.css +++ b/public/static/index/css/article_detail.css @@ -89,11 +89,21 @@ .orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit { float: left; margin-right: 3.125rem; + position: relative; } .orico_Page_articleDetail .articleDetailMain .atmright .blog_share .share_list .atdit img { margin: 0 auto; 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 { width: 100%; height: auto;