优化资源下载界面
This commit is contained in:
parent
234fc206d5
commit
c5e5cace18
@ -120,6 +120,7 @@ class ResourcesController extends BaseController
|
||||
'title' => input('post.title'),
|
||||
'cate' => input('post.cate'),
|
||||
'icon' => input('post.icon'),
|
||||
'images' => input('post.images'),
|
||||
'url' => input('post.url'),
|
||||
'fileurl' => input('post.fileurl'),
|
||||
'code' => input('post.code'),
|
||||
@ -170,6 +171,7 @@ class ResourcesController extends BaseController
|
||||
'desc' => $data['desc'],
|
||||
'uploader' => $data['uploader'],
|
||||
'icon' => $data['icon'],
|
||||
'images' => $data['images'],
|
||||
'fileurl' => $data['fileurl'],
|
||||
'url' => $data['url'],
|
||||
'code' => $data['code'],
|
||||
@ -207,6 +209,16 @@ class ResourcesController extends BaseController
|
||||
$this->error('资源不存在');
|
||||
}
|
||||
|
||||
// 处理图片路径
|
||||
if (!empty($resource['images'])) {
|
||||
$domain = request()->domain();
|
||||
$images = explode(',', $resource['images']);
|
||||
$images = array_map(function ($image) use ($domain) {
|
||||
return $domain . $image;
|
||||
}, $images);
|
||||
$resource['images'] = implode(',', $images);
|
||||
}
|
||||
|
||||
View::assign('resource', $resource);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
@ -260,7 +260,7 @@
|
||||
accept: 'images',
|
||||
before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" style="display: inline-block; margin-right: 10px;"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p></div>');
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" style="display: inline-block; margin-right: 10px;"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p><button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-image" style="position: absolute; top: 0; right: 0;">删除</button></div>');
|
||||
});
|
||||
element.progress('image-progress', '0%');
|
||||
layer.msg('图片上传中', { icon: 16, time: 0 });
|
||||
|
||||
@ -110,29 +110,42 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图片上传</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn" id="imageUpload">多图片上传</button>
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
|
||||
预览图:
|
||||
<div class="layui-upload-list" id="imagePreview" style="display: flex; flex-direction: column;">
|
||||
{if condition="$resource.images"}
|
||||
{foreach name="images" item="image" explode=",", $resource.images}
|
||||
<div class="layui-upload-img-item" data-src="{$image}">
|
||||
<img src="{$image}" alt="已上传图片" style="width: 100px; height: 100px; object-fit: cover;">
|
||||
<p>{$image|basename}</p>
|
||||
<button type="button"
|
||||
class="layui-btn layui-btn-xs layui-btn-danger delete-image">删除</button>
|
||||
<div class="image-upload-container">
|
||||
<button type="button" class="btn btn-primary" id="imageUpload">
|
||||
<i class="fas fa-upload"></i> 多图片上传
|
||||
</button>
|
||||
<div class="image-preview-container" id="imagePreview">
|
||||
{if condition="isset($resource.images) && !empty($resource.images)"}
|
||||
{if condition="strpos($resource.images, ',') !== false"}
|
||||
{volist name="resource.images|explode=',',true" id="image"}
|
||||
<div class="image-preview-item" data-src="{$image}">
|
||||
<img src="{$image}" alt="已上传图片">
|
||||
<div class="image-preview-overlay">
|
||||
<button type="button" class="delete-image">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<p class="image-filename">{$image|basename}</p>
|
||||
</div>
|
||||
</blockquote>
|
||||
{/volist}
|
||||
{else}
|
||||
<div class="image-preview-item" data-src="{$resource.images}">
|
||||
<img src="{$resource.images}" alt="已上传图片">
|
||||
<div class="image-preview-overlay">
|
||||
<button type="button" class="delete-image">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<p class="image-filename">{$resource.images|basename}</p>
|
||||
</div>
|
||||
{/if}
|
||||
{/if}
|
||||
</div>
|
||||
<div class="upload-progress" id="imageProgress" style="display: none;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
<input type="hidden" name="images" id="images" value="{$resource.images|default=''}">
|
||||
</div>
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="image-progress"
|
||||
style="margin-top: 10px;">
|
||||
<div class="layui-progress-bar" lay-percent=""></div>
|
||||
</div>
|
||||
<input type="hidden" name="images" id="images" value="{$resource.images|default=''}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -266,7 +279,7 @@
|
||||
accept: 'images',
|
||||
before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" data-src="' + result + '"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p><button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-image">删除</button></div>');
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" data-src="' + result + '"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p><button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-image" style="position: absolute; top: 0; right: 0;">删除</button></div>');
|
||||
});
|
||||
element.progress('image-progress', '0%');
|
||||
layer.msg('图片上传中', { icon: 16, time: 0 });
|
||||
@ -565,3 +578,222 @@
|
||||
window.location.href = '{:url("resources/lists")}';
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const imageUpload = document.getElementById('imageUpload');
|
||||
const imagePreview = document.getElementById('imagePreview');
|
||||
const imageProgress = document.getElementById('imageProgress');
|
||||
const progressBar = imageProgress.querySelector('.progress-bar');
|
||||
const imagesInput = document.getElementById('images');
|
||||
|
||||
// 处理图片上传
|
||||
imageUpload.addEventListener('click', function () {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.multiple = true;
|
||||
input.accept = 'image/*';
|
||||
|
||||
input.onchange = function (e) {
|
||||
const files = e.target.files;
|
||||
if (files.length === 0) return;
|
||||
|
||||
imageProgress.style.display = 'block';
|
||||
let uploadedCount = 0;
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
fetch('{:url("index/upload_img")}', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
addImagePreview(res.data);
|
||||
updateImagesInput();
|
||||
} else {
|
||||
alert('上传失败:' + res.msg);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('上传错误:', error);
|
||||
alert('上传出错');
|
||||
})
|
||||
.finally(() => {
|
||||
uploadedCount++;
|
||||
const progress = (uploadedCount / files.length) * 100;
|
||||
progressBar.style.width = progress + '%';
|
||||
|
||||
if (uploadedCount === files.length) {
|
||||
setTimeout(() => {
|
||||
imageProgress.style.display = 'none';
|
||||
progressBar.style.width = '0%';
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
input.click();
|
||||
});
|
||||
|
||||
// 添加图片预览
|
||||
function addImagePreview(imageUrl) {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'image-preview-item';
|
||||
div.dataset.src = imageUrl;
|
||||
|
||||
div.innerHTML = `
|
||||
<img src="${imageUrl}" alt="已上传图片">
|
||||
<div class="image-preview-overlay">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-image">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<p class="image-filename">${imageUrl.split('/').pop()}</p>
|
||||
`;
|
||||
|
||||
imagePreview.appendChild(div);
|
||||
}
|
||||
|
||||
// 更新隐藏输入框的值
|
||||
function updateImagesInput() {
|
||||
const images = Array.from(imagePreview.querySelectorAll('.image-preview-item'))
|
||||
.map(item => item.dataset.src);
|
||||
imagesInput.value = images.join(',');
|
||||
}
|
||||
|
||||
// 删除图片
|
||||
imagePreview.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.delete-image')) {
|
||||
const item = e.target.closest('.image-preview-item');
|
||||
item.remove();
|
||||
updateImagesInput();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.image-upload-container {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.image-preview-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.image-preview-item {
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.image-preview-item img {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.image-preview-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
z-index: 1;
|
||||
/* 添加 z-index */
|
||||
}
|
||||
|
||||
.image-preview-item:hover .image-preview-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.image-filename {
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.upload-progress {
|
||||
margin-top: 10px;
|
||||
height: 4px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: #007bff;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #007bff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #c82333;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
padding: 4px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
.delete-image {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
padding: 8px 12px;
|
||||
cursor: pointer;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: background-color 0.3s;
|
||||
z-index: 2;
|
||||
/* 确保按钮在悬停层之上 */
|
||||
}
|
||||
|
||||
.delete-image i {
|
||||
font-size: 14px;
|
||||
margin-right: 4px;
|
||||
/* 添加图标右边距 */
|
||||
}
|
||||
</style>
|
||||
@ -29,10 +29,21 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div style="font-size:24px;font-weight:bolder;margin-bottom:30px;">资源展示</div> -->
|
||||
|
||||
<div class="program-show">
|
||||
<div class="swiper program-swiper">
|
||||
<div class="swiper-wrapper">
|
||||
{volist name="program.images" id="image"}
|
||||
{php}
|
||||
// 强制统一处理:无论 images 是数组还是字符串,都转为数组
|
||||
$images = isset($program['images']) ? $program['images'] : [];
|
||||
if (is_string($images)) {
|
||||
$images = explode(',', $images); // 按逗号分隔字符串
|
||||
}
|
||||
$images = array_filter($images); // 移除空值
|
||||
{/php}
|
||||
|
||||
{volist name="images" id="image"}
|
||||
<div class="swiper-slide">
|
||||
<a href="{$image}" data-lightbox="program-images" data-title="{$program.title}">
|
||||
<img src="{$image}" alt="{$program.title}">
|
||||
@ -46,6 +57,8 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="font-size:24px;font-weight:bolder;margin-bottom:30px;">资源简介</div>
|
||||
|
||||
<div class="program-content">
|
||||
{$program.content|raw}
|
||||
</div>
|
||||
@ -505,7 +518,9 @@
|
||||
line-height: 1.8;
|
||||
color: #333;
|
||||
font-size: 16px;
|
||||
margin-bottom: 30px;
|
||||
margin: 30px 0;
|
||||
padding-top: 30px;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
@ -923,6 +938,7 @@
|
||||
|
||||
.program-show {
|
||||
margin: 20px 0;
|
||||
margin-bottom: 60px;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
@ -992,7 +1008,7 @@
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next:after {
|
||||
@ -1001,7 +1017,7 @@
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-closeContainer {
|
||||
@ -1022,7 +1038,7 @@
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0,0,0,0.5);
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-close:hover {
|
||||
@ -1042,7 +1058,7 @@
|
||||
|
||||
<script>
|
||||
// 初始化 Swiper
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const swiper = new Swiper('.program-swiper', {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 30,
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 529 KiB |
@ -1,4 +1,4 @@
|
||||
<?php /*a:2:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\resources\edit.php";i:1749454320;s:61:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\public\header.php";i:1746849526;}*/ ?>
|
||||
<?php /*a:2:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\resources\edit.php";i:1749458351;s:61:"E:\Demos\DemoOwns\PHP\yunzer\app\admin\view\public\header.php";i:1746849526;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
@ -204,28 +204,29 @@
|
||||
<div class="layui-form-item">
|
||||
<label class="layui-form-label">图片上传</label>
|
||||
<div class="layui-input-block">
|
||||
<div class="layui-upload">
|
||||
<button type="button" class="layui-btn" id="imageUpload">多图片上传</button>
|
||||
<blockquote class="layui-elem-quote layui-quote-nm" style="margin-top: 10px;">
|
||||
预览图:
|
||||
<div class="layui-upload-list" id="imagePreview" style="display: flex; flex-direction: column;">
|
||||
<?php if($resource['images']): if(is_array($images) || $images instanceof \think\Collection || $images instanceof \think\Paginator): if( count($images)==0 ) : echo "" ;else: foreach($images as $key=>$image): ?>
|
||||
<div class="layui-upload-img-item" data-src="<?php echo htmlentities((string) $image); ?>">
|
||||
<img src="<?php echo htmlentities((string) $image); ?>" alt="已上传图片" style="width: 100px; height: 100px; object-fit: cover;">
|
||||
<p><?php echo htmlentities((string) basename($image)); ?></p>
|
||||
<button type="button"
|
||||
class="layui-btn layui-btn-xs layui-btn-danger delete-image">删除</button>
|
||||
<div class="image-upload-container">
|
||||
<button type="button" class="btn btn-primary" id="imageUpload">
|
||||
<i class="fas fa-upload"></i> 多图片上传
|
||||
</button>
|
||||
<div class="image-preview-container" id="imagePreview">
|
||||
<?php if(isset($resource['images']) && !empty($resource['images'])): if(is_array($resource['images']) || $resource['images'] instanceof \think\Collection || $resource['images'] instanceof \think\Paginator): if( count($resource['images'])==0 ) : echo "" ;else: foreach($resource['images'] as $key=>$image): ?>
|
||||
<div class="image-preview-item" data-src="<?php echo htmlentities((string) $image); ?>">
|
||||
<img src="<?php echo htmlentities((string) $image); ?>" alt="已上传图片">
|
||||
<div class="image-preview-overlay">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-image">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<?php endforeach; endif; else: echo "" ;endif; ?>
|
||||
<?php endif; ?>
|
||||
<p class="image-filename"><?php echo htmlentities((string) basename($image)); ?></p>
|
||||
</div>
|
||||
</blockquote>
|
||||
<?php endforeach; endif; else: echo "" ;endif; ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="upload-progress" id="imageProgress" style="display: none;">
|
||||
<div class="progress-bar" role="progressbar" style="width: 0%"></div>
|
||||
</div>
|
||||
<input type="hidden" name="images" id="images" value="<?php echo htmlentities((string) (isset($resource['images']) && ($resource['images'] !== '')?$resource['images']:'')); ?>">
|
||||
</div>
|
||||
<div class="layui-progress layui-progress-big" lay-showPercent="yes" lay-filter="image-progress"
|
||||
style="margin-top: 10px;">
|
||||
<div class="layui-progress-bar" lay-percent=""></div>
|
||||
</div>
|
||||
<input type="hidden" name="images" id="images" value="<?php echo htmlentities((string) (isset($resource['images']) && ($resource['images'] !== '')?$resource['images']:'')); ?>">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -359,7 +360,7 @@
|
||||
accept: 'images',
|
||||
before: function (obj) {
|
||||
obj.preview(function (index, file, result) {
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" data-src="' + result + '"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p><button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-image">删除</button></div>');
|
||||
$('#imagePreview').append('<div class="layui-upload-img-item" data-src="' + result + '"><img src="' + result + '" alt="' + file.name + '" style="width: 100px; height: 100px; object-fit: cover;"><p>' + file.name + '</p><button type="button" class="layui-btn layui-btn-xs layui-btn-danger delete-image" style="position: absolute; top: 0; right: 0;">删除</button></div>');
|
||||
});
|
||||
element.progress('image-progress', '0%');
|
||||
layer.msg('图片上传中', { icon: 16, time: 0 });
|
||||
@ -658,3 +659,199 @@
|
||||
window.location.href = '<?php echo url("resources/lists"); ?>';
|
||||
}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const imageUpload = document.getElementById('imageUpload');
|
||||
const imagePreview = document.getElementById('imagePreview');
|
||||
const imageProgress = document.getElementById('imageProgress');
|
||||
const progressBar = imageProgress.querySelector('.progress-bar');
|
||||
const imagesInput = document.getElementById('images');
|
||||
|
||||
// 处理图片上传
|
||||
imageUpload.addEventListener('click', function () {
|
||||
const input = document.createElement('input');
|
||||
input.type = 'file';
|
||||
input.multiple = true;
|
||||
input.accept = 'image/*';
|
||||
|
||||
input.onchange = function (e) {
|
||||
const files = e.target.files;
|
||||
if (files.length === 0) return;
|
||||
|
||||
imageProgress.style.display = 'block';
|
||||
let uploadedCount = 0;
|
||||
|
||||
Array.from(files).forEach(file => {
|
||||
const formData = new FormData();
|
||||
formData.append('file', file);
|
||||
|
||||
fetch('<?php echo url("index/upload_img"); ?>', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(res => {
|
||||
if (res.code === 0) {
|
||||
addImagePreview(res.data);
|
||||
updateImagesInput();
|
||||
} else {
|
||||
alert('上传失败:' + res.msg);
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('上传错误:', error);
|
||||
alert('上传出错');
|
||||
})
|
||||
.finally(() => {
|
||||
uploadedCount++;
|
||||
const progress = (uploadedCount / files.length) * 100;
|
||||
progressBar.style.width = progress + '%';
|
||||
|
||||
if (uploadedCount === files.length) {
|
||||
setTimeout(() => {
|
||||
imageProgress.style.display = 'none';
|
||||
progressBar.style.width = '0%';
|
||||
}, 500);
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
input.click();
|
||||
});
|
||||
|
||||
// 添加图片预览
|
||||
function addImagePreview(imageUrl) {
|
||||
const div = document.createElement('div');
|
||||
div.className = 'image-preview-item';
|
||||
div.dataset.src = imageUrl;
|
||||
|
||||
div.innerHTML = `
|
||||
<img src="${imageUrl}" alt="已上传图片">
|
||||
<div class="image-preview-overlay">
|
||||
<button type="button" class="btn btn-danger btn-sm delete-image">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</div>
|
||||
<p class="image-filename">${imageUrl.split('/').pop()}</p>
|
||||
`;
|
||||
|
||||
imagePreview.appendChild(div);
|
||||
}
|
||||
|
||||
// 更新隐藏输入框的值
|
||||
function updateImagesInput() {
|
||||
const images = Array.from(imagePreview.querySelectorAll('.image-preview-item'))
|
||||
.map(item => item.dataset.src);
|
||||
imagesInput.value = images.join(',');
|
||||
}
|
||||
|
||||
// 删除图片
|
||||
imagePreview.addEventListener('click', function (e) {
|
||||
if (e.target.closest('.delete-image')) {
|
||||
const item = e.target.closest('.image-preview-item');
|
||||
item.remove();
|
||||
updateImagesInput();
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.image-upload-container {
|
||||
margin: 20px 0;
|
||||
}
|
||||
|
||||
.image-preview-container {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
|
||||
gap: 15px;
|
||||
margin-top: 15px;
|
||||
}
|
||||
|
||||
.image-preview-item {
|
||||
position: relative;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.image-preview-item img {
|
||||
width: 100%;
|
||||
height: 150px;
|
||||
object-fit: cover;
|
||||
display: block;
|
||||
}
|
||||
|
||||
.image-preview-overlay {
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s;
|
||||
}
|
||||
|
||||
.image-preview-item:hover .image-preview-overlay {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.image-filename {
|
||||
margin: 5px 0;
|
||||
font-size: 0.9em;
|
||||
text-align: center;
|
||||
word-break: break-all;
|
||||
}
|
||||
|
||||
.upload-progress {
|
||||
margin-top: 10px;
|
||||
height: 4px;
|
||||
background: #f0f0f0;
|
||||
border-radius: 2px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.progress-bar {
|
||||
height: 100%;
|
||||
background: #007bff;
|
||||
transition: width 0.3s ease;
|
||||
}
|
||||
|
||||
.btn {
|
||||
padding: 8px 16px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
|
||||
.btn-primary {
|
||||
background: #007bff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-primary:hover {
|
||||
background: #0056b3;
|
||||
}
|
||||
|
||||
.btn-danger {
|
||||
background: #dc3545;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.btn-danger:hover {
|
||||
background: #c82333;
|
||||
}
|
||||
|
||||
.btn-sm {
|
||||
padding: 4px 8px;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
@ -1,4 +1,4 @@
|
||||
<?php /*a:5:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\program\detail.php";i:1748423318;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749181062;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?>
|
||||
<?php /*a:5:{s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\program\detail.php";i:1749460944;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\head.php";i:1747617129;s:71:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\header-simple.php";i:1749258723;s:64:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\footer.php";i:1749170849;s:62:"E:\Demos\DemoOwns\PHP\yunzer\app\index\view\component\foot.php";i:1747616844;}*/ ?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
|
||||
@ -18,7 +18,29 @@
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<link href="/static/css/lightbox.min.css" rel="stylesheet">
|
||||
<link href="/static/css/swiper-bundle.min.css" rel="stylesheet">
|
||||
<script src="/static/js/jquery.min.js"></script>
|
||||
<script src="/static/js/lightbox.min.js"></script>
|
||||
<script src="/static/js/swiper-bundle.min.js"></script>
|
||||
<?php
|
||||
/**
|
||||
* 商业使用授权协议
|
||||
*
|
||||
* Copyright (c) 2025 [云泽网]. 保留所有权利.
|
||||
*
|
||||
* 本软件仅供评估使用。任何商业用途必须获得书面授权许可。
|
||||
* 未经授权商业使用本软件属于侵权行为,将承担法律责任。
|
||||
*
|
||||
* 授权购买请联系: 357099073@qq.com
|
||||
* 官方网站: https://www.yunzer.cn
|
||||
*
|
||||
* 评估用户须知:
|
||||
* 1. 禁止移除版权声明
|
||||
* 2. 禁止用于生产环境
|
||||
* 3. 禁止转售或分发
|
||||
*/
|
||||
|
||||
// 获取当前登录状态
|
||||
$isLoggedIn = false;
|
||||
$userInfo = [
|
||||
@ -925,9 +947,35 @@ $loginStatus = [
|
||||
<h1 class="program-title"><?php echo htmlentities((string) $program['title']); ?></h1>
|
||||
<div class="program-meta">
|
||||
<span class="program-author"><i class="fa fa-user"></i> <span><?php echo htmlentities((string) $program['author']); ?></span></span>
|
||||
<span class="program-date"><i class="fa fa-calendar"></i> <span><?php echo htmlentities((string) date("Y-m-d",!is_numeric($program['create_time'])? strtotime($program['create_time']) : $program['create_time'])); ?></span></span>
|
||||
<span class="program-date"><i class="fa fa-calendar"></i>
|
||||
<span><?php echo htmlentities((string) date("Y-m-d",!is_numeric($program['create_time'])? strtotime($program['create_time']) : $program['create_time'])); ?></span></span>
|
||||
<span class="program-views"><i class="fa-solid fa-eye"></i> <span><?php echo htmlentities((string) $program['views']); ?></span> 阅读</span>
|
||||
<span class="program-downloads"><i class="fa-solid fa-download"></i> <span><?php echo htmlentities((string) $program['downloads']); ?></span> 下载</span>
|
||||
<span class="program-downloads"><i class="fa-solid fa-download"></i>
|
||||
<span><?php echo htmlentities((string) $program['downloads']); ?></span> 下载</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="program-show">
|
||||
<div class="swiper program-swiper">
|
||||
<div class="swiper-wrapper">
|
||||
<?php
|
||||
// 强制统一处理:无论 images 是数组还是字符串,都转为数组
|
||||
$images = isset($program['images']) ? $program['images'] : [];
|
||||
if (is_string($images)) {
|
||||
$images = explode(',', $images); // 按逗号分隔字符串
|
||||
}
|
||||
$images = array_filter($images); // 移除空值
|
||||
if(is_array($images) || $images instanceof \think\Collection || $images instanceof \think\Paginator): $i = 0; $__LIST__ = $images;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$image): $mod = ($i % 2 );++$i;?>
|
||||
<div class="swiper-slide">
|
||||
<a href="<?php echo htmlentities((string) $image); ?>" data-lightbox="program-images" data-title="<?php echo htmlentities((string) $program['title']); ?>">
|
||||
<img src="<?php echo htmlentities((string) $image); ?>" alt="<?php echo htmlentities((string) $program['title']); ?>">
|
||||
</a>
|
||||
</div>
|
||||
<?php endforeach; endif; else: echo "" ;endif; ?>
|
||||
</div>
|
||||
<div class="swiper-button-prev"></div>
|
||||
<div class="swiper-button-next"></div>
|
||||
<div class="swiper-pagination"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -935,7 +983,7 @@ $loginStatus = [
|
||||
<?php echo $program['content']; ?>
|
||||
</div>
|
||||
|
||||
<div class="program-info">
|
||||
<!-- <div class="program-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">软件大小:</span>
|
||||
<span><?php echo htmlentities((string) (isset($program['size']) && ($program['size'] !== '')?$program['size']:'未知')); ?></span>
|
||||
@ -954,15 +1002,6 @@ $loginStatus = [
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="disclaimers">
|
||||
<div class="disclaimer-item">
|
||||
<div class="disclaimer-title">免责声明:</div>
|
||||
<div class="disclaimer-content">
|
||||
<?php echo $config['disclaimers'] ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="program-actions">
|
||||
<div class="action-item download-btn" data-id="<?php echo htmlentities((string) $program['id']); ?>">
|
||||
<i class="fa fa-download"></i>
|
||||
@ -973,6 +1012,15 @@ $loginStatus = [
|
||||
<i class="fa fa-share-alt"></i>
|
||||
<span class="action-text">分享</span>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="disclaimers">
|
||||
<div class="disclaimer-item">
|
||||
<div class="disclaimer-title">免责声明:</div>
|
||||
<div class="disclaimer-content">
|
||||
<?php echo $config['disclaimers'] ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="program-navigation">
|
||||
@ -1016,25 +1064,25 @@ $loginStatus = [
|
||||
</div>
|
||||
<div class="program-detail-right">
|
||||
<div class="aboutauthor">
|
||||
<div class="aboutauthor-title">关于作者</div>
|
||||
<!-- <div class="aboutauthor-title">关于作者</div> -->
|
||||
<div class="aboutauthor-main">
|
||||
<div class="aboutauthor-main-top">
|
||||
<div class="aboutauthor-avatar">
|
||||
<img src="<?php echo htmlentities((string) $authorInfo['avatar']); ?>" alt="作者头像">
|
||||
<img src="<?php echo htmlentities((string) $uploaderInfo['avatar']); ?>" alt="作者头像">
|
||||
</div>
|
||||
<div class="aboutauthor-info">
|
||||
<div class="author-name"><?php echo htmlentities((string) $authorInfo['name']); ?></div>
|
||||
<div class="author-name"><?php echo htmlentities((string) $uploaderInfo['name']); ?></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="aboutauthor-main-middle">
|
||||
<div class="author-stats">
|
||||
<div class="author-stats-item">
|
||||
<h6>资源</h6>
|
||||
<span class="count"><?php echo htmlentities((string) $authorInfo['resource_count']); ?></span>
|
||||
<span class="count"><?php echo htmlentities((string) $uploaderInfo['resource_count']); ?></span>
|
||||
</div>
|
||||
<div class="author-stats-item">
|
||||
<h6>文章</h6>
|
||||
<span class="count"><?php echo htmlentities((string) $authorInfo['article_count']); ?></span>
|
||||
<span class="count"><?php echo htmlentities((string) $uploaderInfo['article_count']); ?></span>
|
||||
</div>
|
||||
<div class="author-stats-item">
|
||||
<h6>粉丝</h6>
|
||||
@ -1052,6 +1100,55 @@ $loginStatus = [
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="infos">
|
||||
<!-- <div class="infos-title">下载</div> -->
|
||||
<div class="infos-main">
|
||||
<div class="infos-main-top">
|
||||
<div class="infos-info">
|
||||
<div class="info-item">
|
||||
<span class="info-label">软件编码:</span>
|
||||
<span><?php echo htmlentities((string) $program['number']); ?></span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">软件大小:</span>
|
||||
<span><?php echo htmlentities((string) (isset($program['size']) && ($program['size'] !== '')?$program['size']:'未知')); ?></span>
|
||||
</div>
|
||||
<div class="info-item">
|
||||
<span class="info-label">更新时间:</span>
|
||||
<span><?php echo htmlentities((string) date("Y-m-d",!is_numeric($program['create_time'])? strtotime($program['create_time']) : $program['create_time'])); ?></span>
|
||||
</div>
|
||||
<!-- <div class="info-item">
|
||||
<span class="info-label">软件版本:</span>
|
||||
<span><?php echo htmlentities((string) (isset($program['version']) && ($program['version'] !== '')?$program['version']:'1.0.0')); ?></span>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="infos-main-middle">
|
||||
<div class="infos-stats">
|
||||
<div class="infos-stats-item">
|
||||
<h6>下载</h6>
|
||||
<a href="<?php echo htmlentities((string) $program['url']); ?>" target="_blank">点击下载</a>
|
||||
</div>
|
||||
<div class="infos-stats-item">
|
||||
<h6>分享码</h6>
|
||||
<?php if($program['code']): ?>
|
||||
<?php echo htmlentities((string) $program['code']); else: ?>
|
||||
<span>-</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="infos-stats-item">
|
||||
<h6>解压密码</h6>
|
||||
<?php if($program['zipcode']): ?>
|
||||
<a href=""><?php echo htmlentities((string) $program['zipcode']); ?></a>
|
||||
<?php else: ?>
|
||||
<span>-</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1189,6 +1286,66 @@ $loginStatus = [
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const authorSection = document.querySelector('.aboutauthor');
|
||||
const downloadSection = document.querySelector('.infos');
|
||||
const originalOffset = authorSection.offsetTop;
|
||||
const parentContainer = authorSection.parentElement;
|
||||
const parentRect = parentContainer.getBoundingClientRect();
|
||||
|
||||
// 创建一个占位元素,防止内容跳动
|
||||
const placeholder = document.createElement('div');
|
||||
placeholder.style.height = (authorSection.offsetHeight + downloadSection.offsetHeight + 30) + 'px'; // 30px是间距
|
||||
placeholder.style.display = 'none';
|
||||
parentContainer.insertBefore(placeholder, authorSection);
|
||||
|
||||
function handleScroll() {
|
||||
const scrollTop = window.pageYOffset || document.documentElement.scrollTop;
|
||||
const parentTop = parentRect.top + scrollTop;
|
||||
const parentBottom = parentTop + parentRect.height;
|
||||
const totalHeight = authorSection.offsetHeight + downloadSection.offsetHeight + 30; // 30px是间距
|
||||
|
||||
// 当作者信息区域到达父容器顶部时
|
||||
if (scrollTop > originalOffset) {
|
||||
// 检查是否到达父容器底部
|
||||
if (scrollTop + totalHeight + 20 > parentBottom) {
|
||||
authorSection.style.position = 'absolute';
|
||||
downloadSection.style.position = 'absolute';
|
||||
authorSection.style.top = (parentRect.height - totalHeight) + 'px';
|
||||
downloadSection.style.top = (parentRect.height - downloadSection.offsetHeight) + 'px';
|
||||
authorSection.classList.remove('sticky');
|
||||
downloadSection.classList.remove('sticky');
|
||||
} else {
|
||||
authorSection.style.position = 'fixed';
|
||||
downloadSection.style.position = 'fixed';
|
||||
authorSection.style.top = '100px';
|
||||
downloadSection.style.top = (100 + authorSection.offsetHeight + 30) + 'px'; // 30px是间距
|
||||
authorSection.style.width = '350px';
|
||||
downloadSection.style.width = '350px';
|
||||
authorSection.classList.add('sticky');
|
||||
downloadSection.classList.add('sticky');
|
||||
placeholder.style.display = 'block';
|
||||
}
|
||||
} else {
|
||||
authorSection.style.position = 'static';
|
||||
downloadSection.style.position = 'static';
|
||||
authorSection.classList.remove('sticky');
|
||||
downloadSection.classList.remove('sticky');
|
||||
placeholder.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
// 监听滚动事件
|
||||
window.addEventListener('scroll', handleScroll);
|
||||
// 监听窗口大小改变事件
|
||||
window.addEventListener('resize', function () {
|
||||
parentRect = parentContainer.getBoundingClientRect();
|
||||
handleScroll();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
<style>
|
||||
.location {
|
||||
max-width: 1200px;
|
||||
@ -1238,8 +1395,8 @@ $loginStatus = [
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px !important;
|
||||
padding: 20px 0;
|
||||
border-bottom: 1px solid #efefef;
|
||||
/* padding: 20px 0; */
|
||||
/* border-bottom: 1px solid #efefef; */
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
@ -1286,7 +1443,7 @@ $loginStatus = [
|
||||
.main .body-container .program-detail-right .aboutauthor-btn {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
padding: 20px 0;
|
||||
/* padding: 20px 0; */
|
||||
}
|
||||
|
||||
.main .body-container .program-detail-right .aboutauthor-btn .follow-btn {
|
||||
@ -1354,6 +1511,11 @@ $loginStatus = [
|
||||
margin-bottom: 10px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.info-item span {
|
||||
color: #666;
|
||||
}
|
||||
|
||||
.info-label {
|
||||
@ -1567,8 +1729,345 @@ $loginStatus = [
|
||||
.disclaimer-content p {
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.aboutauthor {
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.aboutauthor.sticky {
|
||||
position: fixed;
|
||||
top: 20px;
|
||||
width: calc(300px - 40px);
|
||||
/* 假设父容器宽度为300px,减去padding */
|
||||
z-index: 100;
|
||||
}
|
||||
|
||||
.aboutauthor-title {
|
||||
font-size: 18px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
margin-bottom: 20px;
|
||||
padding-bottom: 10px;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.aboutauthor-main-top {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
.aboutauthor-avatar {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
border-radius: 50%;
|
||||
overflow: hidden;
|
||||
margin-right: 15px;
|
||||
}
|
||||
|
||||
.aboutauthor-avatar img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.author-name {
|
||||
font-size: 16px;
|
||||
font-weight: 500;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.author-stats {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
padding: 15px 0;
|
||||
border-top: 1px solid #eee;
|
||||
border-bottom: 1px solid #eee;
|
||||
}
|
||||
|
||||
.author-stats-item {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.author-stats-item h6 {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.author-stats-item .count {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.aboutauthor-btn {
|
||||
margin-top: 20px;
|
||||
display: flex;
|
||||
gap: 10px;
|
||||
}
|
||||
|
||||
.aboutauthor-btn button {
|
||||
flex: 1;
|
||||
padding: 8px 15px;
|
||||
border: none;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
font-size: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.follow-btn {
|
||||
background: #3881fd;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.follow-btn:hover {
|
||||
background: #2c5fd9;
|
||||
}
|
||||
|
||||
.message-btn {
|
||||
background: #f8fafc;
|
||||
color: #333;
|
||||
border: 1px solid #e2e8f0;
|
||||
}
|
||||
|
||||
.message-btn:hover {
|
||||
background: #e2e8f0;
|
||||
}
|
||||
|
||||
.aboutauthor-btn i {
|
||||
margin-right: 5px;
|
||||
}
|
||||
|
||||
.infos.sticky {
|
||||
position: fixed;
|
||||
z-index: 100;
|
||||
transition: all 0.3s ease;
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
.infos {
|
||||
background: #fff;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
|
||||
border-radius: 8px;
|
||||
margin-top: 30px;
|
||||
padding: 20px;
|
||||
transition: all 0.3s ease;
|
||||
}
|
||||
|
||||
.infos-main {}
|
||||
|
||||
.infos-main-top {
|
||||
padding: 20px;
|
||||
}
|
||||
|
||||
.infos-title {
|
||||
height: 60px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding-left: 20px;
|
||||
border-bottom: 1px solid #eee;
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
.infos-main-middle {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
border-top: 1px solid #efefef;
|
||||
padding-top: 20px;
|
||||
}
|
||||
|
||||
.infos-stats {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.infos-stats-item {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.infos-stats-item h6 {
|
||||
font-size: 14px;
|
||||
color: #666;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
.infos-btn-blue {
|
||||
background-color: #0081ff;
|
||||
color: #fff;
|
||||
padding: 10px 20px;
|
||||
border-radius: 8px;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.program-show {
|
||||
margin: 20px 0;
|
||||
background: #fff;
|
||||
border-radius: 8px;
|
||||
padding: 20px;
|
||||
box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
|
||||
}
|
||||
|
||||
.program-swiper {
|
||||
width: 100%;
|
||||
height: 400px;
|
||||
border-radius: 8px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.program-swiper .swiper-slide {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
background: #f8f9fa;
|
||||
}
|
||||
|
||||
.program-swiper .swiper-slide img {
|
||||
max-width: 100%;
|
||||
max-height: 100%;
|
||||
object-fit: contain;
|
||||
cursor: zoom-in;
|
||||
transition: transform 0.3s ease;
|
||||
}
|
||||
|
||||
.program-swiper .swiper-slide img:hover {
|
||||
transform: scale(1.02);
|
||||
}
|
||||
|
||||
.program-swiper .swiper-button-prev,
|
||||
.program-swiper .swiper-button-next {
|
||||
color: #3881fd;
|
||||
background: rgba(255, 255, 255, 0.9);
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
border-radius: 50%;
|
||||
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
|
||||
.program-swiper .swiper-button-prev:after,
|
||||
.program-swiper .swiper-button-next:after {
|
||||
font-size: 18px;
|
||||
}
|
||||
|
||||
.program-swiper .swiper-pagination-bullet {
|
||||
background: #3881fd;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.program-swiper .swiper-pagination-bullet-active {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
/* Lightbox 样式优化 */
|
||||
.lb-nav a.lb-prev,
|
||||
.lb-nav a.lb-next {
|
||||
opacity: 0.8;
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.lb-nav a.lb-prev:after {
|
||||
content: '\f104';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-nav a.lb-next:after {
|
||||
content: '\f105';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-closeContainer {
|
||||
position: absolute;
|
||||
top: 20px;
|
||||
right: 20px;
|
||||
}
|
||||
|
||||
.lb-close {
|
||||
opacity: 0.8;
|
||||
transition: opacity 0.3s ease;
|
||||
background: none !important;
|
||||
}
|
||||
|
||||
.lb-close:after {
|
||||
content: '\f00d';
|
||||
font-family: 'Font Awesome 5 Free';
|
||||
font-weight: 900;
|
||||
font-size: 30px;
|
||||
color: #fff;
|
||||
text-shadow: 0 0 3px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
|
||||
.lb-close:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.lb-data .lb-caption {
|
||||
font-size: 14px;
|
||||
font-weight: normal;
|
||||
}
|
||||
|
||||
.lb-data .lb-number {
|
||||
font-size: 12px;
|
||||
color: #999;
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
// 初始化 Swiper
|
||||
document.addEventListener('DOMContentLoaded', function () {
|
||||
const swiper = new Swiper('.program-swiper', {
|
||||
slidesPerView: 1,
|
||||
spaceBetween: 30,
|
||||
loop: true,
|
||||
autoplay: {
|
||||
delay: 3000,
|
||||
disableOnInteraction: false,
|
||||
},
|
||||
pagination: {
|
||||
el: '.swiper-pagination',
|
||||
clickable: true,
|
||||
},
|
||||
navigation: {
|
||||
nextEl: '.swiper-button-next',
|
||||
prevEl: '.swiper-button-prev',
|
||||
},
|
||||
});
|
||||
|
||||
// 初始化 Lightbox
|
||||
lightbox.option({
|
||||
'resizeDuration': 200,
|
||||
'wrapAround': true,
|
||||
'albumLabel': "图片 %1 / %2",
|
||||
'fadeDuration': 300,
|
||||
'imageFadeDuration': 300,
|
||||
'positionFromTop': 100,
|
||||
'maxWidth': 1200,
|
||||
'maxHeight': 800,
|
||||
'disableScrolling': true,
|
||||
'showImageNumberLabel': true,
|
||||
'alwaysShowNavOnTouchDevices': true
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user