删除文章分享到QQ,分享到微信朋友圈,文章更新时间

This commit is contained in:
1152958806@qq.com 2024-01-02 20:11:48 +08:00
parent a4f630de60
commit 921e9c9ff3
6 changed files with 11 additions and 147 deletions

View File

@ -1307,15 +1307,6 @@ spec:
value: true value: true
- label: 关闭 - label: 关闭
value: false value: false
- $formkit: radio
name: article_date_show
label: 文章“发表于”、“更新于”展示
value: true
options:
- label: 打开
value: true
- label: 关闭
value: false
- $formkit: group - $formkit: group
name: aiDescription name: aiDescription
label: 文章 AI 摘要 label: 文章 AI 摘要
@ -1498,24 +1489,6 @@ spec:
value: true value: true
- label: 禁用 - label: 禁用
value: false value: false
- $formkit: radio
name: qq_edit
help: 启用分享到QQ
value: true
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: radio
name: wechat_edit
help: 启用分享到微信朋友圈
value: true
options:
- label: 启用
value: true
- label: 禁用
value: false
- $formkit: group - $formkit: group
name: copyrights name: copyrights
label: 版权声明 label: 版权声明

View File

@ -262,54 +262,6 @@ rm.sharePage = function () {
rm.hideRightMenu(); rm.hideRightMenu();
} }
function isMobileDevice() {
return /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);
}
rm.shareToQQ = function () {
var url = /*[[${post.status.permalink}]]*/ window.location.href;
var title = $('#post-info .post-title')[0].innerText;
if (isMobileDevice()) {
// 使用手机分享方式
window.location.href = "mqqapi://share/to_fri?src_type=web&version=1&file_type=news&url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title) + "&callback_type=scheme&generalpastboard=1";
} else {
// 使用Web分享方式
window.open("https://connect.qq.com/widget/shareqq/index.html?url=" + encodeURIComponent(url) + "&title=" + encodeURIComponent(title));
}
btf.snackbarShow('分享链接地址成功', false, 2000);
rm.hideRightMenu();
}
rm.shareToWechat = function () {
// 手机分享逻辑
if (isMobileDevice) {
wx.config({
// 配置微信的appID、timestamp、nonceStr、signature等参数
// ...
debug: false,
jsApiList: ['onMenuShareTimeline'] // 需要使用的微信接口
});
wx.ready(function () {
wx.onMenuShareTimeline({
title: $('#post-info .post-title')[0].innerText,
link: window.location.href,
imgUrl: $('#coverdiv img')[0].src,
success: function () {
btf.snackbarShow('分享链接地址成功', false, 2000);
rm.hideRightMenu();
},
cancel: function () {
btf.snackbarShow('分享链接地址失败', false, 2000);
rm.hideRightMenu();
}
});
});
}
}
// 复制当前选中文本 // 复制当前选中文本
var selectTextNow = ''; var selectTextNow = '';
document.onmouseup = document.ondbclick = selceText; document.onmouseup = document.ondbclick = selceText;

View File

@ -163,8 +163,6 @@
<!-- 复制 https://githubfast.com/zenorocha/clipboard.js --> <!-- 复制 https://githubfast.com/zenorocha/clipboard.js -->
<script th:src="${assets_link + '/libs/clipboard/clipboard.min.js'}"></script> <script th:src="${assets_link + '/libs/clipboard/clipboard.min.js'}"></script>
<script th:if="${theme.config.post.share_right.wechat_edit}" src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
<!-- 关于统计--> <!-- 关于统计-->
<script th:if="${#strings.contains(theme.config.about.widgetList,'statistics-map')}" th:src="${assets_link + '/libs/countup/countup.js'}"></script> <script th:if="${#strings.contains(theme.config.about.widgetList,'statistics-map')}" th:src="${assets_link + '/libs/countup/countup.js'}"></script>

View File

@ -55,39 +55,28 @@
</span> </span>
</th:block> </th:block>
<!-- 创建时间 --> <!-- 创建时间 -->
<span class="post-meta-date" <span class="post-meta-date" th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}">
th:with="days=${(new java.util.Date().getTime()-post.spec.publishTime.toEpochMilli())/86400000}"> <i class="far fa-calendar-alt"></i>
<i class="haofont hao-icon-linggan"></i> <time style="display: inline;"
<time style="display: inline;color: #a599e9"
th:datetime="${post.spec.publishTime}" th:datetime="${post.spec.publishTime}"
th:if="${days > 30}" th:if="${days > 30}"
th:text="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
<time style="display: inline;"
th:datetime="${post.spec.publishTime}"
th:if="${days <= 30 && days > 0}"
th:text="${days}+天前" th:text="${days}+天前"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建"> th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time> </time>
<time style="display: inline;color: #75a7ca" <time style="display: inline;"
th:datetime="${post.spec.publishTime}"
th:if="${days <= 30 && days > 0}"
th:text="最近发布"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time>
<time style="display: inline;color: #0ec0ea"
th:datetime="${post.spec.publishTime}" th:datetime="${post.spec.publishTime}"
th:if="${days == 0}" th:if="${days == 0}"
th:text="今日上新" th:text="最近"
th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建"> th:title="${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}+创建">
</time> </time>
</span> </span>
</div> </div>
<div class="dateshow" media="screen and (min-width: 1024px)" th:if="${theme.config.post.article_date_show}">
<i class="haofont hao-icon-calendar-alt dateshowicon"></i>
<span class="banner-button-text"
th:text="发表于 + '&nbsp;' + ${#dates.format(post.spec.publishTime,'yyyy-MM-dd')}"></span>
&nbsp;&nbsp;
<i class="haofont hao-icon-history dateshowicon"></i>
<span class="banner-button-text"
th:text="更新于 + '&nbsp;' + ${#dates.format(post.status.lastModifyTime,'yyyy-MM-dd')}"></span>
</div>
</div> </div>
@ -110,34 +99,6 @@
transform: translateX(100%) skewX(-60deg); transform: translateX(100%) skewX(-60deg);
} }
</style> </style>
<style>
.dateshow {
font-size: 12px;
position: absolute;
bottom: 10px;
transition: 0.3s;
display: flex;
flex-direction: row;
flex-wrap: nowrap;
width: 100%;
left: 0;
padding: 0 32px;
white-space: nowrap;
color: var(--heo-fontcolor);
height: 20px;
}
i.haofont.hao-icon-calendar-alt.dateshowicon {
font-size: 14px;
margin-top: 5px;
}
i.haofont.hao-icon-history.dateshowicon {
font-size: 14px;
margin-top: 5px;
}
</style>
</div> </div>
<!-- 分页 --> <!-- 分页 -->

View File

@ -61,16 +61,6 @@
<div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i <div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i
class="haofont hao-icon-link"></i></div> class="haofont hao-icon-link"></i></div>
</div> </div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.qq_edit}">
<div class="share-button" id="post-share-url-qq" onclick="rm.shareToQQ()" title="分享到QQ">
<i class="haofont hao-icon-qq" style="font-size:19px"></i>
</div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.wechat_edit}">
<div class="share-button" id="post-share-url-wechat" onclick="rm.shareToWechat()" title="分享到微信朋友圈">
<i class="haofont hao-icon-weixin" style="font-size:22px"></i>
</div>
</div>
</div> </div>
<div class="post-tools-right"> <div class="post-tools-right">
<div class="tag_share"> <div class="tag_share">

View File

@ -67,16 +67,6 @@
<div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i <div class="share-button" id="post-share-url" onclick="rm.copyPageUrl()" title="复制链接"><i
class="haofont hao-icon-link"></i></div> class="haofont hao-icon-link"></i></div>
</div> </div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.qq_edit}">
<div class="share-button" id="post-share-url-qq" onclick="rm.shareToQQ()" title="分享到QQ">
<i class="haofont hao-icon-qq" style="font-size:19px"></i>
</div>
</div>
<div class="share-link weibo" th:if="${theme.config.post.share_right.wechat_edit}">
<div class="share-button" id="post-share-url-wechat" onclick="rm.shareToWechat()" title="分享到微信朋友圈">
<i class="haofont hao-icon-weixin" style="font-size:22px"></i>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>