view index
This commit is contained in:
parent
5223d7140b
commit
c29d6ebfa8
@ -26,7 +26,7 @@ class Index extends BaseController
|
||||
//置顶文章
|
||||
$artTop = Cache::get('arttop');
|
||||
if(!$artTop){
|
||||
$artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([
|
||||
$artTop = Article::field('id,title,title_color,cate_id,user_id,create_time,is_top,jie,pv')->where(['is_top'=>1,'status'=>1,'delete_time'=>0])->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -40,7 +40,7 @@ class Index extends BaseController
|
||||
//首页文章显示20条
|
||||
$artList = Cache::get('artlist');
|
||||
if(!$artList){
|
||||
$artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie')->with([
|
||||
$artList = Article::field('id,title,title_color,cate_id,user_id,create_time,is_hot,jie,pv')->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
|
@ -12,17 +12,7 @@
|
||||
<div class="layui-col-md8">
|
||||
<!--首页幻灯-->
|
||||
<div class="fly-panel layui-hide-xs">
|
||||
<div class="layui-row fly-panel-main" style="padding: 15px;">
|
||||
<div class="layui-carousel fly-topline" id="FLY_topline" >
|
||||
<div carousel-item="">
|
||||
{volist name="slider" id="vo"}
|
||||
<div time-limit="2019-04-18 0:0:0" >
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow"> <img src="{$vo.slid_img}" alt="{$vo.slid_name}" /> </a>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="public/index-slider" /}
|
||||
</div>
|
||||
<!--置顶文章-->
|
||||
<div class="fly-panel">
|
||||
@ -32,77 +22,16 @@
|
||||
</div>
|
||||
<ul class="fly-list">
|
||||
{volist name="artTop" id="top" empty="还没有推荐"}
|
||||
<li>
|
||||
<a href="{:url('user/home',['id'=>$top.user_id])}" class="fly-avatar">
|
||||
<img src="{$top.user.user_img}" alt="{$top.user.name}">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">{$top.cate.catename}</a>
|
||||
<a href="{:url('article/detail',['id' => $top.id])}" style="color:{$top.title_color};">{$top.title}</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="{:url('user/home',['id'=>$top.user_id])}" link>
|
||||
<i class="layui-badge layui-bg-green" title="来自哪简称">{:getAsing($top.user.area_id) ?: '无'}</i>
|
||||
<cite>{$top.user.nickname ?: $top.user.name}</cite>
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
{if($top.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">VIP{$top.user.vip}</i>
|
||||
{/if}
|
||||
</a>
|
||||
<span>{$top.create_time|date='Y-m-d'}</span>
|
||||
|
||||
<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss></i>{$top.pv}</span>
|
||||
{if ($top.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> {$top.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
{if ($top.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
|
||||
{if ($top.is_hot == 1) <span class="layui-badge layui-bg-red">精帖</span> {/if}
|
||||
</div>
|
||||
</li>
|
||||
{include file="public/index-topforum" /}
|
||||
{/volist}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<!--文章列表-->
|
||||
<div class="fly-panel" style="margin-bottom: 0;">
|
||||
{include file="public/filter" /}
|
||||
<ul class="fly-list">
|
||||
{volist name="artList" id="art" empty="还没有帖子"}
|
||||
<li>
|
||||
<a href="{:url('user/home',['id'=>$art.user_id])}" class="fly-avatar">
|
||||
<img src="{$art.user.user_img}" alt="{$art.user.name}">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">{$art.cate.catename}</a>
|
||||
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="{:url('user/home',['id'=>$art.user.id])}" link>
|
||||
<i class="layui-badge layui-bg-green" title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</i>
|
||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
-->
|
||||
{if($art.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">VIP{$art.user.vip}</i>
|
||||
{/if}
|
||||
</a>
|
||||
<span>{$art.create_time|date='Y-m-d'}</span>
|
||||
|
||||
<span class="fly-list-kiss layui-hide-xs" title="悬赏飞吻"><i class="iconfont icon-kiss"></i>{$art.pv}</span>
|
||||
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
|
||||
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i>{$art.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
{if ($art.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
|
||||
{if ($art.is_hot == 1)} <span class="layui-badge layui-bg-red">精帖</span> {/if}
|
||||
</div>
|
||||
</li>
|
||||
{include file="public/index-forumlist" /}
|
||||
{/volist}
|
||||
</ul>
|
||||
<div style="text-align: center">
|
||||
@ -110,36 +39,16 @@
|
||||
<a href="{:url('article/cate',['ename'=>'all'])}" class="laypage-next">更多帖子</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-col-md4">
|
||||
<!--温馨通道-->
|
||||
<div class="fly-panel">
|
||||
<h3 class="fly-panel-title">温馨通道</h3>
|
||||
<div class="layui-row fly-panel-main" style="padding: 15px;">
|
||||
<div class="layui-clear fly-list-quick">
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="https://gitee.com/toogee/TaoLer/repository/archive/master.zip" target="_blank"> 程序下载 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="{:url('article/detail',['id'=>25])}" target="_blank"> 应用说明 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="#" target="_blank"> 申请Key </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="https://gitee.com/toogee/TaoLer" target="_blank"> Git 仓库 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="{:url('doc/timeline')}" target="_blank">版本更新日志</a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="#" target="_blank"> 关于积分 </a></div>
|
||||
</div>
|
||||
<a name="signin"> </a></div>
|
||||
</div>
|
||||
{include file="public/index-static" /}
|
||||
</div>
|
||||
{include file="public/sign" /}
|
||||
<!--广告赞助-->
|
||||
<div class="fly-panel">
|
||||
<div class="fly-panel-title">钻级赞助商<span class="fly-mid"></span>
|
||||
<a href="/" class="fly-link fly-joinad">我要加入</a>
|
||||
@ -166,11 +75,6 @@
|
||||
<span><i class="iconfont icon-pinglun1"></i> {$vo.comments_count}</span>
|
||||
</dd>
|
||||
{/volist}
|
||||
|
||||
<!-- 无数据时 -->
|
||||
<!--
|
||||
<div class="fly-none">没有相关数据</div>
|
||||
-->
|
||||
</dl>
|
||||
|
||||
<div class="fly-panel">
|
||||
@ -186,7 +90,7 @@
|
||||
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
|
||||
{/volist}
|
||||
</div>
|
||||
|
||||
<!--友情链接-->
|
||||
{include file="public/flink" /}
|
||||
</div>
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
<span class="fly-mid"></span>
|
||||
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'top'])} " {if condition="$type eq 'top'" } class="layui-this" {/if} >热帖</a>
|
||||
<span class="fly-mid"></span>
|
||||
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'hot'])} " {if condition="$type eq 'hot'" } class="layui-this" {/if} >精华</a>
|
||||
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'hot'])} " {if condition="$type eq 'hot'" } class="layui-this" {/if} >精贴</a>
|
||||
|
||||
<!--span class="fly-filter-right layui-hide-xs"><a href="" class="layui-this">按最新</a>
|
||||
<span class="fly-mid"></span><a href="">按热议</a></span-->
|
||||
|
33
view/taoler/index/public/index-forumlist.html
Normal file
33
view/taoler/index/public/index-forumlist.html
Normal file
@ -0,0 +1,33 @@
|
||||
<li>
|
||||
<a href="{:url('user/home',['id'=>$art.user_id])}" class="fly-avatar">
|
||||
<img src="{$art.user.user_img}" alt="{$art.user.name}">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">{$art.cate.catename}</a>
|
||||
<a href="{:url('article/detail',['id' => $art.id])}" style="color:{$art.title_color};">{$art.title}</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="{:url('user/home',['id'=>$art.user.id])}" link>
|
||||
<i class="layui-badge layui-bg-green" title="来自哪简称">{:getAsing($art.user.area_id) ?: '无'}</i>
|
||||
<cite>{$art.user.nickname ?: $art.user.name}</cite>
|
||||
<!--
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
-->
|
||||
{if($art.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">VIP{$art.user.vip}</i>
|
||||
{/if}
|
||||
</a>
|
||||
<span>{$art.create_time|date='Y-m-d'}</span>
|
||||
|
||||
<span class="layui-hide-xs" title="人气"><i class="iconfont" title="人气"></i> {$art.pv}</span>
|
||||
{if ($art.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
|
||||
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i>{$art.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
{if ($art.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
|
||||
{if ($art.is_hot == 1)} <span class="layui-badge layui-bg-red">精帖</span> {/if}
|
||||
</div>
|
||||
</li>
|
11
view/taoler/index/public/index-slider.html
Normal file
11
view/taoler/index/public/index-slider.html
Normal file
@ -0,0 +1,11 @@
|
||||
<div class="layui-row fly-panel-main" style="padding: 15px;">
|
||||
<div class="layui-carousel fly-topline" id="FLY_topline" >
|
||||
<div carousel-item="">
|
||||
{volist name="slider" id="vo"}
|
||||
<div time-limit="2019-04-18 0:0:0" >
|
||||
<a href="{$vo.slid_href}" target="_blank" rel="nofollow"> <img src="{$vo.slid_img}" alt="{$vo.slid_name}" /> </a>
|
||||
</div>
|
||||
{/volist}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
23
view/taoler/index/public/index-static.html
Normal file
23
view/taoler/index/public/index-static.html
Normal file
@ -0,0 +1,23 @@
|
||||
|
||||
<div class="layui-row fly-panel-main" style="padding: 15px;">
|
||||
<div class="layui-clear fly-list-quick">
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="https://gitee.com/toogee/TaoLer/repository/archive/master.zip" target="_blank"> 程序下载 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="{:url('article/detail',['id'=>25])}" target="_blank"> 应用说明 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="#" target="_blank"> 申请Key </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="https://gitee.com/toogee/TaoLer" target="_blank"> Git 仓库 </a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="{:url('doc/timeline')}" target="_blank">版本更新日志</a></div>
|
||||
</div>
|
||||
<div class="layui-col-xs6">
|
||||
<div><a href="#" target="_blank"> 关于积分 </a></div>
|
||||
</div>
|
||||
<a name="signin"> </a></div>
|
||||
</div>
|
30
view/taoler/index/public/index-topforum.html
Normal file
30
view/taoler/index/public/index-topforum.html
Normal file
@ -0,0 +1,30 @@
|
||||
<li>
|
||||
<a href="{:url('user/home',['id'=>$top.user_id])}" class="fly-avatar">
|
||||
<img src="{$top.user.user_img}" alt="{$top.user.name}">
|
||||
</a>
|
||||
<h2>
|
||||
<a class="layui-badge">{$top.cate.catename}</a>
|
||||
<a href="{:url('article/detail',['id' => $top.id])}" style="color:{$top.title_color};">{$top.title}</a>
|
||||
</h2>
|
||||
<div class="fly-list-info">
|
||||
<a href="{:url('user/home',['id'=>$top.user_id])}" link>
|
||||
<i class="layui-badge layui-bg-green" title="来自哪简称">{:getAsing($top.user.area_id) ?: '无'}</i>
|
||||
<cite>{$top.user.nickname ?: $top.user.name}</cite>
|
||||
<i class="iconfont icon-renzheng" title="认证信息:XXX"></i>
|
||||
{if($top.user.vip > 0)}
|
||||
<i class="layui-badge fly-badge-vip">VIP{$top.user.vip}</i>
|
||||
{/if}
|
||||
</a>
|
||||
<span>{$top.create_time|date='Y-m-d'}</span>
|
||||
|
||||
<span class=" layui-hide-xs" title="悬赏飞吻"><i class="iconfont" title="人气"></i> {$top.pv}</span>
|
||||
{if ($top.jie == 1)}<span class="layui-badge fly-badge-accept layui-hide-xs">已结</span>{/if}
|
||||
<span class="fly-list-nums">
|
||||
<i class="iconfont icon-pinglun1" title="回答"></i> {$top.comments_count}
|
||||
</span>
|
||||
</div>
|
||||
<div class="fly-list-badge">
|
||||
{if ($top.is_top == 1)} <span class="layui-badge layui-bg-black" >置顶</span> {/if}
|
||||
{if ($top.is_hot == 1)} <span class="layui-badge layui-bg-red">精帖</span> {/if}
|
||||
</div>
|
||||
</li>
|
Loading…
Reference in New Issue
Block a user