From 3ba64348f5781da6d5810f30b5b6b8c9151a3aa5 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Sat, 7 Jun 2025 13:54:34 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mobile=20nas=E4=B8=BB=E9=A2=98=E9=A6=96?= =?UTF-8?q?=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/index/common.php | 12 + app/index/controller/TopicNas.php | 8 +- app/index/lang/en-us/mobile.php | 6 + app/index/view/mobile/topic_nas/index.html | 150 +++++++ .../index/mobile/css/topic_nas_index.css | 368 ++++++++++++++++++ 5 files changed, 543 insertions(+), 1 deletion(-) create mode 100644 app/index/view/mobile/topic_nas/index.html create mode 100644 public/static/index/mobile/css/topic_nas_index.css diff --git a/app/index/common.php b/app/index/common.php index 7e901805..7fc6e0a6 100644 --- a/app/index/common.php +++ b/app/index/common.php @@ -111,3 +111,15 @@ if (!function_exists('lang_i18n')) { return Lang::get($lang_key, $vars, $lang); } } + +if (!function_exists('array_flatten')) { + /** + * 将多维数组转换为一维数组 + * @param array $array + * @return array + */ + function array_flatten(array $array, int $depth = 1): array + { + return \think\helper\Arr::flatten($array, $depth); + } +} diff --git a/app/index/controller/TopicNas.php b/app/index/controller/TopicNas.php index 4ad0a561..a96d0649 100644 --- a/app/index/controller/TopicNas.php +++ b/app/index/controller/TopicNas.php @@ -20,6 +20,10 @@ class TopicNas extends Common { // 获取国家/语言列表 $languages = $this->getLanguages(); + // 输出国家/语言列表 + if (request()->isMobile()) { + View::assign('header_languages', $languages); + } // 获取当前语言 $current_language = $this->getCurrentLanguage($languages); @@ -61,8 +65,10 @@ class TopicNas extends Common $nas_software = []; // 获取banner数据 $banners = SysBannerModel::with(['items' => function($query) { - $query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']); + $query->withoutField(['sort', 'created_at', 'updated_at', 'deleted_at']) + ->order(['sort' => 'asc', 'id' => 'desc']); }]) + ->atPlatform(request()->from) ->uniqueLabel([ 'BANNER_680f156a805a8', 'BANNER_680f15ca5482f', diff --git a/app/index/lang/en-us/mobile.php b/app/index/lang/en-us/mobile.php index a631377d..6bc8a5f1 100644 --- a/app/index/lang/en-us/mobile.php +++ b/app/index/lang/en-us/mobile.php @@ -172,4 +172,10 @@ return [ '为了得到深圳市元创时代科技有限公司给予您的“包修、包换、包退”的权益,请您:' => 'For a smooth return and refund, quality warranty, please follow these steps:', '特别说明' => 'ORICO is not liable for:' ], + + // nas主题 - 首页 + 'topicnas/index' => [ + '网络存储解决方案' => 'Network Storage Solutions', + '配套软件' => 'Software', + ], ]; \ No newline at end of file diff --git a/app/index/view/mobile/topic_nas/index.html b/app/index/view/mobile/topic_nas/index.html new file mode 100644 index 00000000..de30245e --- /dev/null +++ b/app/index/view/mobile/topic_nas/index.html @@ -0,0 +1,150 @@ +{extend name="public/base"/} +{block name="style"} + +{/block} +{block name="main"} +