From 3abdc52c43b965c6110d867c7a8eb86191131e14 Mon Sep 17 00:00:00 2001 From: augushong Date: Mon, 28 Jun 2021 21:58:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9E=E7=A7=BB=E5=8A=A8=E7=AB=AF?= =?UTF-8?q?=E7=BB=84=E4=BB=B6;=E7=A7=BB=E5=8A=A8=E7=AB=AF=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E5=88=86=E7=BB=84=E5=AF=BC=E8=88=AA=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/model/Post.php | 5 ++-- config/view_type.php | 6 ++-- demo/mb/nav.html | 28 +++++++++++++++++++ demo/{ => pc}/blockquote.html | 0 demo/{ => pc}/card.html | 0 demo/{ => pc}/files.html | 0 demo/{ => pc}/form.html | 0 demo/{ => pc}/group_panel.html | 0 demo/{ => pc}/header.html | 0 demo/{ => pc}/list.html | 0 demo/{ => pc}/nav.html | 0 demo/{ => pc}/none.html | 0 demo/{ => pc}/photo.html | 0 demo/{ => pc}/search.html | 0 demo/{ => pc}/title.html | 0 demo/{ => pc}/tree.html | 0 public/cdn/layui-ul-mb.css | 49 +++++++++++++++++++++++++++++++++ view/admin/system/index.html | 7 +++++ view/index/common/_require.html | 1 + 19 files changed, 92 insertions(+), 4 deletions(-) create mode 100644 demo/mb/nav.html rename demo/{ => pc}/blockquote.html (100%) rename demo/{ => pc}/card.html (100%) rename demo/{ => pc}/files.html (100%) rename demo/{ => pc}/form.html (100%) rename demo/{ => pc}/group_panel.html (100%) rename demo/{ => pc}/header.html (100%) rename demo/{ => pc}/list.html (100%) rename demo/{ => pc}/nav.html (100%) rename demo/{ => pc}/none.html (100%) rename demo/{ => pc}/photo.html (100%) rename demo/{ => pc}/search.html (100%) rename demo/{ => pc}/title.html (100%) rename demo/{ => pc}/tree.html (100%) create mode 100644 public/cdn/layui-ul-mb.css diff --git a/app/model/Post.php b/app/model/Post.php index 20ddfc9..4e6a130 100644 --- a/app/model/Post.php +++ b/app/model/Post.php @@ -151,9 +151,10 @@ class Post extends Model return ''; } - $base_dir = App::getRootPath() . '/demo/'; + $base_dir = App::getRootPath() . '/demo/' . $this->getAttr('category')->getData('tpl_name') . '/'; $file_path = $base_dir . $this->getData('tpl_name') . '.html'; + if (!file_exists($file_path)) { return ''; } @@ -190,7 +191,7 @@ class Post extends Model if (empty($model_post) || $clear) { $model_post = Post::find($id); - Cache::set($cache_key, $model_post, 600); + Cache::set($cache_key, $model_post, get_system_config('cache_expire_time')); } return $model_post; diff --git a/config/view_type.php b/config/view_type.php index 93933a4..29a52fb 100644 --- a/config/view_type.php +++ b/config/view_type.php @@ -2,9 +2,11 @@ return [ 'category' => [ - '' => '普通:', + '' => '普通', + 'pc' => '电脑端', + 'mb' => '移动端', ], 'post' => [ - '' => '普通:', + '' => '普通', ] ]; diff --git a/demo/mb/nav.html b/demo/mb/nav.html new file mode 100644 index 0000000..bbeba6c --- /dev/null +++ b/demo/mb/nav.html @@ -0,0 +1,28 @@ +
+ 分组卡片导航 +
+
+
+
+ 美图 +
+
+
+
+ +
+
+
+ 模特写真 +
+
+ 美艳大片 +
+ +
+
+
+
+
+
+
\ No newline at end of file diff --git a/demo/blockquote.html b/demo/pc/blockquote.html similarity index 100% rename from demo/blockquote.html rename to demo/pc/blockquote.html diff --git a/demo/card.html b/demo/pc/card.html similarity index 100% rename from demo/card.html rename to demo/pc/card.html diff --git a/demo/files.html b/demo/pc/files.html similarity index 100% rename from demo/files.html rename to demo/pc/files.html diff --git a/demo/form.html b/demo/pc/form.html similarity index 100% rename from demo/form.html rename to demo/pc/form.html diff --git a/demo/group_panel.html b/demo/pc/group_panel.html similarity index 100% rename from demo/group_panel.html rename to demo/pc/group_panel.html diff --git a/demo/header.html b/demo/pc/header.html similarity index 100% rename from demo/header.html rename to demo/pc/header.html diff --git a/demo/list.html b/demo/pc/list.html similarity index 100% rename from demo/list.html rename to demo/pc/list.html diff --git a/demo/nav.html b/demo/pc/nav.html similarity index 100% rename from demo/nav.html rename to demo/pc/nav.html diff --git a/demo/none.html b/demo/pc/none.html similarity index 100% rename from demo/none.html rename to demo/pc/none.html diff --git a/demo/photo.html b/demo/pc/photo.html similarity index 100% rename from demo/photo.html rename to demo/pc/photo.html diff --git a/demo/search.html b/demo/pc/search.html similarity index 100% rename from demo/search.html rename to demo/pc/search.html diff --git a/demo/title.html b/demo/pc/title.html similarity index 100% rename from demo/title.html rename to demo/pc/title.html diff --git a/demo/tree.html b/demo/pc/tree.html similarity index 100% rename from demo/tree.html rename to demo/pc/tree.html diff --git a/public/cdn/layui-ul-mb.css b/public/cdn/layui-ul-mb.css new file mode 100644 index 0000000..582a5b5 --- /dev/null +++ b/public/cdn/layui-ul-mb.css @@ -0,0 +1,49 @@ +.ul-mb-ui-container{ + width: 300px; + max-height: 500px; + overflow: scroll; +} + +.ul-mb-nav-group-card{ + +} + +.ul-mb-nav-group-card-title{ + font-weight: 600; + line-height: 2; + font-size: 16px; +} +.ul-mb-nav-group-card-list{ + display: flex; + align-items: flex-start; + justify-content: space-between; + flex-wrap: wrap; +} +.ul-mb-nav-group-card-item{ + display: flex; + align-items: center; + justify-content: flex-start; + background-color: #fff; + border-radius: 3px; + padding: 8px; + margin-bottom: 15px; + width: 42%; +} + +.ul-mb-nav-group-card-item-icon{ + width: 50px; + height: 50px; + background-position: center; + background-size: cover; + margin-right: 8px; + +} +.ul-mb-nav-group-card-item-title{ + line-height: 2; + font-size: 14px; +} + +.ul-mb-nav-group-card-item-desc{ + color: #999; + font-size: 12px; +} \ No newline at end of file diff --git a/view/admin/system/index.html b/view/admin/system/index.html index f426456..22eab3c 100644 --- a/view/admin/system/index.html +++ b/view/admin/system/index.html @@ -111,6 +111,13 @@ class="layui-input"> +
+
缓存时长(秒)
+
+ +
+
二维码
diff --git a/view/index/common/_require.html b/view/index/common/_require.html index 9e0bc64..fbd89de 100644 --- a/view/index/common/_require.html +++ b/view/index/common/_require.html @@ -5,6 +5,7 @@ +