mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-03 16:24:28 +08:00
完成文案分享
This commit is contained in:
@@ -176,6 +176,20 @@
|
||||
<textarea class="layui-textarea" name="post_copyright" >{:get_system_config('post_copyright')}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-form-label">作品文本分享模板
|
||||
<p class="layui-word-aux">
|
||||
%post_title%:文章标题<br>
|
||||
%post_desc%:文章简介<br>
|
||||
%post_url%:文章链接<br>
|
||||
</p>
|
||||
</div>
|
||||
<div class="layui-input-block">
|
||||
|
||||
|
||||
<textarea class="layui-textarea" name="post_share_text_tpl" >{:get_system_config('post_share_text_tpl')}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<button class="layui-btn layui-btn-fluid" submit lay-submit lay-filter="site-info">保存</button>
|
||||
</div>
|
||||
|
||||
@@ -6,13 +6,40 @@
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{$post.title}</title>
|
||||
{include file='common/_require'/}
|
||||
|
||||
<link rel="stylesheet" href="/static/lib/quill/quill.snow.css">
|
||||
<link rel="stylesheet" href="/static/lib/highlight/styles/vs.css">
|
||||
<script src="/static/lib/highlight/highlight.pack.js"></script>
|
||||
<script src="/static/lib/clipboard/clipboard.js"></script>
|
||||
<style>
|
||||
.ql-editor {
|
||||
padding: unset
|
||||
}
|
||||
|
||||
.share {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.share i {
|
||||
font-size: 15px;
|
||||
}
|
||||
|
||||
.share-tips-options div:hover {
|
||||
opacity: 0.8;
|
||||
}
|
||||
|
||||
.share-tips-options div {
|
||||
|
||||
height: 22px;
|
||||
line-height: 22px;
|
||||
|
||||
white-space: nowrap;
|
||||
text-align: center;
|
||||
font-size: 12px;
|
||||
border: none;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
@@ -29,13 +56,16 @@
|
||||
<div class="info">
|
||||
<span>{$post->publish_time_text}</span>
|
||||
<span>{:get_system_config('default_author')}</span>
|
||||
<span class="share"><i class="layui-icon layui-icon-share"></i></span>
|
||||
|
||||
</div>
|
||||
<div class="desc">
|
||||
{$post.desc_html}
|
||||
</div>
|
||||
{if !empty($post.jump_to_url) && $post.jump_to_url_status != 0}
|
||||
<div class="jump-container">
|
||||
<a href="{$post.jump_to_url}" class="layui-btn jump-btn" target="_blank">{$post.jump_to_btn_title|default='立即跳转'}</a>
|
||||
<a href="{$post.jump_to_url}" class="layui-btn jump-btn"
|
||||
target="_blank">{$post.jump_to_btn_title|default='立即跳转'}</a>
|
||||
</div>
|
||||
{if $post.jump_to_url_status == 2 }
|
||||
<script>
|
||||
@@ -46,7 +76,7 @@
|
||||
var jumpUrl = '{$post.jump_to_url}'
|
||||
window.layerJump = layer.confirm('即将自动打开新页面(倒计时<span class="jump-count-dowm">5</span>秒)', {
|
||||
btn: ['立即跳转', '取消'],
|
||||
offset:['20%']
|
||||
offset: ['20%']
|
||||
}
|
||||
, function (index, layero) {
|
||||
//按钮【按钮一】的回调
|
||||
@@ -86,7 +116,9 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="share-tips-options" style="display: none;">
|
||||
<div class="text" data-clipboard-text="{$post.share_text}">分享文案</div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$('.ql-editor pre').each(function (n, e) {
|
||||
@@ -94,6 +126,30 @@
|
||||
hljs.highlightBlock(e);
|
||||
})
|
||||
|
||||
$('.share').click(function () {
|
||||
var html = $('.share-tips-options').prop("outerHTML")
|
||||
|
||||
window.layerTips = layer.tips(html, this, {
|
||||
tips: 2,
|
||||
time: 0,
|
||||
skin: 'share-tips',
|
||||
success: function (layero) {
|
||||
console.log(layero);
|
||||
$(layero.css('top', $(layero).offset()['top'] - 15))
|
||||
$(layero).find('.share-tips-options').show()
|
||||
|
||||
}
|
||||
})
|
||||
})
|
||||
$(document).click(function (e) {
|
||||
if ($(e.target).closest('.share').length == 0 && $(e.target).closest('.share-tips').length == 0) {
|
||||
layer.close(window.layerTips)
|
||||
}
|
||||
})
|
||||
var clipboard = new ClipboardJS('.share-tips .share-tips-options .text')
|
||||
clipboard.on('success', function (e) {
|
||||
layer.msg('复制成功')
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user