mirror of
https://gitee.com/ulthon/ulthon_information.git
synced 2026-03-04 00:24:29 +08:00
156 lines
4.7 KiB
HTML
156 lines
4.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{$post.title}</title>
|
|
<meta name="description" content="{$post.desc|default=$post.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>
|
|
|
|
<body>
|
|
<div class="layui-container main-container">
|
|
<div class="layui-row layui-col-space12">
|
|
{include file='common/_left'/}
|
|
<div class="layui-col-md7">
|
|
<div class="main-container">
|
|
<div class="content-container">
|
|
<h1 class="title">
|
|
{$post.title}
|
|
</h1>
|
|
<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>
|
|
</div>
|
|
{if $post.jump_to_url_status == 2 }
|
|
<script>
|
|
window.layuiInitSuccess.push(function () {
|
|
var isJumped = false;
|
|
var countDownNum = 5;
|
|
var closeJump = false;
|
|
var jumpUrl = '{$post.jump_to_url}'
|
|
window.layerJump = layer.confirm('即将自动打开新页面(倒计时<span class="jump-count-dowm">5</span>秒)', {
|
|
btn: ['立即跳转', '取消'],
|
|
offset: ['20%']
|
|
}
|
|
, function (index, layero) {
|
|
//按钮【按钮一】的回调
|
|
window.open(jumpUrl)
|
|
isJumped = true
|
|
layer.close(index)
|
|
}, function (index) {
|
|
//按钮【按钮二】的回调
|
|
closeJump = true
|
|
})
|
|
|
|
window.timerJump = setInterval(() => {
|
|
countDownNum--
|
|
$('.jump-count-dowm').text(countDownNum)
|
|
if (countDownNum <= 0) {
|
|
clearInterval(window.timerJump)
|
|
layer.close(window.layerJump)
|
|
if (!closeJump && !isJumped) {
|
|
window.open(jumpUrl)
|
|
}
|
|
}
|
|
}, 1000);
|
|
})
|
|
</script>
|
|
{/if}
|
|
{/if}
|
|
<div class="ql-snow">
|
|
<article class="ql-editor">{$post->content_html|raw}</article>
|
|
</div>
|
|
<div class="copyright">
|
|
{:get_system_config('post_copyright')}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{include file='common/_right'/}
|
|
|
|
</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) {
|
|
|
|
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>
|
|
|
|
</html> |