Browse Source

ui improve for default page

master
filesite 5 months ago
parent
commit
d4b91eea03
  1. 25
      themes/beauty/views/site/index.php
  2. 2
      www/js/beauty.js

25
themes/beauty/views/site/index.php

@ -58,6 +58,7 @@ if (!empty($breadcrumbs)) {
echo <<<eof echo <<<eof
<div class="breadcrumbs text_dark"> <div class="breadcrumbs text_dark">
<small>当前位置:</small> <small>当前位置:</small>
<a href="/">首页</a> /
eof; eof;
foreach ($breadcrumbs as $bread) { foreach ($breadcrumbs as $bread) {
@ -87,25 +88,11 @@ eof;
//如果没有选中任何目录,则把所有目录显示出来 //如果没有选中任何目录,则把所有目录显示出来
if (empty($selectedId) && !empty($viewData['menus'])) { if (empty($selectedId) && !empty($viewData['menus'])) {
foreach ($viewData['menus'] as $index => $dir) { $category = array(
echo <<<eof 'directories' => $viewData['menus'],
<div class="im_item bor_radius col-xs-6 col-sm-4 col-md-3 col-lg-2"> 'files' => $viewData['scanResults'],
<a href="{$dir['path']}" class="bor_radius dir_item" data-id="{$dir['id']}" data-cid="{$dir['cid']}"> );
eof; }else if (!empty($selectedId) && empty($category['directories']) && empty($category['files'])) {
$title = !empty($dir['title']) ? $dir['title'] : $dir['directory'];
echo <<<eof
<div class="im_img_title">
<span>
<img src="/img/beauty/folder.svg" alt="folder" width="20">
{$title}
</span>
</div>
</a>
</div>
eof;
}
}else if (empty($category['directories']) && empty($category['files'])) {
echo <<<eof echo <<<eof
<div class="alert alert-warning">此目录下没有图片和视频哦,复制照片目录或文件到目录里刷新网页即可。</div> <div class="alert alert-warning">此目录下没有图片和视频哦,复制照片目录或文件到目录里刷新网页即可。</div>
eof; eof;

2
www/js/beauty.js

@ -125,7 +125,7 @@ if ($('#image_site').get(0)) {
if (data.code == 1 && data.url) { if (data.code == 1 && data.url) {
$(el).find('.im_img_title').before('<img src="' + data.url + '" class="bor_radius im_img">'); $(el).find('.im_img_title').before('<img src="' + data.url + '" class="bor_radius im_img">');
}else { }else {
console.error('目录封面图获取失败:%s', data.msg); console.warn('目录 %s 里没有任何图片', id);
} }
}).fail(function(jqXHR, textStatus, errorThrown) { }).fail(function(jqXHR, textStatus, errorThrown) {
console.error('获取封面图失败,错误信息:' + errorThrown); console.error('获取封面图失败,错误信息:' + errorThrown);

Loading…
Cancel
Save