diff --git a/app/admin/controller/Post.php b/app/admin/controller/Post.php index 53162f0..7b56ad9 100644 --- a/app/admin/controller/Post.php +++ b/app/admin/controller/Post.php @@ -14,6 +14,14 @@ use think\Request; class Post extends Common { + + public function initialize() + { + parent::initialize(); + + ModelPost::quickSelect(true); + } + /** * 显示资源列表 * diff --git a/app/index/controller/Index.php b/app/index/controller/Index.php index 3519b84..804fd1e 100644 --- a/app/index/controller/Index.php +++ b/app/index/controller/Index.php @@ -20,7 +20,9 @@ class Index extends Common { // - $list_post = Post::where('status', 1)->order('sort desc')->select(); + + + $list_post = Post::quickSelect(); if (empty($post_id)) { $model_post = $list_post->first(); diff --git a/app/index/route/app.php b/app/index/route/app.php new file mode 100644 index 0000000..fe110e1 --- /dev/null +++ b/app/index/route/app.php @@ -0,0 +1,5 @@ +order('sort desc')->select(); + Cache::set($cacke_key, $list_post,600); + } + + return $list_post; + } + } diff --git a/demo/list.html b/demo/list.html index bb9c6a9..365a93a 100644 --- a/demo/list.html +++ b/demo/list.html @@ -1,6 +1,97 @@
\ No newline at end of file diff --git a/public/cdn/layui-ul.css b/public/cdn/layui-ul.css index e448e37..3dfd7bb 100644 --- a/public/cdn/layui-ul.css +++ b/public/cdn/layui-ul.css @@ -1,24 +1,72 @@ -.ul-nav-tree{ +.ul-nav-tree { border-right: 1px solid #bbb; } -.ul-nav-tree-item{ - display: flex; + +.ul-nav-tree-item { + display : flex; align-items: baseline; - cursor: pointer; - padding: 5px; + cursor : pointer; + padding : 5px; } -.ul-nav-tree-item-title{ +.ul-nav-tree-item-title { font-size: 15px; - + } -.ul-nav-tree-item-desc{ - font-size: 14px; - color: #999; +.ul-nav-tree-item-desc { + font-size : 14px; + color : #999; margin-left: 15px; } -.ul-padding-md{ +.ul-padding-md { padding: 15px; +} + +.ul-avatar-list { + +} + +.ul-avatar-list-item { + display : flex; + align-items : center; + justify-content : space-between; + padding : 8px; + background-color: #ddd; +} +.ul-avatar-list-item.current{ + background-color: #bbb; +} +.ul-avatar-list-item-img { + height : 48px; + width : 48px; + background-image : url('/static/images/avatar.png'); + background-size : cover; + background-position: center; + border-radius : 3px; + background-color : #fff; +} + +.ul-avatar-list-item-info { + margin-left: 10px; + position : relative; + width : calc(100% - 48px - 10px); +} + +.ul-avatar-list-item-time { + position: absolute; + right : 0; + top : 0; + color: #999; +} + +.ul-avatar-list-item-tips { + color : #999; + font-size : 14px; + display : inline-block; + white-space : nowrap; + width : 100%; + overflow : hidden; + text-overflow: ellipsis; } \ No newline at end of file