调整模板

This commit is contained in:
2021-11-24 11:26:03 +08:00
parent 8d58d4784c
commit 0e1d243bbf
3 changed files with 72 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ class CategoryController extends Controller
/**
* 显示分类
*
* @param Category $category [description]
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [description]
*/
@@ -24,8 +25,17 @@ class CategoryController extends Controller
$template = 'show';
if ($category->template) {
$template = $category->template;
} else {
if ($category->type == Category::TYPE_VIDEO) {
$template = 'videos';
}
if ($category->type == Category::TYPE_ADVERT) {
$template = 'images';
}
}
$articles = $category->relations($category->type)
->where('status', 1)
->latest('sort')

View File

@@ -0,0 +1,54 @@
@extends('layouts.app')
@section('title', $parent->title)
@section('css')
<link href="{{ asset('assets/index/css/video.css') }}" rel="stylesheet" type="text/css"/>
@endsection
@section('content')
<!-- 面包屑导航 -->
@include('category.navigation')
<!-- 内容 -->
<div class="container">
<div class="row">
<!-- 左侧导航部分 -->
@include('category.left')
<!-- 右侧内容部分 -->
@if ($articles->isNotEmpty())
<div class="col-xs-12 col-md-9">
<div class="levelRight">
<div class="row">
@foreach ($articles as $article)
<div class="col-lg-4">
<div class="videoList">
<div class="ce-img videoImg m-video">
<span style="background-image: url({{ $article->cover_url }});"></span>
</div>
<div class="videoText">
<p class="ce-nowrap-multi">{{ $article->title }}</p>
</div>
</div>
</div>
@endforeach
</div>
</div>
<div class="pageUl">
@if ($articles->isNotEmpty())
{{ $articles->links('layouts.pagination') }}
@endif
</div>
</div>
@else
<div class="col-md-12 col-xs-12">
<div class="no-searchCont">
<img src="/assets/index/images/org55.png"/>
<span>抱歉,暂无内容</span>
</div>
</div>
@endif
</div>
</div>
@endsection

View File

@@ -25,8 +25,8 @@
<div class="col-lg-4">
<div class="videoList">
<div class="ce-img videoImg m-video"
data-src="{{ $article->cover_url }}">
<span style="background-image: url(/assets/index/images/index-news.png);"></span>
data-src="{{ $article->link_url }}">
<span style="background-image: url({{ $article->cover_url }});"></span>
<img class="videoImg-icon"
src="/assets/index/images/srIcon/srSpread_icon_list.png"/>
</div>