适配新接口、插件;更新附录、通知书、课外书;修复、优化部分功能
This commit is contained in:
@@ -706,7 +706,7 @@
|
||||
}
|
||||
|
||||
.douban_page #douban_item .douban_title_text {
|
||||
color: #111827;
|
||||
color: var(--pix-theme);
|
||||
font-size: 16px;
|
||||
line-height: 1.35;
|
||||
font-weight: 650;
|
||||
@@ -714,7 +714,7 @@
|
||||
}
|
||||
|
||||
.douban_page #douban_item .douban_title_text:hover {
|
||||
color: var(--pix-theme);
|
||||
color: rgb(28, 156, 90);
|
||||
}
|
||||
|
||||
.douban_page #douban_item .douban_sub_meta {
|
||||
|
||||
@@ -344,10 +344,6 @@ function init_douban_page() {
|
||||
if (Number.isNaN(scoreNumber)) {
|
||||
return null;
|
||||
}
|
||||
// 豆瓣常见是 10 分制,这里统一转换为 5 星展示
|
||||
if (scoreNumber > 5) {
|
||||
scoreNumber = scoreNumber / 2;
|
||||
}
|
||||
if (scoreNumber < 0) {
|
||||
scoreNumber = 0;
|
||||
}
|
||||
@@ -357,16 +353,28 @@ function init_douban_page() {
|
||||
return scoreNumber;
|
||||
}
|
||||
|
||||
function getTypeNameCN(typeCode) {
|
||||
var typeMap = {
|
||||
'music': '音乐',
|
||||
'drama': '演出',
|
||||
'book': '图书',
|
||||
'game': '游戏',
|
||||
'movie': '影视',
|
||||
// 'test': '测试'
|
||||
};
|
||||
return typeMap[typeCode] || typeCode;
|
||||
function renderTypeNav(typeList) {
|
||||
var $navList = $('.douban_cat_nav ul');
|
||||
if ($navList.length === 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var navHtml = ['<li><a data-type="" class="cat-link active">全部<span></span></a></li>'];
|
||||
var seen = {};
|
||||
|
||||
if (Array.isArray(typeList)) {
|
||||
typeList.forEach(function (item) {
|
||||
var key = item && item.key !== undefined && item.key !== null ? String(item.key).trim() : '';
|
||||
if (!key || seen[key]) {
|
||||
return;
|
||||
}
|
||||
seen[key] = true;
|
||||
var safeKey = escapeHtml(key);
|
||||
navHtml.push('<li><a data-type="' + safeKey + '" class="cat-link">' + safeKey + '<span></span></a></li>');
|
||||
});
|
||||
}
|
||||
|
||||
$navList.html(navHtml.join(''));
|
||||
}
|
||||
|
||||
function renderScore(rawScore) {
|
||||
@@ -386,7 +394,7 @@ function init_douban_page() {
|
||||
var poster = escapeHtml(spec.poster || '/themes/theme-pix/assets/img/theme/banner.jpg');
|
||||
var rawScore = faves.score || spec.score || '';
|
||||
var createTime = escapeHtml(formatTime(faves.createTime));
|
||||
var dataType = getTypeNameCN(spec.type || '--');
|
||||
var dataType = escapeHtml(spec.type || '--');
|
||||
var contentText = escapeHtml(spec.cardSubtitle || '暂无内容简介');
|
||||
var pid = escapeHtml((item.metadata && item.metadata.name) || ('douban-' + Date.now()));
|
||||
var scoreText = renderScore(rawScore);
|
||||
@@ -476,7 +484,7 @@ function init_douban_page() {
|
||||
$btn.text('收起');
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('.douban_content_main').each(function () {
|
||||
var $content = $(this);
|
||||
var $btn = $content.next('.douban_expand_btn');
|
||||
@@ -658,23 +666,37 @@ function init_douban_page() {
|
||||
return false;
|
||||
});
|
||||
|
||||
var urlTag = new URLSearchParams(window.location.search).get('tag');
|
||||
if (urlTag && urlTag.trim() !== '') {
|
||||
var $matchedTag = $('.douban_cat_nav .cat-link').filter(function () {
|
||||
var tagText = $(this).clone().find('span').remove().end().text().trim();
|
||||
return tagText === urlTag;
|
||||
}).first();
|
||||
if ($matchedTag.length > 0) {
|
||||
$matchedTag.addClass('active').parent().siblings().children('.cat-link').removeClass('active');
|
||||
state.type = $matchedTag.attr('data-type') || '';
|
||||
function applyUrlTagState() {
|
||||
var urlTag = new URLSearchParams(window.location.search).get('tag');
|
||||
if (urlTag && urlTag.trim() !== '') {
|
||||
var $matchedTag = $('.douban_cat_nav .cat-link').filter(function () {
|
||||
var tagText = $(this).clone().find('span').remove().end().text().trim();
|
||||
return tagText === urlTag;
|
||||
}).first();
|
||||
if ($matchedTag.length > 0) {
|
||||
$matchedTag.addClass('active').parent().siblings().children('.cat-link').removeClass('active');
|
||||
state.type = $matchedTag.attr('data-type') || '';
|
||||
} else {
|
||||
state.type = $('.douban_cat_nav .cat-link.active').attr('data-type') || '';
|
||||
}
|
||||
} else {
|
||||
state.type = $('.douban_cat_nav .cat-link.active').attr('data-type') || '';
|
||||
}
|
||||
} else {
|
||||
state.type = $('.douban_cat_nav .cat-link.active').attr('data-type') || '';
|
||||
}
|
||||
|
||||
requestList(1, state.type, false);
|
||||
$.ajax({
|
||||
type: 'GET',
|
||||
url: '/apis/api.douban.moony.la/v1alpha1/doubanmovies/-/types',
|
||||
dataType: 'json',
|
||||
success: function (data) {
|
||||
var typeList = Array.isArray(data) ? data : ((data && Array.isArray(data.items)) ? data.items : []);
|
||||
renderTypeNav(typeList);
|
||||
},
|
||||
complete: function () {
|
||||
applyUrlTagState();
|
||||
requestList(1, state.type, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// 打开确认模态框
|
||||
|
||||
@@ -133,25 +133,6 @@ cocoMessage.config({
|
||||
duration: 2000,
|
||||
});
|
||||
|
||||
//sortable事件 隐藏input
|
||||
UIkit.util.on('.img_show', 'start', function (item) {
|
||||
$(".up_img_btn").hide();
|
||||
});
|
||||
UIkit.util.on('.img_show', 'moved', function (item) {
|
||||
var img_num = $('.add_img_box .t_media_item').length;
|
||||
if (img_num < 9) {
|
||||
$(".up_img_btn").show();
|
||||
}
|
||||
|
||||
});
|
||||
UIkit.util.on('.img_show', 'stop', function (item) {
|
||||
var img_num = $('.add_img_box .t_media_item').length;
|
||||
if (img_num < 9) {
|
||||
$(".up_img_btn").show();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//ajax上传媒体文件到媒体库(已兼容图片/视频)
|
||||
$(document).on('change', '#topic_img_up', function (e) {
|
||||
e.preventDefault();
|
||||
@@ -390,68 +371,6 @@ $(document).on('click', '.topic-img-de', function (e) {
|
||||
}
|
||||
});
|
||||
|
||||
// 样式修复:3列布局 + 正方形显示(核心)
|
||||
$(function () {
|
||||
var style = `<style>
|
||||
/* 媒体库视频封面:正方形显示,和图片一致 */
|
||||
.media-video-thumb {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover; /* 裁剪为正方形,不拉伸 */
|
||||
border: none;
|
||||
pointer-events: none;
|
||||
}
|
||||
/* 媒体库li:适配3列,强制正方形 */
|
||||
.wp_get_media_list li {
|
||||
position: relative;
|
||||
display: inline-block;
|
||||
width: calc(33.333% - 10px); /* 3列基础宽度 */
|
||||
aspect-ratio: 1/1; /* 强制正方形(宽高比1:1) */
|
||||
margin: 5px;
|
||||
overflow: hidden; /* 裁剪超出部分 */
|
||||
vertical-align: top;
|
||||
}
|
||||
|
||||
/* 核心:.t_media_item 强制正方形 + 3列布局 */
|
||||
.t_media_item {
|
||||
position: relative !important;
|
||||
display: inline-block !important;
|
||||
width: calc(33.333% - 10px) !important; /* 3列宽度,和原有布局一致 */
|
||||
aspect-ratio: 1/1 !important; /* 强制正方形,覆盖视频原比例 */
|
||||
margin: 5px !important;
|
||||
overflow: hidden !important; /* 裁剪超出的视频内容 */
|
||||
vertical-align: top !important;
|
||||
touch-action: none !important;
|
||||
user-select: none !important;
|
||||
}
|
||||
/* 删除按钮:固定在正方形右上角 */
|
||||
.t_media_item .topic-img-de {
|
||||
position: absolute !important;
|
||||
top: 5px !important;
|
||||
right: 5px !important;
|
||||
background: rgba(0,0,0,0.5) !important;
|
||||
color: #fff !important;
|
||||
width: 20px !important;
|
||||
height: 20px !important;
|
||||
border-radius: 50% !important;
|
||||
display: flex !important;
|
||||
align-items: center !important;
|
||||
justify-content: center !important;
|
||||
text-decoration: none !important;
|
||||
z-index: 99 !important;
|
||||
pointer-events: auto !important;
|
||||
}
|
||||
/* 视频/图片:裁剪为正方形,不拉伸 */
|
||||
.t_media_item video, .t_media_item img {
|
||||
width: 100% !important;
|
||||
height: 100% !important;
|
||||
object-fit: cover !important; /* 关键:裁剪多余部分,保持正方形 */
|
||||
display: block !important;
|
||||
}
|
||||
</style>`;
|
||||
$('head').append(style);
|
||||
});
|
||||
|
||||
//插入外部图片链接
|
||||
$(document).on('click', '.up_from_cdn a', function () {
|
||||
//$(".show_media_box .souqi").click();
|
||||
|
||||
+1
-1
File diff suppressed because one or more lines are too long
-1
@@ -3541,7 +3541,6 @@ iframe[uk-cover] {
|
||||
.uk-sortable-drag {
|
||||
position: fixed !important;
|
||||
z-index: 1050 !important;
|
||||
width: auto !important;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user