Browse Source

更新内容

moshaorui 2 months ago
parent
commit
ff0b473920

+ 7 - 1
app/Http/Controllers/Controller.php

@@ -2,6 +2,7 @@
 
 namespace App\Http\Controllers;
 
+use App\Models\SiteAlbumFolder;
 use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
 use Illuminate\Foundation\Validation\ValidatesRequests;
 use Illuminate\Routing\Controller as BaseController;
@@ -10,8 +11,13 @@ class Controller extends BaseController
 {
     use AuthorizesRequests, ValidatesRequests;
 
+    public $foldersTree =  [];
+
     public function __construct()
     {
-
+        // 一次性查询所有文件夹
+        $folders = SiteAlbumFolder::all();
+        // 构建父子关系树
+        $this->foldersTree = SiteAlbumFolder::buildTree($folders);
     }
 }

+ 148 - 2
app/Http/Controllers/HomeController.php

@@ -7,6 +7,9 @@ namespace App\Http\Controllers;
  * 用户认证控制器
  */
 
+use App\Models\SiteAlbum;
+use App\Models\SiteAlbumFolder;
+use App\Models\SiteAlbumLog;
 use Illuminate\Http\Request;
 use Illuminate\Support\Facades\Auth;
 use Illuminate\Support\Facades\Validator;
@@ -14,13 +17,156 @@ use Illuminate\Support\Facades\Validator;
 
 class HomeController extends Controller
 {
+    /*
+     * 首页
+     */
+    public function index(Request $request)
+    {
+        return view('index',['foldersTree' => $this->foldersTree]);
+    }
 
+    /*
+     * 分类列表
+     */
+    public function gallery(Request $request)
+    {
+        $folder_id = $request->input('fid',$this->getFoldersTreeFirstId());
+        $father_id = $this->getFoldersTreeFatherId($folder_id);
+        $folder = SiteAlbumFolder::find($folder_id);
+        $albums = SiteAlbum::where('folder_id', $folder_id)->get();
+        $albums = $albums->toArray();
+        foreach ($albums as $key => $album) {
+            $cover = json_decode($album['cover']);
+            foreach ($cover as $k => $v) {
+                if (strpos($v, 'http') === false && strpos($v, 'https') === false) {
+                    unset($cover[$k]);
+                }
+            }
+            $cover = empty($cover) ? ['/static/images/noimg.jpg'] : $cover;
+            $albums[$key]['cover'] = $cover;
+        }
 
-    public function index(Request $request)
+        return view('gallery',
+            [
+                'foldersTree' => $this->foldersTree,
+                'folderName'=> $folder->title,
+                'folder_id' => $folder_id,
+                'father_id' => $father_id,
+                'albums' => $albums
+            ]
+        );
+    }
+
+    public function detail(Request $request) {
+        $id = $request->input('id',0);
+        $album = SiteAlbum::find($id);
+        $bumFolder = SiteAlbumFolder::where('id', $album->folder_id)->first();
+        $showTabs = [];
+        if ($bumFolder) {
+            $row = json_decode($bumFolder->show_tabs);
+            foreach ($row as $key => $value) {
+                $column = '';
+                $title = '';
+                switch ($value) {
+                    case '0':
+                        $column = 'cover';
+                        $title = '主页';
+                        break;
+                    case '1':
+                        $column = 'en_detail';
+                        $title = '英文详情';
+                        break;
+                    case '2':
+                        $column = 'cn_detail';
+                        $title = '中文详情';
+                        break;
+                    case '3':
+                        $column = 'video';
+                        $title = '视频';
+                        break;
+                    case '4':
+                        $column = 'poster';
+                        $title = '海报';
+                        break;
+                    case '5':
+                        $column = 'cert';
+                        $title = '证书';
+                        break;
+                    case '6':
+                        $column = 'pdf';
+                        $title = 'PDF';
+                        break;
+                }
+                $showTabs[$key] = ['value'=>$value,'column'=>$column, 'title'=>$title];
+            }
+        }
+
+        return view('gallery-detail',[
+            'foldersTree' => $this->foldersTree,
+            'album' => $album->toArray(),
+            'showTabs' => $showTabs
+        ]);
+    }
+
+    public function updateLog(Request $request)
     {
-        return view('index');
+        $losgs = SiteAlbumLog::getFormattedLogs();
+        return view('update_log',[
+            'foldersTree' => $this->foldersTree,
+            'logs' => $losgs
+        ]);
     }
 
 
+    /*
+     * 更新日志
+     */
+    public function nextLog(Request $request)
+    {
+        $id = $request->input('id', 0);
+        $log = SiteAlbumLog::getNextLogEntry($id);
+        if ($log) {
+            return response()->json(['status' => 'success', 'data' => $log]);
+        } else {
+            return response()->json(['status' => 'error', 'data' => []]);
+        }
+    }
+
+    //获取分类树父ID
+    private function getFoldersTreeFatherId($folder_id)
+    {
+        foreach ($this->foldersTree as $key => $value) {
+            $father_id  = $value['id'];
+            if ($folder_id == $value['id']) {
+                return $father_id;
+            }
+            foreach ($value['children'] as $k => $v) {
+                if ($folder_id == $v['id']) {
+                    return $father_id;
+                }
+                foreach ($v['children'] as $kk => $vv) {
+                    if ($folder_id == $vv['id']) {
+                        return $father_id;
+                    }
+                }
+            }
+        }
+        return 0;
+    }
+
+    //返回分类树第一个无子节点的ID
+    private function getFoldersTreeFirstId()
+    {
+        foreach ($this->foldersTree as $key => $value) {
+            if (isset($value['children'])) {
+                foreach ($value['children'] as $k => $v) {
+                    return $v['id'];
+                }
+            } else {
+                return $value['id'];
+            }
+        }
+        return 0;
+    }
 
 }

+ 14 - 0
app/Models/SiteAlbum.php

@@ -0,0 +1,14 @@
+<?php
+
+namespace App\Models;
+
+
+
+use Illuminate\Database\Eloquent\Model;
+
+class SiteAlbum extends Model
+{
+
+    protected $table = 'site_album';
+
+}

+ 45 - 0
app/Models/SiteAlbumFolder.php

@@ -0,0 +1,45 @@
+<?php
+
+namespace App\Models;
+
+
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Database\Eloquent\Collection;
+
+class SiteAlbumFolder extends Model
+{
+    protected $table = 'site_album_folder';
+
+    // 定义与自身的关系,用于获取子文件夹
+    public function children()
+    {
+        return $this->hasMany(SiteAlbumFolder::class, 'parent_id');
+    }
+
+    // 递归构建父子关系树
+    public static function buildTree(Collection $folders, $parentId = null)
+    {
+        return $folders
+            ->where('parent_id', $parentId) // 过滤出当前层级的文件夹
+            ->map(function ($folder) use ($folders) {
+                // 递归获取子文件夹
+                $folder->children = self::buildTree($folders, $folder->id);
+                return [
+                    'id' => $folder->id,
+                    'title' => $folder->title,
+                    'parent_id' => $folder->parent_id,
+                    'order' => $folder->order,
+                    'folder_type' => $folder->folder_type,
+                    'show_tabs' => $folder->show_tabs,
+                    'enabled' => $folder->enabled,
+                    'created_at' => $folder->created_at,
+                    'updated_at' => $folder->updated_at,
+                    'cover' => $folder->cover,
+                    'children' => $folder->children->values()->toArray(), // 子文件夹数据
+                ];
+            })
+            ->values(); // 重置键名
+    }
+
+}

+ 81 - 0
app/Models/SiteAlbumLog.php

@@ -0,0 +1,81 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+use Illuminate\Support\Carbon;
+
+class SiteAlbumLog extends Model
+{
+    // 自定义日期序列化格式
+    protected function serializeDate(\DateTimeInterface $date)
+    {
+        return $date->format('Y-m-d H:i:s');
+    }
+
+    protected $table = 'site_album_log';
+
+    /**
+     * 获取格式化后的日志数据
+     *
+     * @return array
+     */
+    public static function getFormattedLogs()
+    {
+        // 查询数据并按 created_at 降序排序
+        $logs = self::orderBy('created_at', 'desc')->get();
+
+        // 初始化结果数组
+        $formattedLogs = [];
+
+        // 遍历数据并格式化
+        foreach ($logs as $log) {
+            // 获取 created_at 的年份和月份(例如:2024-12)
+            $monthKey = Carbon::parse($log->created_at)->format('Y年m月');
+
+            // 将数据按月份分组
+            if (!isset($formattedLogs[$monthKey])) {
+                $formattedLogs[$monthKey] = [];
+            }
+
+            // 将日志数据添加到对应月份
+            $formattedLogs[$monthKey][] = [
+                'id' => $log->id,
+                'user_name' => $log->user_name,
+                'action' => $log->action,
+                'model' => $log->model,
+                'content' => $log->content,
+                'created_at' => $log->created_at,
+                'updated_at' => $log->updated_at,
+                'content_id' => $log->content_id,
+            ];
+        }
+
+        return $formattedLogs;
+    }
+
+
+    // 获取下一条日志
+    public static function  getNextLogEntry($id) {
+        // 获取最新的 10 条数据,按 id 降序排列
+        $logs = SiteAlbumLog::orderBy('id', 'desc')->take(10)->get();
+
+        if ($logs->count() == 0) {
+            return null;
+        }
+
+        // 查找 $id 在 $logs 中的位置
+        $index = $logs->search(function ($log) use ($id) {
+            return $log->id == $id;
+        });
+
+        // 如果找到 $id,并且不是最后一条数据,则返回下一条数据
+        if ($index !== false && $index < $logs->count() - 1) {
+            return $logs[$index + 1];
+        }
+
+        // 如果没有找到 $id 或者 $id 是最后一条数据,则返回第一条数据
+        return $logs->first();
+    }
+
+}

+ 17 - 5
public/static/css/main.css

@@ -482,7 +482,7 @@ a {
   transform: translateX(-100%);
   z-index: 0;
   position: relative;
-  
+
 }
 
 @media screen and (min-height: 610px) {
@@ -514,7 +514,7 @@ a {
   list-style-type: none;
 }
 
-.menu-nav ul li:nth-last-child(n+2) a {
+.menu-nav ul li:nth-last-child(n+1) a {
   margin-bottom: 25px;
 }
 
@@ -874,7 +874,7 @@ a {
 	transition-duration: 0.8s;
 	opacity: 1;
 }
- 
+
 [data-animate] {
 	opacity: 0;
 	transition: all 0.8s ease-out;
@@ -1509,7 +1509,7 @@ a {
   .gallery-wrap .content-inner {
     padding: 0 40px;
   }
-  .grid-album .grid-sizer, 
+  .grid-album .grid-sizer,
   .grid-album .grid-item {
     width: calc(50% - 10px);
   }
@@ -1563,7 +1563,7 @@ a {
   .gallery-wrap .content-inner {
     padding: 0 20px;
   }
-  .grid-album .grid-sizer, 
+  .grid-album .grid-sizer,
   .grid-album .grid-item {
     width: 100%;
   }
@@ -1636,6 +1636,11 @@ a {
 .menu-nav .menu-nav-son {
   display: none;
 }
+
+.menu-nav .son-active {
+    display: block;
+}
+
 .menu-nav .menu-nav-son li {
   padding-left: 20px;
 }
@@ -1807,8 +1812,15 @@ a {
   font-size: 12px;
   text-align: left;
 }
+
+
 .gallery-album-prev {
   float: right;
+  color: #333;
+}
+
+.gallery-album-line .gallery-album-prev {
+    color: #ffffff;
 }
 
 /*表格样式*/

BIN
public/static/images/noimg.jpg


+ 84 - 27
public/static/js/script.js

@@ -2,7 +2,7 @@ $(document).ready(function() {
 
 	new WOW({
 		mobile: false,
-		animateClass: 'animate__animated', 
+		animateClass: 'animate__animated',
 	}).init();
 
 	setTimeout(function() {
@@ -10,7 +10,7 @@ $(document).ready(function() {
 	}, 4500);
 
 	//Ajax Form Send START
-	$('#contact-form').on('submit', function() { 
+	$('#contact-form').on('submit', function() {
 		var th = $(this);
 		$.ajax({
 			type: 'POST',
@@ -60,7 +60,7 @@ $(document).ready(function() {
 		},
 	});
 	// Banner END
-	
+
 
 	// Menu START
 	$('body').on('click', '.hamburger-button', function(e) {
@@ -72,10 +72,10 @@ $(document).ready(function() {
 		hamburgerMenuWrap.addClass('menu-active');
 		hamburgerMenuItem.addClass('menu-item-active');
 		menuOverlay = $('.menu-overlay');
-		menuOverlay.addClass('menu-overlay__active');
+	//	menuOverlay.addClass('menu-overlay__active');
 	});
 
-	$(document).on('mouseup', function(e) {
+	$('.menu-close__wrap').on('mouseup', function(e) {
 		e.preventDefault();
 		menuClose = $('.menu-close');
 		hamburgerMenuWrap = $('.menu-wrap');
@@ -172,6 +172,13 @@ $(document).ready(function() {
 		$('.grid-album.is-active:not(' + href + ')').removeClass('animate__animated animate__slideInUp');
 
 		albumMasonry();
+
+        let column = $(this).attr('column');
+        if (column == 'pdf' || column == 'video') {
+            $(".download-all").hide();
+        } else {
+            $(".download-all").show();
+        }
 	});
 	// Album page END
 
@@ -194,18 +201,8 @@ $(document).ready(function() {
 	});
 	// Settings END
 
-	// 当鼠标经过 li 元素时
-	// $('.menu-nav li').hover(
-	// 	function() {
-	// 		// 显示子菜单
-	// 		$(this).find('.menu-nav-son').stop(true, true).slideDown(200);
-	// 	},
-	// 	function() {
-	// 		// 隐藏子菜单
-	// 		$(this).find('.menu-nav-son').stop(true, true).slideUp(0);
-	// 	}
-	// );
-	$('.menu-nav li').hover(
+
+	$('.menu-nav-item').hover(
 		function () {
 			// 显示当前 li 的子菜单
 			$(this).find('.menu-nav-son').stop(true, true).slideDown(200);
@@ -213,31 +210,32 @@ $(document).ready(function() {
 	);
 
 	// 当鼠标离开 .menu-nav ul 时
-	$('.menu-nav').mouseleave(function () {
+	$('.menu-nav-item').mouseleave(function () {
 		// 隐藏所有子菜单
-		$('.menu-nav-son').stop(true, true).slideUp(200);
+		$('.menu-nav-son').stop(true, true).slideUp(0);
 	});
 
 
 	// 创建全屏遮罩层
-	$('.album-thumb').on('click', function (event) {
+	$('.album-thumb-detail').on('click', function (event) {
 		// 如果点击的是 download-icon,阻止后续代码执行
 		if ($(event.target).closest('.download-icon').length) {
 			return;
 		}
 
-		// 获取当前点击的 .album-thumb 的父级 .grid-album 元素
+		// 获取当前点击的 .album-thumb-detail 的父级 .grid-album 元素
 		var $parentAlbum = $(this).closest('.grid-album');
 
-		// 获取当前父级下所有 .album-thumb img 的 src
+		// 获取当前父级下所有 .album-thumb-detail img 的 src
 		var imageSrcArray = [];
-		$parentAlbum.find('.album-thumb img').each(function () {
-			console.log($(this).attr('class'));
-			imageSrcArray.push($(this).attr('src'));
+		$parentAlbum.find('.album-thumb-detail img').each(function () {
+            src = $(this).attr('src')
+            newSrc = src.split('?')[0];
+			imageSrcArray.push(newSrc);
 		});
 
 		// 获取当前点击图片在数组中的索引
-		var $albumThumbs = $parentAlbum.find('.album-thumb');
+		var $albumThumbs = $parentAlbum.find('.album-thumb-detail');
 		var currentImageIndex = $albumThumbs.index(this);
 		// console.log(currentImageIndex);
 
@@ -318,4 +316,63 @@ $(document).ready(function() {
 		$(this).siblings('.log-line').toggleClass('active');
 	});
 
-});
+    //日志
+    // 检查 update-log 是否存在
+    if ($('.update-log').length > 0) {
+        // 定义一个函数来执行 AJAX 请求
+        function fetchUpdate() {
+            $.ajax({
+                url: '/next-log', // 替换为你的 API 端点
+                method: 'GET', // 根据你的需求选择 GET 或 POST
+                dataType: 'json', // 根据你的 API 返回的数据类型选择
+                success: function(response) {
+                    // 假设 response 包含 timestamp 和 message
+                    var created_at = response.data.created_at;
+                    var action = response.data.action;
+                    if (action == 'aa') {
+                        action = '新增了';
+                    } else {
+                        action = '更新了';
+                    }
+                    var model = response.data.model + ' 的';
+                    var content = response.data.content;
+
+                    // 更新 timestamp 和 message
+                    $('.update-log .update-time').text(created_at);
+                    $('.update-log .action').text(action);
+                    $('.update-log .model').text(model);
+                    $('.update-log .log-content').text(content);
+                },
+                error: function(xhr, status, error) {
+                    console.error('AJAX 请求失败:', status, error);
+                }
+            });
+        }
+        // 立即执行一次
+        fetchUpdate();
+        // 每 10 秒执行一次
+        setInterval(fetchUpdate, 20000); // 10000 毫秒 = 10 秒
+    }
+
+
+    // 监听 .download-all 的点击事件
+    $('.download-all').on('click', function() {
+        // 查找 .album-tab 中带有 is-active 类的 <a> 标签
+        let activeTab = $('.album-tab a.is-active').attr('href');
+
+        // 将 #album- 替换为空,得到 tab 变量
+        let tab = activeTab.replace('#album-', '');
+
+        // 获取当前 URL 中的 id 参数
+        let currentUrl = window.location.href;
+        let urlParams = new URLSearchParams(currentUrl.split('?')[1]);
+        let id = urlParams.get('id');
+
+        // 拼接新的 URL
+        let newUrl = `/download-all?id=${id}&tab=${tab}`;
+
+        // 跳转到新 URL
+        window.location.href = newUrl;
+    });
+
+});

+ 27 - 6
resources/views/__sidebar.blade.php

@@ -1,14 +1,35 @@
 <div class="sidebar">
-    <div class="menu-wrap">
+    <div class="menu-wrap @if ($active) menu-active @endif">
         <a href="/" class="sidebar-logo">
             <img src="/static/images/logo.svg" alt="Sylvia">
         </a>
-        <nav class="menu-nav">
+        <nav class="menu-nav @if ($active) menu-item-active @endif">
             <ul>
-                <li><a href="/">主页</a></li>
-                <li><a href="gallery.html">功能类产品</a></li>
-                <li><a href="gallery.html">屏幕保护膜</a></li>
-                <li><a href="gallery.html">智能切膜机</a></li>
+                <li><a href="/index">主页</a></li>
+                @foreach ($foldersTree as $tree)
+                <li class="menu-nav-item">
+                    <a @if (empty($tree['children']) == false) href="javascript:void(0)" @else href="/gallery?fid={{ $tree['id'] }}" @endif>{{ $tree['title'] }}</a>
+                    @if (isset($tree['children']))
+                    <ul class="menu-nav-son">
+                        @foreach ($tree['children'] as $child)
+                        <li>
+                            <a @if (empty($child['children']) == false) href="javascript:void(0)" @else href="/gallery?fid={{ $child['id'] }}" @endif>{{ $child['title'] }}</a>
+                            @if (isset($child['children']))
+                            <ul>
+                                @foreach ($child['children'] as $grandchild)
+                                <li>
+                                    <a href="/gallery?fid={{ $grandchild['id'] }}">{{ $grandchild['title'] }}</a>
+                                </li>
+                                @endforeach
+                            </ul>
+                            @endif
+                        </li>
+                        @endforeach
+                    </ul>
+                    @endif
+                </li>
+                @endforeach
+
             </ul>
 
             <div class="menu-contacts">

+ 170 - 0
resources/views/gallery-detail.blade.php

@@ -0,0 +1,170 @@
+
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+
+    <title>相册</title>
+
+    <link rel="shortcut icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+    <link rel="icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+
+    <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
+    <link rel="stylesheet" href="/static/css/font-awesome.min.css">
+    <link rel="stylesheet" href="/static/css/magnific-popup.min.css">
+    <link rel="stylesheet" href="/static/css/animate.min.css">
+    <link rel="stylesheet" href="/static/css/main.css">
+</head>
+<body>
+
+<div class="menu-overlay"></div>
+
+
+<main class="main">
+
+    <section class="gallery">
+
+        @include('__sidebar', ['foldersTree'=> $foldersTree,'active'=>true])
+
+        <div class="update-content">
+            <div class="update-log" >
+                <a href="/update-log">
+                    <div class="timestamp"><i class="fa fa-volume-up"></i> <span class="update-time">&nbsp;</span></div>
+                    <div class="message">  <span class="action">&nbsp;</span> <span class="model">&nbsp;</span>  <span class="highlight log-content">&nbsp;</span></div>
+                </a>
+            </div>
+        </div>
+
+
+        <div class="content-page gallery-content gallery-wrap">
+            <div class="content-inner">
+                <div class="title-wrapper text-center">
+                    <h2 class="title">{{$album['title']}}</h2>
+                    <div class="subtitle">
+                        <p></p>
+                    </div>
+                </div>
+
+                <div class="album-tab">
+                    @foreach($showTabs as $tab)
+                        <a href="#album-{{$tab['column']}}" @if($loop->first)class="is-active"@endif column={{$tab['column']}}>{{$tab['title']}}</a>
+                    @endforeach
+                </div>
+
+                <!-- Album Animals START -->
+                <div class="gallery-album-line">
+                    <a href="javascript:void(0);" class="download-all">下载全部 <i class="fa fa-download"></i></a>
+                    <a href="javascript:history.back();" class="gallery-album-prev"><i class="fa fa-angle-double-left"></i> 返回 </a>
+                </div>
+
+                @foreach($showTabs as $tab)
+                <div class="grid-album   @if($loop->first)gallery-album is-active @endif" id="album-{{$tab['column']}}">
+                    <div class="grid-sizer"></div>
+                    @php
+                        $content = json_decode($album[$tab['column']], true);
+                    @endphp
+                    @if (empty($content))
+                        数据为空
+                    @endif
+                    @if ($tab['column'] == 'video' || $tab['column'] == 'pdf')
+                        @if ($tab['column'] == 'video' && empty($content) == false)
+                            <table class="album_table">
+                                <thead>
+                                <tr>
+                                    <th>图片</th>
+                                    <th width="15%">操作</th>
+                                </tr>
+                                </thead>
+                                <tbody>
+                                @foreach($content as $item)
+                                <tr>
+                                    <td>
+                                        <a href="{{$item['cover']}}" target="_blank">
+                                            <img src="{{$item['cover']}}?x-oss-process=image/resize,w_100"   width="100">
+                                        </a>
+                                    </td>
+                                    <td>
+                                        <button data-src="{{$item['video_src']}}" class="video-btn">播放</button>
+                                        <a href="{{$item['video_src']}}" download class="download-btn" target="_blank"><button>下载</button></a>
+                                    </td>
+                                </tr>
+                                @endforeach
+                                </tbody>
+                            </table>
+                        @endif
+
+                        @if ($tab['column'] == 'pdf' && empty($content) == false)
+                                <table class="album_table">
+                                    <thead>
+                                    <tr>
+                                        <th>PDF标题</th>
+                                        <th width="15%">操作</th>
+                                    </tr>
+                                    </thead>
+                                    <tbody>
+                                    @foreach($content as $item)
+                                        <tr>
+                                            <td>{{$item['pdf_title']}}</td>
+                                            <td>
+                                                <a href="{{$item['pdf_src']}}" download class="download-btn" target="_blank"><button>下载</button></a>
+                                            </td>
+                                        </tr>
+                                    @endforeach
+                                    </tbody>
+                                </table>
+                        @endif
+                    @else
+                        @foreach($content as $item)
+                        <div class="grid-item album-item">
+                            <div class="album-thumb album-thumb-detail">
+                                <img  data-src="{{$item}}?x-oss-process=image/resize,m_fill,w_380,h_380" src="{{$item}}?x-oss-process=image/resize,m_fill,w_380,h_380" alt="1">
+                                <div class="album-mask">
+                                    <!-- 下载图标 -->
+                                    <a href="{{$item}}" download class="download-icon" target="_blank">
+                                        <i class="fa fa-cloud-download"></i>
+                                    </a>
+                                </div>
+                            </div>
+                        </div>
+                        @endforeach
+                    @endif
+                </div>
+                @endforeach
+                <!-- Album Animals END -->
+            </div><!-- end container-inner -->
+        </div>
+
+        <!-- 视频遮罩层 -->
+        <div id="overlay" class="overlay">
+            <div class="video-container">
+                <video id="videoPlayer" controls>
+                    Your browser does not support the video tag.
+                </video>
+            </div>
+        </div>
+
+    </section> <!-- end gallery -->
+</main>
+
+<footer class="site-footer">
+    <div class="footer-copyright">
+        © 2025 <strong>mietub</strong>. All rights reserved.
+    </div>
+</footer>
+
+
+
+<script src="/static/js/jquery-3.7.0.min.js"></script>
+<script src="/static/js/swiper-bundle.min.js"></script>
+<script src="/static/js/wow.min.js"></script>
+<script src="/static/js/masonry.pkgd.min.js"></script>
+<script src="/static/js/imagesloaded.pkgd.min.js"></script>
+<script src="/static/js/magnific-popup.min.js"></script>
+<script src="/static/js/blazy.min.js"></script>
+<script src="/static/js/parazoom.min.js"></script>
+<script src="/static/js/script.js"></script>
+</body>
+</html>

+ 95 - 0
resources/views/gallery.blade.php

@@ -0,0 +1,95 @@
+
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+
+    <title>相册</title>
+
+    <link rel="shortcut icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+    <link rel="icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+
+    <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
+    <link rel="stylesheet" href="/static/css/font-awesome.min.css">
+    <link rel="stylesheet" href="/static/css/magnific-popup.min.css">
+    <link rel="stylesheet" href="/static/css/animate.min.css">
+    <link rel="stylesheet" href="/static/css/main.css">
+</head>
+<body>
+
+<div class="menu-overlay"></div>
+
+
+<main class="main">
+
+    <section class="gallery">
+
+        @include('__sidebar', ['foldersTree'=> $foldersTree,'active'=>true])
+
+        <div class="update-content">
+            <div class="update-log" >
+                <a href="/update-log">
+                    <div class="timestamp"><i class="fa fa-volume-up"></i> <span class="update-time">&nbsp;</span></div>
+                    <div class="message">  <span class="action">&nbsp;</span> <span class="model">&nbsp;</span>  <span class="highlight log-content">&nbsp;</span></div>
+                </a>
+            </div>
+        </div>
+
+        <div class="content-page gallery-content gallery-wrap">
+            <div class="content-inner">
+
+                <div class="title-wrapper text-center">
+                    <h2 class="title">{{$folderName}}</h2>
+                    <div class="subtitle">
+                        <p></p>
+                    </div>
+                </div>
+
+                <!-- Album Animals START -->
+                <div class="grid-album is-active gallery-album" >
+                    <div class="grid-sizer"></div>
+
+                    @foreach($albums as $album)
+                    <div class="grid-item album-item">
+                        <a href="/detail?id={{$album['id']}}">
+                            <div class="album-thumb">
+                                <img src="{{$album['cover'][0]}}?x-oss-process=image/resize,m_fill,w_380,h_380" data-src="{{$album['cover'][0]}}?x-oss-process=image/resize,m_fill,w_380,h_380" class="" alt="Graceful Zebra">
+                            </div>
+                            <div class="album-name">{{$album['title']}}</div>
+                            <div class="album-desc">
+                                型号:{{$album['model']}}
+                            </div>
+                        </a>
+                    </div>
+                    @endforeach
+
+                </div>
+                <!-- Album Animals END -->
+            </div><!-- end container-inner -->
+        </div>
+    </section> <!-- end gallery -->
+
+</main>
+
+<footer class="site-footer">
+    <div class="footer-copyright">
+        © 2025 <strong>mietub</strong>. All rights reserved.
+    </div>
+</footer>
+
+
+
+<script src="/static/js/jquery-3.7.0.min.js"></script>
+<script src="/static/js/swiper-bundle.min.js"></script>
+<script src="/static/js/wow.min.js"></script>
+<script src="/static/js/masonry.pkgd.min.js"></script>
+<script src="/static/js/imagesloaded.pkgd.min.js"></script>
+<script src="/static/js/magnific-popup.min.js"></script>
+<script src="/static/js/blazy.min.js"></script>
+<script src="/static/js/parazoom.min.js"></script>
+<script src="/static/js/script.js"></script>
+</body>
+</html>

+ 4 - 9
resources/views/index.blade.php

@@ -6,12 +6,9 @@
     <meta charset="UTF-8">
     <meta http-equiv="X-UA-Compatible" content="IE=edge">
     <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
-
     <title>相册</title>
-
     <link rel="shortcut icon" href="/static/images/favicon.ico" type="image/x-icon">
     <link rel="icon" href="/static/images/favicon.ico" type="image/x-icon">
-
     <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
     <link rel="stylesheet" href="/static/css/font-awesome.min.css">
     <link rel="stylesheet" href="/static/css/magnific-popup.min.css">
@@ -26,7 +23,7 @@
 
     <div class="home def-row">
 
-        @include('__sidebar', [])
+        @include('__sidebar', ['foldersTree'=> $foldersTree,'active'=>false])
 
         <div class="prelodaer-wrap">
             <div class="preloader-item">
@@ -38,7 +35,6 @@
 
             <div class="swiper swiper-banner">
                 <div class="swiper-wrapper">
-
                     <!-- Slide START -->
                     <div class="swiper-slide animeslide-slide">
                         <div class="banner-item" style="background-image: url(/static/images/frame-banner-index1.jpg);">
@@ -49,7 +45,7 @@
                                     <p></p>
                                 </div>
                                 <div class="banner-btn" data-animate="bottom">
-                                    <a class="link-portfolio" href="gallery.html">
+                                    <a class="link-portfolio" href="/gallery">
                                         Show portfolio
                                         <img src="/static/images/arrow-right.svg" alt="">
                                         <span class="right-border"></span>
@@ -70,7 +66,7 @@
                                     <p>Mietubl screen protector machine makes it an easy work to match screen protectors and mobile phones without preparing a huge inventory. The mini phone skin printer helps design and personalize almost patterns, making customized services the standout feature of your business.</p>
                                 </div>
                                 <div class="banner-btn" data-animate="bottom">
-                                    <a class="link-portfolio" href="gallery.html">
+                                    <a class="link-portfolio" href="/gallery">
                                         Show portfolio
                                         <img src="/static/images/arrow-right.svg" alt="">
                                         <span class="right-border"></span>
@@ -91,7 +87,7 @@
                                     <p></p>
                                 </div>
                                 <div class="banner-btn" data-animate="bottom">
-                                    <a class="link-portfolio" href="gallery.html">
+                                    <a class="link-portfolio" href="/gallery">
                                         Show portfolio
                                         <img src="/static/images/arrow-right.svg" alt="">
                                         <span class="right-border"></span>
@@ -114,7 +110,6 @@
     </div><!-- end home -->
 </main>
 
-
 <script src="/static/js/jquery-3.7.0.min.js"></script>
 <script src="/static/js/swiper-bundle.min.js"></script>
 <script src="/static/js/wow.min.js"></script>

+ 72 - 0
resources/views/update_log.blade.php

@@ -0,0 +1,72 @@
+
+
+<!DOCTYPE html>
+<html lang="en">
+<head>
+    <meta charset="UTF-8">
+    <meta http-equiv="X-UA-Compatible" content="IE=edge">
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
+
+    <title>相册</title>
+
+    <link rel="shortcut icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+    <link rel="icon" href="/static//static/images/favicon.ico" type="image/x-icon">
+
+    <link rel="stylesheet" href="/static/css/swiper-bundle.min.css">
+    <link rel="stylesheet" href="/static/css/font-awesome.min.css">
+    <link rel="stylesheet" href="/static/css/magnific-popup.min.css">
+    <link rel="stylesheet" href="/static/css/animate.min.css">
+    <link rel="stylesheet" href="/static/css/main.css">
+</head>
+<body>
+
+<div class="menu-overlay"></div>
+
+
+<main class="main">
+
+    <section class="gallery">
+
+        @include('__sidebar', ['foldersTree'=> $foldersTree,'active'=>true])
+
+        <div class="update-content log-page">
+            <div class="update-log">
+                <a href="javascript:history.back();" class="gallery-album-prev"><i class="fa fa-angle-double-left"></i> 返回 </a>
+                <ul>
+                    @foreach($logs as $key => $log)
+                    <li>
+                        <div class="log-date">
+                            <a href="javascript:void(0)">{{$key}}</a>
+                        </div>
+                        @foreach($log as $item)
+                        <div class="log-line active">
+                            <div class="timestamp"><i class="fa fa-volume-up"></i> {{$item['created_at']}}</div>
+                            <div class="message">@if($item['action'] == 'add')新增@else更新@endif了 {{$item['model']}} 的 <span class="highlight">{{$item['content']}}</span></div>
+                        </div>
+                        @endforeach
+                    </li>
+                    @endforeach
+                </ul>
+            </div>
+        </div>
+
+
+    </section> <!-- end gallery -->
+
+</main>
+
+
+
+
+
+<script src="/static/js/jquery-3.7.0.min.js"></script>
+<script src="/static/js/swiper-bundle.min.js"></script>
+<script src="/static/js/wow.min.js"></script>
+<script src="/static/js/masonry.pkgd.min.js"></script>
+<script src="/static/js/imagesloaded.pkgd.min.js"></script>
+<script src="/static/js/magnific-popup.min.js"></script>
+<script src="/static/js/blazy.min.js"></script>
+<script src="/static/js/parazoom.min.js"></script>
+<script src="/static/js/script.js"></script>
+</body>
+</html>

+ 5 - 2
routes/web.php

@@ -15,9 +15,12 @@ use Illuminate\Support\Facades\Route;
 */
 
 Route::get('/', [AuthController::class, 'getLogin']);
-
+Route::post('/post-login', [AuthController::class, 'postLogin']);
 Route::get('/index', [HomeController::class, 'index']);
+Route::get('/gallery', [HomeController::class, 'gallery']);
+Route::get('/next-log', [HomeController::class, 'nextLog']);
+Route::get('/update-log', [HomeController::class, 'updateLog']);
+Route::get('/detail', [HomeController::class, 'detail']);
 
-Route::post('/post-login', [AuthController::class, 'postLogin']);