调整模板
This commit is contained in:
@@ -11,6 +11,7 @@ class CategoryController extends Controller
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 显示分类
|
* 显示分类
|
||||||
|
*
|
||||||
* @param Category $category [description]
|
* @param Category $category [description]
|
||||||
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector|\Illuminate\View\View [type] [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';
|
$template = 'show';
|
||||||
if ($category->template) {
|
if ($category->template) {
|
||||||
$template = $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)
|
$articles = $category->relations($category->type)
|
||||||
->where('status', 1)
|
->where('status', 1)
|
||||||
->latest('sort')
|
->latest('sort')
|
||||||
|
|||||||
54
resources/views/category/images.blade.php
Normal file
54
resources/views/category/images.blade.php
Normal 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
|
||||||
@@ -25,8 +25,8 @@
|
|||||||
<div class="col-lg-4">
|
<div class="col-lg-4">
|
||||||
<div class="videoList">
|
<div class="videoList">
|
||||||
<div class="ce-img videoImg m-video"
|
<div class="ce-img videoImg m-video"
|
||||||
data-src="{{ $article->cover_url }}">
|
data-src="{{ $article->link_url }}">
|
||||||
<span style="background-image: url(/assets/index/images/index-news.png);"></span>
|
<span style="background-image: url({{ $article->cover_url }});"></span>
|
||||||
<img class="videoImg-icon"
|
<img class="videoImg-icon"
|
||||||
src="/assets/index/images/srIcon/srSpread_icon_list.png"/>
|
src="/assets/index/images/srIcon/srSpread_icon_list.png"/>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user