From cd549aa32b83e4513701345eabf9a2fec83a1330 Mon Sep 17 00:00:00 2001 From: jsasg <735273025@qq.com> Date: Thu, 5 Jun 2025 16:34:23 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20mobile=E6=96=87=E7=AB=A0=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/controller/Article.php | 12 +++- app/index/view/mobile/article/index.html | 62 +++++++++++++++++++ .../static/index/mobile/css/article_index.css | 7 +++ 3 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 app/index/view/mobile/article/index.html create mode 100644 public/static/index/mobile/css/article_index.css diff --git a/app/index/controller/Article.php b/app/index/controller/Article.php index 367444cb..23660acc 100644 --- a/app/index/controller/Article.php +++ b/app/index/controller/Article.php @@ -32,7 +32,8 @@ class Article extends Common // 获取banner焦点图 $banner = SysBannerItemModel::hasWhere('banner', [ 'language_id' => $this->lang_id, - 'unique_label' => 'BANNER_67f9fc71e27db' + 'unique_label' => 'BANNER_67f9fc71e27db', + 'at_platform' => request()->from ]) ->type('image') ->visible(['id', 'title', 'image', 'link']) @@ -58,7 +59,8 @@ class Article extends Common 'id', 'title', 'desc', - 'image' + 'image', + 'release_time' ]) ->withSearch(['title'], ['title' => $param['keywords']??null]) ->category($param['cid']??$categorys[0]['id']) @@ -67,8 +69,12 @@ class Article extends Common ->paginate([ 'list_rows' => $param['size'], 'page' => $param['page'], + 'query' => request()->param([ + 'cid', + 'keywords', + ]) // 保留查询参数,防止分页丢失 ]); - } + } View::assign('articles', $articles??[]); return View::fetch('index'); diff --git a/app/index/view/mobile/article/index.html b/app/index/view/mobile/article/index.html new file mode 100644 index 00000000..676293f2 --- /dev/null +++ b/app/index/view/mobile/article/index.html @@ -0,0 +1,62 @@ +{extend name="public/base" /} +{block name="style"} + +{/block} +{block name="main"} +
{$ar.desc|raw}
+ + {$ar.release_time|default=''|date='Y-m-d'} +