优化资源下载界面
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user