From 251a13c3680fe67f51fcc50777aa181017e3daaa Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 6 May 2026 10:26:53 +0800 Subject: [PATCH 01/10] feat: topic ssd --- app/index/controller/TopicSsd.php | 22 ++++++++++++++++++++++ app/index/route/route.php | 6 ++++++ app/index/view/mobile/topic_ssd/index.html | 0 app/index/view/pc/topic_ssd/index.html | 0 4 files changed, 28 insertions(+) create mode 100644 app/index/controller/TopicSsd.php create mode 100644 app/index/view/mobile/topic_ssd/index.html create mode 100644 app/index/view/pc/topic_ssd/index.html diff --git a/app/index/controller/TopicSsd.php b/app/index/controller/TopicSsd.php new file mode 100644 index 00000000..70351d95 --- /dev/null +++ b/app/index/controller/TopicSsd.php @@ -0,0 +1,22 @@ + Date: Wed, 6 May 2026 10:50:48 +0800 Subject: [PATCH 02/10] =?UTF-8?q?=E9=97=AA=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/view/pc/topic_ssd/index.html | 56 ++++++++++++++++ .../static/index/pc/css/topic_ssd/index.css | 64 +++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 public/static/index/pc/css/topic_ssd/index.css diff --git a/app/index/view/pc/topic_ssd/index.html b/app/index/view/pc/topic_ssd/index.html index e69de29b..3a143134 100644 --- a/app/index/view/pc/topic_ssd/index.html +++ b/app/index/view/pc/topic_ssd/index.html @@ -0,0 +1,56 @@ + + + +
+ + diff --git a/public/static/index/pc/css/topic_ssd/index.css b/public/static/index/pc/css/topic_ssd/index.css new file mode 100644 index 00000000..ff4e5b45 --- /dev/null +++ b/public/static/index/pc/css/topic_ssd/index.css @@ -0,0 +1,64 @@ + +html { + width: 100%; +} +body { + /* width: 100vw; + height: 100vh; */ + background: #000; + overflow-x: hidden; + scroll-behavior: smooth !important; + -webkit-overflow-scrolling: touch !important; +} +/* 当视口宽度大于1920px时生效 */ +@media screen and (min-width: 1920px) { + /* 这里写你的样式 */ + body { + max-width:100% !important; + width: 100vw !important; + } + +} +.sc-main { + width: 100%; + height: 100%; + max-width: 2560px; + margin: 0 auto; +} + +a { + text-decoration: none; + display: block; +} + +img { + display: block; +} + +.sc-main-img { + width: 100%; + max-width: 2560px; +} + +.sc-mt20 { + margin-top: 0.2rem; +} + +.sc-main-imgs { + display: grid; + grid-template-columns: 1fr 1fr; + gap: 0.2rem; + list-style: none; + /* 去除列表样式(如果有) */ +} + +.sc-main-imgs a { + display: block; +} + +.sc-main-img1 { + width: 100%; + height: auto; + /* 保持比例 */ + display: block; +} \ No newline at end of file From 00e8eed191bf0fb472b6ffe3a0b4cd475f7a6cae Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Wed, 6 May 2026 11:34:57 +0800 Subject: [PATCH 03/10] topic ssd data --- app/index/controller/TopicSsd.php | 40 ++++++++++++++++++--- app/index/view/pc/topic_ssd/index.html | 48 ++++++++++---------------- 2 files changed, 53 insertions(+), 35 deletions(-) diff --git a/app/index/controller/TopicSsd.php b/app/index/controller/TopicSsd.php index 70351d95..a4b8483a 100644 --- a/app/index/controller/TopicSsd.php +++ b/app/index/controller/TopicSsd.php @@ -3,19 +3,49 @@ declare (strict_types = 1); namespace app\index\controller; +use app\index\model\SysBannerModel; use think\facade\View; -use think\Request; -class TopicSsd +/** + * 专题 - SSD + */ +class TopicSsd extends Common { /** - * 显示资源列表 - * - * @return \think\Response + * 专题 - SSD首页 */ public function index() { + $banners = SysBannerModel::with([ + 'items' => function ($query) { + $query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']) + ->order(['sort' => 'asc', 'id' => 'desc']) + ->enabled(true); + } + ]) + ->atPlatform(request()->from) + ->uniqueLabel([ + 'BANNER_69faaf8582967', // 专题 - 闪存(SSD)首页 - 焦点图 + 'BANNER_69fab1bed8f71', // 专题 - 闪存(SSD)首页 - 产品 + ]) + ->language($this->lang_id) + ->enabled(true) + ->order(['sort' => 'asc', 'id' => 'desc']) + ->select(); + $data = []; + if (!$banners->isEmpty()) { + $banners_map = []; + foreach ($banners as $banner) { + $banners_map[$banner->unique_label] = $banner; + } + + // 焦点图轮播图 + $data['top_focus_images'] = data_get($banners_map, 'BANNER_69faaf8582967')?->items->toArray(); + // 产品 + $data['products'] = data_get($banners_map, 'BANNER_69fab1bed8f71')?->items->toArray(); + } + View::assign('data', $data); return View::fetch('index'); } diff --git a/app/index/view/pc/topic_ssd/index.html b/app/index/view/pc/topic_ssd/index.html index 3a143134..fe1cb556 100644 --- a/app/index/view/pc/topic_ssd/index.html +++ b/app/index/view/pc/topic_ssd/index.html @@ -1,4 +1,7 @@ +{extend name="public/base" /} +{block name="style"} + - -
+{/block}
+{block name="main"}
+