view index

This commit is contained in:
toogee 2020-05-16 18:07:23 +08:00
parent 5223d7140b
commit c29d6ebfa8
7 changed files with 151 additions and 150 deletions

View File

@ -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');
},

View File

@ -10,146 +10,55 @@
<div class="layui-row layui-col-space15">
<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>
</div>
<!--置顶文章-->
<div class="fly-panel">
<div class="fly-panel-title fly-filter">
<a>置顶</a>
<a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>
</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>
{/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>
{/volist}
</ul>
<div style="text-align: center">
<div class="laypage-main">
<a href="{:url('article/cate',['ename'=>'all'])}" class="laypage-next">更多帖子</a>
</div>
</div>
</div>
<!--首页幻灯-->
<div class="fly-panel layui-hide-xs">
{include file="public/index-slider" /}
</div>
<!--置顶文章-->
<div class="fly-panel">
<div class="fly-panel-title fly-filter">
<a>置顶</a>
<a href="#signin" class="layui-hide-sm layui-show-xs-block fly-right" id="LAY_goSignin" style="color: #FF5722;">去签到</a>
</div>
<ul class="fly-list">
{volist name="artTop" id="top" empty="还没有推荐"}
{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="还没有帖子"}
{include file="public/index-forumlist" /}
{/volist}
</ul>
<div style="text-align: center">
<div class="laypage-main">
<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>
</div>
<!--温馨通道-->
<div class="fly-panel">
<h3 class="fly-panel-title">温馨通道</h3>
{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>
</div>
<div class="fly-panel-main" style="padding: 13px 15px;">
{volist name="ad_index" id="vo"}
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
{/volist}
</div>
</div>
<!--广告赞助-->
<div class="fly-panel">
<div class="fly-panel-title">钻级赞助商<span class="fly-mid"></span>
<a href="/" class="fly-link fly-joinad">我要加入</a>
</div>
<div class="fly-panel-main" style="padding: 13px 15px;">
{volist name="ad_index" id="vo"}
<a href="{$vo.slid_href}" target="_blank" rel="nofollow" class="fly-zanzhu" style="background-color: {$vo.slid_color};">{$vo.slid_name}</a>
{/volist}
</div>
</div>
<div class="fly-panel fly-rank fly-rank-reply" id="LAY_replyRank">
<h3 class="fly-panel-title">回贴周榜</h3>
@ -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,8 +90,8 @@
<a href="{$vo.slid_href}" target="_blank"><img src="{$vo.slid_img}" style="max-width: 100%;"></a>
{/volist}
</div>
{include file="public/flink" /}
<!--友情链接-->
{include file="public/flink" /}
</div>
</div>

View File

@ -1,11 +1,11 @@
<div class="fly-panel-title fly-filter">
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all' ,'type' => ''])} " {if condition="$type eq ''" } class="layui-this" {/if} >综合</a>
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all' ,'type' => ''])} " {if condition="$type eq ''" } class="layui-this" {/if} >综合</a>
<span class="fly-mid"></span>
<a href="{:url('article/cate',['ename' => $Request.param.ename ?:'all','type' => 'jie'])} " {if condition="$type eq 'jie'" } class="layui-this" {/if} >已结</a>
<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' => '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>
<!--span class="fly-filter-right layui-hide-xs"><a href="" class="layui-this">按最新</a>
<span class="fly-mid"></span><a href="">按热议</a></span-->

View 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="人气">&#xe60b;</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>

View 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>

View 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>

View 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="人气">&#xe60b;</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>