From 3a20b76d4ac3c8db5525e678a2f4da73de997515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com> Date: Fri, 4 Jul 2025 11:56:25 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E8=B5=84=E6=BA=90=E5=B1=95?= =?UTF-8?q?=E7=A4=BA=EF=BC=8C=E5=89=8D=E5=90=8E=E7=AB=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/YunzeradminController.php | 8 ++ app/admin/view/resources/edit.php | 95 +++++++++---- app/index/view/component/main.php | 4 +- app/index/view/resources/detail.php | 126 +++++++++++++++--- .../temp/606cb5a28477c3a4a33c90fc473c4624.php | 14 +- .../temp/cb3abdcb36407244b9b613766f30573b.php | 6 +- .../temp/f8995f34639557c9f17f79801bc58d25.php | 13 +- 7 files changed, 210 insertions(+), 56 deletions(-) diff --git a/app/admin/controller/YunzeradminController.php b/app/admin/controller/YunzeradminController.php index 0c15039..bce79c7 100644 --- a/app/admin/controller/YunzeradminController.php +++ b/app/admin/controller/YunzeradminController.php @@ -1053,4 +1053,12 @@ class YunzeradminController extends Base } return json(['code' => 1, 'msg' => '请求方法无效']); } + + //获取推送内容Articles和Resources + //https://www.yunzer.cn/index/articles/detail?id=30 + //https://www.yunzer.cn/index/program/index?cateid=2 + //https://www.yunzer.cn/index/game/index?cateid=8 + //https://www.yunzer.cn/index/resources/detail?id=3 + + } \ No newline at end of file diff --git a/app/admin/view/resources/edit.php b/app/admin/view/resources/edit.php index 5ad9f4c..27bb18d 100644 --- a/app/admin/view/resources/edit.php +++ b/app/admin/view/resources/edit.php @@ -97,29 +97,41 @@
{if condition="isset($resource.images) && !empty($resource.images)"} - {if condition="strpos($resource.images, ',') !== false"} - {volist name="resource.images|explode=',',true" id="image"} -
- 已上传图片 -
- -
-

{$image|basename}

+
+ + + + + + + + + {php} + // 处理图片字符串,正确拆分逗号分隔的路径 + $imageArray = []; + if (isset($resource['images']) && !empty($resource['images'])) { + $imageArray = explode(',', $resource['images']); + $imageArray = array_map('trim', $imageArray); // 去除每个路径的前后空格 + $imageArray = array_filter($imageArray); // 过滤空值 + } + {/php} + {volist name="imageArray" id="image"} + + + + + {/volist} + +
缩略图操作
+
+ 缩略图 +
+
+ +
- {/volist} - {else} -
- 已上传图片 -
- -
-

{$resource.images|basename}

-
- {/if} {/if}
- +
@@ -685,6 +697,19 @@ updateImagesInput(); } }); + + // 图片预览功能 + window.previewImage = function(imageUrl) { + layer.photos({ + photos: { + "data": [{ + "src": imageUrl, + "alt": "图片预览" + }] + }, + anim: 5 + }); + }; }); @@ -820,4 +845,28 @@ .container-right { width: 65%; } + + /* 图片列表表格样式 */ + .image-list-table { + margin-top: 15px; + } + + .image-thumbnail { + width: 60px; + height: 60px; + border-radius: 4px; + overflow: hidden; + cursor: pointer; + transition: transform 0.2s; + } + + .image-thumbnail:hover { + transform: scale(1.05); + } + + .image-thumbnail img { + width: 100%; + height: 100%; + object-fit: cover; + } \ No newline at end of file diff --git a/app/index/view/component/main.php b/app/index/view/component/main.php index 77c5980..ac02e67 100644 --- a/app/index/view/component/main.php +++ b/app/index/view/component/main.php @@ -496,7 +496,7 @@ }); return ` -
+
@@ -576,7 +576,7 @@ if (!game) return ''; return ` -
+
diff --git a/app/index/view/resources/detail.php b/app/index/view/resources/detail.php index 8f94b60..8c58686 100644 --- a/app/index/view/resources/detail.php +++ b/app/index/view/resources/detail.php @@ -1,4 +1,9 @@ {include file="component/head" /} + + + + + {include file="component/header-simple" /}
@@ -24,8 +29,35 @@
- - +
+
+ {php} + // 兼容字符串和数组 + $images = isset($game['images']) ? $game['images'] : []; + if (is_string($images)) { + $images = explode(',', $images); + } + $images = array_filter($images); // 移除空值 + if (empty($images) && !empty($game['icon'])) { + $images = [$game['icon']]; + } + {/php} + {volist name="images" id="image"} +
+ + <?php echo $game['title']; ?> + +
+ {/volist} +
+
+
+
+
@@ -92,7 +124,7 @@
-这里放个人信息 + 这里放个人信息
@@ -135,7 +167,7 @@