From 37681826e7e3d2a7dfd52a0e322f69bfce115c43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Wed, 24 Feb 2021 18:14:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E9=A1=B5=E9=9D=A2=E9=85=8D?= =?UTF-8?q?=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/data/controller/Config.php | 14 +++++++++++--- app/data/view/config/page_home.html | 12 ++++++------ 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/app/data/controller/Config.php b/app/data/controller/Config.php index c5748c0db..cac7545e8 100644 --- a/app/data/controller/Config.php +++ b/app/data/controller/Config.php @@ -11,6 +11,15 @@ use think\admin\Controller; */ class Config extends Controller { + /** + * 页面类型 + * @var array + */ + protected $pageTypes = [ + '关于我们' => '关于我们', + '用户协议' => '用户协议', + ]; + /** * 微信小程序配置 * @auth true @@ -33,7 +42,6 @@ class Config extends Controller public function pageHome() { $this->title = '内容页面管理'; - $this->types = ['关于我们', '用户协议']; $this->fetch('page_home'); } @@ -46,8 +54,8 @@ class Config extends Controller */ public function pageEdit() { - $this->skey = input('type'); - $this->title = '编辑' . $this->skey; + $this->skey = input('type') ?: $this->pageTypes[0]; + $this->title = '编辑' . $this->pageTypes[$this->skey] ?? ''; $this->__sysdata('page_form', 'javascript:history.back()'); } diff --git a/app/data/view/config/page_home.html b/app/data/view/config/page_home.html index 9b1feeaa6..07ce39846 100644 --- a/app/data/view/config/page_home.html +++ b/app/data/view/config/page_home.html @@ -2,19 +2,19 @@ {block name='content'}
- {foreach $types as $type} -
+ {foreach $pageTypes as $key=>$type} +
-
-
-
编辑页面内容
+
+
+
编辑页面内容
{$type|default=''}
-
编辑页面内容
+
编辑页面内容
{$type|default=''}