@@ -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"}
+
+
+
+
+
+
+
+
+
+ {/volist}
+
@@ -92,7 +124,7 @@
-这里放个人信息
+ 这里放个人信息
@@ -135,7 +167,7 @@
-
相关游戏
+相关资源
// 页面加载完成后执行
document.addEventListener('DOMContentLoaded', function () {
+
// 获取游戏ID
const gameId = new URLSearchParams(window.location.search).get('id');
if (!gameId) {
@@ -261,6 +294,40 @@
});
}
+
+ const swiper = new Swiper('.game-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
+ });
+
//复制分享码
const codeBtn = document.getElementById('codeBtn');
if (codeBtn) {
@@ -292,23 +359,21 @@
// 返回顶部功能
const goToTop = document.getElementById('goToTop');
-
- // 监听滚动事件
- window.addEventListener('scroll', function () {
- if (window.pageYOffset > 300) {
- goToTop.classList.add('show');
- } else {
- goToTop.classList.remove('show');
- }
- });
-
- // 点击返回顶部
- goToTop.addEventListener('click', function () {
- window.scrollTo({
- top: 0,
- behavior: 'smooth'
+ if (goToTop) {
+ window.addEventListener('scroll', function () {
+ if (window.pageYOffset > 300) {
+ goToTop.classList.add('show');
+ } else {
+ goToTop.classList.remove('show');
+ }
});
- });
+ goToTop.addEventListener('click', function () {
+ window.scrollTo({
+ top: 0,
+ behavior: 'smooth'
+ });
+ });
+ }
});
// 更新游戏访问次数
@@ -393,7 +458,7 @@
.detail-top-right {
width: 30%;
- border-left: 1px solid #eee ;
+ border-left: 1px solid #eee;
margin: 20px;
}
@@ -754,6 +819,25 @@
background-color: #0081ff12;
border-radius: 5px;
}
+
+ .detail-top-card-left {
+ width: 350px;
+ }
+
+ .swiper .swiper-button-prev,
+ .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);
+ }
+
+ .swiper .swiper-button-prev:after,
+ .swiper .swiper-button-next:after {
+ font-size: 18px;
+ }
{include file="component/foot" /}
\ No newline at end of file
diff --git a/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php b/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
index fafc318..6edc76a 100644
--- a/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
+++ b/runtime/admin/temp/606cb5a28477c3a4a33c90fc473c4624.php
@@ -1,4 +1,4 @@
-
+
@@ -192,7 +192,10 @@
$image): $mod = ($i % 2 );++$i;?>
-
+
-
+
-
+
diff --git a/runtime/index/temp/cb3abdcb36407244b9b613766f30573b.php b/runtime/index/temp/cb3abdcb36407244b9b613766f30573b.php
index 5e9a909..4f33f85 100644
--- a/runtime/index/temp/cb3abdcb36407244b9b613766f30573b.php
+++ b/runtime/index/temp/cb3abdcb36407244b9b613766f30573b.php
@@ -1,4 +1,4 @@
-
+
@@ -1422,7 +1422,7 @@ $loginStatus = [
});
return `
-
+
@@ -1502,7 +1502,7 @@ $loginStatus = [
if (!game) return '';
return `
-
+
@@ -1496,7 +1500,9 @@ $loginStatus = [
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;
}
@@ -1914,6 +1920,7 @@ $loginStatus = [
.program-show {
margin: 20px 0;
+ margin-bottom: 60px;
background: #fff;
border-radius: 8px;
padding: 20px;
@@ -2021,7 +2028,7 @@ $loginStatus = [
}
.lb-data .lb-caption {
- font-size: 14px;
+ font-size: 1.3rem;
font-weight: normal;
}
From 6b32df536865c868fd513a85c5a9f10bac445519 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com>
Date: Thu, 10 Jul 2025 11:32:20 +0800
Subject: [PATCH 5/7] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=89=8D=E7=AB=AF?=
=?UTF-8?q?=E8=B5=84=E6=BA=90=E8=AF=A6=E6=83=85=E9=A1=B5=E4=BB=A3=E7=A0=81?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/index/controller/ResourcesController.php | 105 +++---
app/index/view/articles/index.php | 145 +++++----
app/index/view/resources/detail.php | 321 +++++++++++++------
3 files changed, 367 insertions(+), 204 deletions(-)
diff --git a/app/index/controller/ResourcesController.php b/app/index/controller/ResourcesController.php
index 2946474..cf2ab8a 100644
--- a/app/index/controller/ResourcesController.php
+++ b/app/index/controller/ResourcesController.php
@@ -17,7 +17,7 @@
*/
/**
- * 游戏下载控制器
+ * 资源下载控制器
*/
namespace app\index\controller;
use app\index\controller\BaseController;
@@ -27,6 +27,8 @@ use think\facade\Request;
use app\index\model\Resources\Resources;
use app\index\model\Resources\ResourcesCategory;
use app\index\model\Attachments;
+use app\index\model\Users;
+use app\index\model\Articles\Articles;
class ResourcesController extends BaseController
{
@@ -66,7 +68,7 @@ class ResourcesController extends BaseController
return View::fetch();
}
- // 游戏列表页
+ // 资源列表页
public function list()
{
$cid = input('cid/d', 0);
@@ -99,60 +101,84 @@ class ResourcesController extends BaseController
return View::fetch('list');
}
- // 游戏详情页
+ // 资源详情页
public function detail()
{
$id = Request::param('id/d', 0);
- $game = Resources::where('id', $id)->find();
+ $resources = Resources::where('id', $id)->find();
- if (!$game) {
- return json(['code' => 0, 'msg' => '游戏不存在或已被删除']);
+ if (!$resources) {
+ return json(['code' => 0, 'msg' => '资源不存在或已被删除']);
}
// 如果size没有,从附件表中获取
- if (empty($game['size']) && !empty($game['fileurl'])) {
- $attachment = Attachments::where('src', $game['fileurl'])
+ if (empty($resources['size']) && !empty($resources['fileurl'])) {
+ $attachment = Attachments::where('src', $resources['fileurl'])
->find();
if ($attachment && !empty($attachment['size'])) {
$size = $attachment['size'];
// 转换文件大小为合适的单位
if ($size >= 1073741824) { // 1GB = 1024MB = 1024*1024KB = 1024*1024*1024B
- $game['size'] = round($size / 1073741824, 2) . 'GB';
+ $resources['size'] = round($size / 1073741824, 2) . 'GB';
} elseif ($size >= 1048576) { // 1MB = 1024KB = 1024*1024B
- $game['size'] = round($size / 1048576, 2) . 'MB';
+ $resources['size'] = round($size / 1048576, 2) . 'MB';
} else {
- $game['size'] = round($size / 1024, 2) . 'KB';
+ $resources['size'] = round($size / 1024, 2) . 'KB';
}
}
}
// 获取分类名称
- $cateName = ResourcesCategory::where('id', $game['cate'])
+ $cateName = ResourcesCategory::where('id', $resources['cate'])
->value('name');
- // 获取上一个和下一个游戏
- $prevGame = Resources::where('id', '<', $id)
+ // 获取作者信息
+ $authorInfo = Users::where('name', $resources['uploader'])->find();
+ // var_dump($authorInfo);
+ if ($authorInfo) {
+ // 统计作者的文章数
+ $resourcesCount = Articles::where('author', $resources['uploader'])->count();
+ // 统计作者的资源数
+ $resourceCount = Resources::where('uploader', $resources['uploader'])->count();
+
+ $authorData = [
+ 'avatar' => $authorInfo['avatar'] ?: '/static/images/avatar.png',
+ 'name' => $authorInfo['name'],
+ 'resource_count' => $resourceCount,
+ 'article_count' => $resourcesCount
+ ];
+ } else {
+ $authorData = [
+ 'avatar' => '/static/images/avatar.png',
+ 'name' => $resources['author'],
+ 'resource_count' => 0,
+ 'article_count' => 0
+ ];
+ }
+
+ // 获取上一个和下一个资源
+ $prevResources = Resources::where('id', '<', $id)
->where('delete_time', null)
->where('status', 1)
- ->where('cate', $game['cate'])
+ ->where('cate', $resources['cate'])
->field(['id', 'title'])
->order('id DESC')
->find();
- $nextGame = Resources::where('id', '>', $id)
+ $nextResources = Resources::where('id', '>', $id)
->where('delete_time', null)
->where('status', 1)
- ->where('cate', $game['cate'])
+ ->where('cate', $resources['cate'])
->field(['id', 'title'])
->order('id ASC')
->find();
- // 获取相关游戏(同分类的其他游戏)
- $relatedGames = Db::table('yz_resources')
+ // 获取相关资源(同分类的其他资源)
+ $relatedResourcess = Db::table('yz_resources')
->alias('g')
->join('yz_resources_category c', 'g.cate = c.id')
- ->where('g.cate', $game['cate'])
+ ->where('g.cate', $resources['cate'])
->where('g.id', '<>', $id)
->where('g.delete_time', null)
->where('g.status', 1)
@@ -162,7 +188,7 @@ class ResourcesController extends BaseController
'IF(g.icon IS NULL OR g.icon = "", c.icon, g.icon) as icon'
])
->order('g.id DESC')
- ->limit(3)
+ ->limit(5)
->select()
->toArray();
@@ -172,28 +198,29 @@ class ResourcesController extends BaseController
'code' => 1,
'msg' => '获取成功',
'data' => [
- 'game' => $game,
+ 'resources' => $resources,
'cateName' => $cateName,
- 'prevGame' => $prevGame,
- 'nextGame' => $nextGame,
- 'relatedGames' => $relatedGames
+ 'prevResources' => $prevResources,
+ 'nextResources' => $nextResources,
+ 'relatedResourcess' => $relatedResourcess
]
]);
}
// 非 AJAX 请求返回视图
View::assign([
- 'game' => $game,
+ 'resources' => $resources,
'cateName' => $cateName,
- 'prevGame' => $prevGame,
- 'nextGame' => $nextGame,
- 'relatedGames' => $relatedGames
+ 'authorInfo' => $authorData,
+ 'prevResources' => $prevResources,
+ 'nextResources' => $nextResources,
+ 'relatedResourcess' => $relatedResourcess
]);
return View::fetch('detail');
}
- // 游戏下载
+ // 资源下载
public function downloadurl()
{
if (!Request::isAjax()) {
@@ -202,13 +229,13 @@ class ResourcesController extends BaseController
$id = Request::param('id/d', 0);
- // 获取游戏信息
- $game = Resources::where('id', $id)
+ // 获取资源信息
+ $resources = Resources::where('id', $id)
->where('delete_time', null)
->find();
- if (!$game) {
- return json(['code' => 0, 'msg' => '游戏不存在']);
+ if (!$resources) {
+ return json(['code' => 0, 'msg' => '资源不存在']);
}
// 更新下载次数
@@ -222,7 +249,7 @@ class ResourcesController extends BaseController
'code' => 1,
'msg' => '下载成功',
'data' => [
- 'url' => $game['url']
+ 'url' => $resources['url']
]
]);
} else {
@@ -248,7 +275,7 @@ class ResourcesController extends BaseController
}
/**
- * 更新游戏访问次数
+ * 更新资源访问次数
*/
public function updateViews()
{
@@ -263,9 +290,9 @@ class ResourcesController extends BaseController
try {
// 更新访问次数
- $game = Resources::where('id', $id)->find();
- if (!$game) {
- return json(['code' => 0, 'msg' => '游戏不存在']);
+ $resources = Resources::where('id', $id)->find();
+ if (!$resources) {
+ return json(['code' => 0, 'msg' => '资源不存在']);
}
// 更新访问次数
diff --git a/app/index/view/articles/index.php b/app/index/view/articles/index.php
index 9ad61c3..d9086b3 100644
--- a/app/index/view/articles/index.php
+++ b/app/index/view/articles/index.php
@@ -23,7 +23,8 @@
+
diff --git a/runtime/index/temp/f8995f34639557c9f17f79801bc58d25.php b/runtime/index/temp/f8995f34639557c9f17f79801bc58d25.php
index d7a6eef..26e7e27 100644
--- a/runtime/index/temp/f8995f34639557c9f17f79801bc58d25.php
+++ b/runtime/index/temp/f8995f34639557c9f17f79801bc58d25.php
@@ -1,4 +1,4 @@
-
+
@@ -955,6 +955,8 @@ $loginStatus = [
+
+
@@ -979,6 +981,8 @@ $loginStatus = [
资源简介
+
-
{volist name="cate.subCategories" id="subCategory"}
-
- +
- {$subCategory.name} @@ -38,38 +39,42 @@
{volist name="cate.subCategories" id="subCategory"}
{if $cate.id == $subCategory.id}
- {if !empty($subCategory.list)}
- {volist name="subCategory.list" id="article"}
-
-
- {/volist}
- {else}
-
-
+ -->
{include file="public/tail" /}
\ No newline at end of file
diff --git a/app/admin/view/yunzeradmin/contentpushadd.php b/app/admin/view/yunzeradmin/contentpushadd.php
index c879de6..4a7dc0e 100644
--- a/app/admin/view/yunzeradmin/contentpushadd.php
+++ b/app/admin/view/yunzeradmin/contentpushadd.php
@@ -1,26 +1,35 @@
{include file="public/header" /}
-
-
-
-
-
-
-
-
+
+ {/volist}
+ {else}
+
@@ -82,25 +87,25 @@
-
-
- 暂无文章
-当前分类下没有找到相关文章
+ {if !empty($subCategory.list)} + {volist name="subCategory.list" id="article"} +
+
+
+
+
+
+
+
+
- {/if}
+
+
+ ${article.title}
+ +
+
+
+ ${article.views ||
+ 0}
+ ${article.likes ||
+ 0}
+
+
+
+ {/if}
{/if}
{/volist}
+
+
+ 暂无文章
+当前分类下没有找到相关文章
+
-
-
+
+
+
-
+
-
+
@@ -64,50 +83,92 @@
-
-{include file="public/tail" /}
+{include file="public/tail" /}
\ No newline at end of file
diff --git a/app/admin/view/yunzeradmin/selectpushcontent.php b/app/admin/view/yunzeradmin/selectpushcontent.php
new file mode 100644
index 0000000..af55c76
--- /dev/null
+++ b/app/admin/view/yunzeradmin/selectpushcontent.php
@@ -0,0 +1,29 @@
+{include file="public/header" /}
+
+
+
+
+
+
+{include file="public/tail" /}
\ No newline at end of file
From 95b70b20b4711d03f37d6e0d206c8ce5874344f8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E5=BF=97=E5=BC=BA?= <357099073@qq.com>
Date: Mon, 14 Jul 2025 14:43:14 +0800
Subject: [PATCH 7/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E8=8F=9C=E5=8D=95?=
=?UTF-8?q?=E7=BC=96=E8=BE=91?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
app/admin/view/index/welcome.php | 6 ++---
app/admin/view/yunzer/menuedit.php | 39 +++++++++++++++++++++++++++++-
2 files changed, 41 insertions(+), 4 deletions(-)
diff --git a/app/admin/view/index/welcome.php b/app/admin/view/index/welcome.php
index 0dab17e..2b107bc 100644
--- a/app/admin/view/index/welcome.php
+++ b/app/admin/view/index/welcome.php
@@ -317,7 +317,7 @@ function getUserCounts() {
fetch('{:url("users/counts")}')
.then(response => response.json())
.then(res => {
- console.log('用户统计接口返回数据:', res);
+ // console.log('用户统计接口返回数据:', res);
if (res.code === 0 && res.data) {
// 更新用户总数
document.querySelector('.stat-card:nth-child(1) .stat-value').textContent = res.data.total.toLocaleString();
@@ -353,7 +353,7 @@ function getArticleCounts() {
fetch('{:url("articles/counts")}')
.then(response => response.json())
.then(res => {
- console.log('文章统计接口返回数据:', res);
+ // console.log('文章统计接口返回数据:', res);
if (res.code === 0 && res.data) {
// 更新文章总数
document.querySelector('.stat-card:nth-child(3) .stat-value').textContent = res.data.total.toLocaleString();
@@ -389,7 +389,7 @@ function getResourcesCounts() {
fetch('{:url("resources/counts")}')
.then(response => response.json())
.then(res => {
- console.log('资源统计接口返回数据:', res);
+ // console.log('资源统计接口返回数据:', res);
if (res.code === 0 && res.data) {
// 更新资源总数
document.querySelector('.stat-card:nth-child(4) .stat-value').textContent = res.data.total.toLocaleString();
diff --git a/app/admin/view/yunzer/menuedit.php b/app/admin/view/yunzer/menuedit.php
index 3c94d40..cd130ac 100644
--- a/app/admin/view/yunzer/menuedit.php
+++ b/app/admin/view/yunzer/menuedit.php
@@ -50,8 +50,10 @@
| 标题 | +
|---|
| + + + + | +