样式及详情等

This commit is contained in:
Jerry Yan 2022-07-29 17:12:24 +08:00
parent a0aa7fd81c
commit ac85b2558a
12 changed files with 21071 additions and 35 deletions

View File

@ -10,10 +10,19 @@ class ProgramQueryController extends BaseController
{
public function index(Request $request) {
$keyword = $request->get("keyword", "");
$programs = Programs::query()->with(["appends", "video_pivots.video"])->where("status", "=", 1)->limit(15)->orderByDesc("created_at")->get();
$programs = Programs::query()->with(["appends", "video_pivots.video"])
->where("status", "=", 1)->limit(15)->orderByDesc("created_at")
->paginate();
return view("program.index", [
"keyword" => $keyword,
"programs"=>$programs,
]);
}
public function videos(Request $request, Programs $program) {
return view("program.video.index", [
"program" => $program,
"videos" => $program->video_pivots,
]);
}
}

View File

@ -37,9 +37,10 @@ class ProgramVideoConstructController extends BaseController
$full_path = Storage::url($path);
$program_video->stop_image = str_replace("jerryyan.top", "jerryyan.net", $full_path);
}
$program_video->created_at = $request->post("created_at");
$program_video->update($updatePayload);
return view("program.construct.video.create", [
"program_video" => $program_video
]);
return redirect(route("program.construct.video.list", [
"program"=>$program_video->program_id
]));
}
}

View File

@ -15,7 +15,7 @@ class Programs extends Model
public function video_pivots(): \Illuminate\Database\Eloquent\Relations\HasMany
{
return $this->hasMany(ProgramVideos::class, "program_id", "id");
return $this->hasMany(ProgramVideos::class, "program_id", "id")->orderBy("created_at");
}
public function videos(): \Illuminate\Database\Eloquent\Relations\HasManyThrough

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,4 +1,4 @@
{
"/js/app.js": "/js/app.js?id=f775b77a8886d46e619d4d79272ec38d",
"/css/app.css": "/css/app.css?id=3aa5b50b5993b45cf8b45f2a31c3e3c6"
"/js/app.js": "/js/app.js?id=118ad1c7656e9b1feb9634a5ed494f76",
"/css/app.css": "/css/app.css?id=009ea0c84289f2756329452a0f5516ed"
}

View File

@ -7,7 +7,7 @@
</head>
<body>
@include("common.header")
<form action="">
<form class="form" action="">
<label for="keyword">查找节目单关键词,空格隔开查找多个关键词</label>
<input class="border border-black" type="text" name="keyword" id="keyword" value="{{$keyword}}">
<input class="border border-black" type="submit">

View File

@ -28,6 +28,10 @@
@endif
<input class="form-input border-0 border-b-2 w-full" type="file" name="start_image">
</label>
<label class="block my-2">
节目开打时间
<input class="form-input border-0 border-b-2 w-full" type="datetime-local" step="1" name="created_at" value="{{$program_video->created_at}}">
</label>
<label class="block my-2">
结束P数
<input class="form-input border-0 border-b-2 w-full" type="number" name="stop_part" value="{{$program_video->stop_part}}">

View File

@ -21,13 +21,17 @@
@foreach($videos as $video_pivot)
<tr>
<td>
<a class="text-purple-600 underline" target="_blank"
<a class="underline" target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}"
title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}"
>{{$video_pivot->video_bvid}}</a>
</td>
<td>P{{$video_pivot->start_part}} {{$video_pivot->start_time}}</td>
<td>{{$video_pivot->created_at}}</td>
<td>
<a class="underline block" target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}"
title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}"
>P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</a>
@if($video_pivot->start_image)
<img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面">
@else
@ -35,6 +39,10 @@
@endif
</td>
<td>
<a class="underline" target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->stop_part}}&t={{$video_pivot->stop_sec}}"
title="P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}"
>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</a>
@if($video_pivot->stop_image)
<img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else

View File

@ -18,19 +18,19 @@
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">
<th class="border border-black">节目名称</th>
<th class="border border-black">点播及追加</th>
<th class="border border-black">节目开始</th>
<th class="border border-black">节目结束</th>
<th class="border border-black hidden lg:table-cell">节目开始</th>
<th class="border border-black hidden lg:table-cell">节目结束</th>
</tr>
</thead>
<tbody>
@foreach($programs as $program)
<tr>
<td class="border">
<a href="/programs/{{ $program->id }}/video">
<span title="节目">{{$program->name}}</span>
<span title="难度">{{$program->difficulty}}</span>
<span title="要求">{{$program->desc}}</span>
<br>
<span title="开打的时间">{{$program->created_at}}</span>
</a>
</td>
<td class="border">
@foreach($program->appends as $append)
@ -90,45 +90,43 @@
<a href="{{route('program.construct.append.list', ['program'=>$program->id])}}">去建设</a>
@endif
</td>
<td class="border">
<td class="border hidden lg:table-cell">
@foreach($program->video_pivots as $video_pivot)
<a
<a class="block"
target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}"
title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}"
>
<div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面">
@else
节目开始位置
<a href="{{route('program.construct.video.edit', ['program_video'=>$video_pivot->id])}}">去建设</a>
@endif
</a>
@endforeach
</td>
<td class="border">
<td class="border hidden lg:table-cell">
@foreach($program->video_pivots as $video_pivot)
@if($video_pivot->stop_part)
<a
<a class="block"
target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->stop_part}}&t={{$video_pivot->stop_sec}}"
title="P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}"
>
<div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else
节目结束位置
@endif
</a>
@else
<a href="{{route('program.construct.video.edit', ['program_video'=>$video_pivot->id])}}">去建设</a>
@endif
@endforeach
</td>
</tr>
@endforeach
</tbody>
</table>
{{$programs->links()}}
@include("common.footer")
</body>
</html>

View File

@ -0,0 +1,116 @@
<html lang="zh">
<head>
<meta charset="UTF-8">
<title>录播节目查询</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<link href="{{ mix('/css/app.css') }}" rel="stylesheet"/>
</head>
<body>
@include("common.header")
<div class="border-2 lg:w-1/2 w-full">
<div class="text-lg font-bold">
<span title="节目">{{$program->name}}</span>
<span title="难度">{{$program->difficulty}}</span>
<span title="要求">{{$program->desc}}</span>
</div>
<div class="ml-2">
@foreach($program->appends as $append)
@if($append->is_original)
<div>
@switch($append->platform_id)
@case(1)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站">
<a class="underline" href="https://space.bilibili.com/{{$append->from_mid}}" target="_blank">{{$append->from}}</a>
@break
@case(2)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频">
<a class="underline" href="https://www.ixigua.com/home/{{$append->from_mid}}/" target="_blank">{{$append->from}}</a>
@break
@case(3)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/douyin.ico" alt="抖音">
{{$append->from}}
@break
@default
{{$append->from}}
@break
@endswitch
老板点播
<span title="一分10块">{{$append->price}}</span>
@if($append->append)
<span>{{$append->append}}</span>
@endif
</div>
@else
<div>
@switch($append->platform_id)
@case(1)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/bilibili.ico" alt="B站">
<a class="underline" href="https://space.bilibili.com/{{$append->from_mid}}" target="_blank">{{$append->from}}</a>
@break
@case(2)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/ixigua.ico" alt="西瓜视频">
<a class="underline" href="https://www.ixigua.com/home/{{$append->from_mid}}/" target="_blank">{{$append->from}}</a>
@break
@case(3)
<img class="w-4 h-4 inline-block" src="https://cdn.jerryyan.net/luboimg/douyin.ico" alt="抖音">
{{$append->from}}
@break
@default
{{$append->from}}
@break
@endswitch
老板追加:{{$append->name}}
<span title="一分10块">{{$append->price}}</span>
@if($append->append)
<span>{{$append->append}}</span>
@endif
</div>
@endif
@endforeach
</div>
</div>
<table class="table-auto border-collapse w-full lg:border lg:border-black">
<thead>
<tr class="border border-black sticky bg-white lg:static top-0 left-0 right-0">
<td>节目开始时的画面</td>
<td>节目结束时的画面</td>
</tr>
</thead>
<tbody>
@foreach($videos as $video_pivot)
<tr>
<td>
<a class="block"
target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->start_part}}&t={{$video_pivot->start_sec}}"
title="P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}"
>
<div>{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}</div>
@if($video_pivot->start_image)
<img width="300" src="{{$video_pivot->start_image}}" alt="开始时的画面">
@else
节目开始位置
@endif
</a>
</td>
<td>
<a class="block"
target="_blank"
href="https://www.bilibili.com/video/{{$video_pivot->video_bvid}}?p={{$video_pivot->stop_part}}&t={{$video_pivot->stop_sec}}"
title="P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}"
>
<div>P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}</div>
@if($video_pivot->start_image)
<img width="300" src="{{$video_pivot->stop_image}}" alt="结束时的画面">
@else
节目结束位置
@endif
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
@include("common.footer")
</body>
</html>

View File

@ -15,6 +15,7 @@ use Illuminate\Support\Facades\Route;
// 对外列表
Route::get('/', ["\\App\\Http\\Controllers\\CommentQueryController","index"]);
Route::get('/programs', ["\\App\\Http\\Controllers\\ProgramQueryController","index"]);
Route::get('/programs/{program}/video', ["\\App\\Http\\Controllers\\ProgramQueryController","videos"]);
Route::get('/danmakus', ["\\App\\Http\\Controllers\\DanmakuQueryController","index"]);
Route::get('/danmakus/{bvid}', ["\\App\\Http\\Controllers\\DanmakuQueryController","specific_search"]);
Route::get('/upload', ["\\App\\Http\\Controllers\\FileController","index"]);