diff --git a/app/View/Components/Append.php b/app/View/Components/Append.php new file mode 100644 index 0000000..b8ecb88 --- /dev/null +++ b/app/View/Components/Append.php @@ -0,0 +1,34 @@ +append = $append; + } + + /** + * Get the view / contents that represent the component. + * + * @return \Illuminate\Contracts\View\View|\Closure|string + */ + public function render() + { + return view('components.append'); + } +} diff --git a/app/View/Components/Links/UserLink.php b/app/View/Components/Links/UserLink.php new file mode 100644 index 0000000..77ff43c --- /dev/null +++ b/app/View/Components/Links/UserLink.php @@ -0,0 +1,43 @@ +plt_id = $pltId; + $this->mid = $mid; + $this->name = $name; + } + + /** + * Get the view / contents that represent the component. + * + * @return \Illuminate\Contracts\View\View|\Closure|string + */ + public function render() + { + return view('components.links.user_link'); + } +} diff --git a/app/View/Components/Links/VideoLink.php b/app/View/Components/Links/VideoLink.php new file mode 100644 index 0000000..4618a24 --- /dev/null +++ b/app/View/Components/Links/VideoLink.php @@ -0,0 +1,57 @@ +bvid = $bvid; + $this->part = $part; + if ($sec == null) { + try { + $sec = Carbon::createFromFormat("H:i:s", $time)->secondsSinceMidnight(); + } catch (InvalidFormatException $ex) { + $time = null; + } + } + $this->time = $time; + $this->sec = $sec; + } + + /** + * Get the view / contents that represent the component. + * + * @return \Illuminate\Contracts\View\View|\Closure|string + */ + public function render() + { + return view('components.links.video_link'); + } +} diff --git a/resources/views/components/append.blade.php b/resources/views/components/append.blade.php new file mode 100644 index 0000000..c46ac1a --- /dev/null +++ b/resources/views/components/append.blade.php @@ -0,0 +1,19 @@ +@if($append->is_original) +
+ + 老板点播 + {{$append->price}}分 + @if($append->append) + ({{$append->append}}) + @endif +
+@else +
+ + 老板追加@if($append->broadcast!=0)常驻留言@endif:{{$append->name}} + {{$append->price}}分 + @if($append->append) + ({{$append->append}}) + @endif +
+@endif diff --git a/resources/views/components/links/user_link.blade.php b/resources/views/components/links/user_link.blade.php new file mode 100644 index 0000000..302d4b9 --- /dev/null +++ b/resources/views/components/links/user_link.blade.php @@ -0,0 +1,27 @@ + + @switch($plt_id) + @case(1) + B站 + @isset($mid) + {{$name}} + @else + {{$name}} + @endisset + @break + @case(2) + 西瓜视频 + @isset($mid) + {{$name}} + @else + {{$name}} + @endisset + @break + @case(3) + 抖音 + {{$name}} + @break + @default + {{$name}} + @break + @endswitch + diff --git a/resources/views/components/links/video_link.blade.php b/resources/views/components/links/video_link.blade.php new file mode 100644 index 0000000..c2fe9b8 --- /dev/null +++ b/resources/views/components/links/video_link.blade.php @@ -0,0 +1,7 @@ + + {{ $slot }} + diff --git a/resources/views/danmaku/search_index.blade.php b/resources/views/danmaku/search_index.blade.php index 24f1c52..5926cc2 100644 --- a/resources/views/danmaku/search_index.blade.php +++ b/resources/views/danmaku/search_index.blade.php @@ -28,23 +28,7 @@ @foreach($danmakus as $danmaku) - @switch($danmaku->platform_id) - @case(1) - B站 - {{$danmaku->from}} - @break - @case(2) - 西瓜视频 - {{$danmaku->from}} - @break - @case(3) - 抖音 - {{$danmaku->from}} - @break - @default - {{$danmaku->from}} - @break - @endswitch + {{$danmaku->content}} {{$danmaku->created_at}} diff --git a/resources/views/program/construct/index.blade.php b/resources/views/program/construct/index.blade.php index ca9e089..f12a548 100644 --- a/resources/views/program/construct/index.blade.php +++ b/resources/views/program/construct/index.blade.php @@ -22,63 +22,36 @@ $program->id])}}">编辑 {{$program->name}} + {{$program->difficulty}} {{$program->desc}} @foreach($program->appends as $append) - @if($append->is_original) -
- @if($append->from_mid) - {{$append->from}} - @else - {{$append->from}} - @endif - 老板点播 - {{$append->price}}分 - @if($append->append) - ({{$append->append}}) - @endif -
- @else -
- @if($append->from_mid) - {{$append->from}} - @else - {{$append->from}} - @endif - 老板追加:{{$append->name}} - {{$append->price}}分 - @if($append->append) - ({{$append->append}}) - @endif -
- @endif + @endforeach @foreach($program->video_pivots as $video_pivot) - + +
{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}
@if($video_pivot->start_image) 开始时的画面 @else 节目开始位置 @endif -
+ @endforeach @foreach($program->video_pivots as $video_pivot) - @if($video_pivot->stop_image) - 结束时的画面 - @else -
暂无
- @endif + +
P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}
+ @if($video_pivot->start_image) + 结束时的画面 + @else + 节目结束位置 + @endif +
@endforeach diff --git a/resources/views/program/index.blade.php b/resources/views/program/index.blade.php index 8e3517c..5a40790 100644 --- a/resources/views/program/index.blade.php +++ b/resources/views/program/index.blade.php @@ -34,92 +34,31 @@ @foreach($program->appends as $append) - @if($append->is_original) -
- @switch($append->platform_id) - @case(1) - B站 - {{$append->from}} - @break - @case(2) - 西瓜视频 - {{$append->from}} - @break - @case(3) - 抖音 - {{$append->from}} - @break - @default - {{$append->from}} - @break - @endswitch - 老板点播 - {{$append->price}}分 - @if($append->append) - ({{$append->append}}) - @endif -
- @else -
- @switch($append->platform_id) - @case(1) - B站 - {{$append->from}} - @break - @case(2) - 西瓜视频 - {{$append->from}} - @break - @case(3) - 抖音 - {{$append->from}} - @break - @default - {{$append->from}} - @break - @endswitch - 老板追加:{{$append->name}} - {{$append->price}}分 - @if($append->append) - ({{$append->append}}) - @endif -
- @endif + @endforeach - @if(sizeof($program->appends) === 0) - 去建设 - @endif @foreach($program->video_pivots as $video_pivot) - +
{{$video_pivot->created_at}} P{{$video_pivot->start_part}}#{{$video_pivot->start_time}}
@if($video_pivot->start_image) 开始时的画面 @else 节目开始位置 @endif -
+ @endforeach @foreach($program->video_pivots as $video_pivot) - +
P{{$video_pivot->stop_part}}#{{$video_pivot->stop_time}}
@if($video_pivot->start_image) 结束时的画面 @else 节目结束位置 @endif -
+ @endforeach