文件还在测试中
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
/** @var string $content */
|
||||
use Core\Theme;
|
||||
$seg = $seg ?? '';
|
||||
if ($seg === '') {
|
||||
$__p = trim(parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH), '/');
|
||||
$__parts = explode('/', $__p);
|
||||
$seg = $__parts[1] ?? '';
|
||||
}
|
||||
$site = Theme::get('site_name', '酷冰甲 · 降温服');
|
||||
$nav = admin_nav_items();
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>后台管理 · <?php echo e($site); ?></title>
|
||||
<link rel="stylesheet" href="<?php echo asset('css/admin.css'); ?>">
|
||||
</head>
|
||||
<body class="admin">
|
||||
<?php if (is_admin()): ?>
|
||||
<aside class="admin-side">
|
||||
<a class="admin-brand" href="<?php echo site_url('admin'); ?>"><span class="brand-mark"><?php echo admin_icon('snowflake', 20); ?></span> <span class="brand-text"><?php echo e($site); ?></span></a>
|
||||
<nav class="admin-nav">
|
||||
<?php foreach ($nav as $n): ?>
|
||||
<a href="<?php echo site_url($n['url']); ?>" class="<?php echo $seg === $n['k'] ? 'active' : ''; ?>"><span class="nav-ic"><?php echo admin_icon($n['ic'] ?? 'file-text', 20); ?></span><span class="nav-label"><?php echo e($n['label']); ?></span><?php if (!empty($n['badge'])): ?><span class="nav-badge"><?php echo (int)$n['badge']; ?></span><?php endif; ?></a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<div class="admin-side-foot">
|
||||
<a href="<?php echo site_url(); ?>" target="_blank"><?php echo admin_icon('globe', 18); ?> 查看前台</a>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="admin-body">
|
||||
<header class="admin-top">
|
||||
<div class="admin-top-left">
|
||||
<button class="menu-toggle" aria-label="菜单"><?php echo admin_icon('menu', 22); ?></button>
|
||||
<a class="top-link" href="<?php echo site_url(); ?>" target="_blank"><?php echo admin_icon('globe', 16); ?> 查看前台</a>
|
||||
</div>
|
||||
<div class="admin-user">
|
||||
<span class="admin-user-name"><span class="admin-avatar"><?php echo admin_icon('user', 16); ?></span> <?php echo e($_SESSION['admin_name'] ?? '管理员'); ?>
|
||||
<span class="role-badge role-<?php echo e(admin_role()); ?>"><?php echo e(admin_role_label(admin_role())); ?></span>
|
||||
</span>
|
||||
<a class="btn-soft btn-sm" href="<?php echo site_url('admin/password'); ?>"><?php echo admin_icon('key', 15); ?> 修改密码</a>
|
||||
<a class="btn-soft btn-sm" href="<?php echo site_url('admin/logout'); ?>"><?php echo admin_icon('logout', 15); ?> 退出</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="admin-content">
|
||||
<?php if (!empty($_SESSION['flash'])): $f = $_SESSION['flash']; unset($_SESSION['flash']); ?>
|
||||
<div class="alert alert-<?php echo $f['type'] === 'ok' ? 'ok' : 'err'; ?>"><?php echo e($f['msg']); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php echo $content; ?></main>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="admin-login-wrap"><?php echo $content; ?></div>
|
||||
<?php endif; ?>
|
||||
<script src="<?php echo asset('js/admin.js'); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,202 @@
|
||||
<?php
|
||||
/** @var string $content */
|
||||
use Core\Theme;
|
||||
$site = Theme::all();
|
||||
$name = $site['site_name'];
|
||||
$slogan = $site['site_slogan'];
|
||||
$phone = $site['contact_phone'];
|
||||
$logo = $site['site_logo'];
|
||||
$defaultMode = $site['default_mode'];
|
||||
$headerStyle = $site['header'];
|
||||
$icp = $site['icp'];
|
||||
$gongan = $site['gongan'] ?? '';
|
||||
|
||||
// ── 页面级 SEO 数据(控制器通过 $this->view() 或 $data 传入)────
|
||||
$pageSeo = $pageSeo ?? [];
|
||||
$seoTitle = $pageSeo['title'] ?? $site['seo_title'];
|
||||
$seoDesc = $pageSeo['description'] ?? $site['seo_description'];
|
||||
$seoKeywords = $pageSeo['keywords'] ?? $site['seo_keywords'];
|
||||
$ogImage = $pageSeo['og_image'] ?? (site_url() . 'assets/img/og-default.png');
|
||||
$ogType = $pageSeo['og_type'] ?? 'website';
|
||||
$jsonLd = $pageSeo['jsonld'] ?? '';
|
||||
$breadcrumb = $pageSeo['breadcrumb'] ?? null;
|
||||
$noindex = $pageSeo['noindex'] ?? false;
|
||||
$canonical = $pageSeo['canonical'] ?? absolute_url();
|
||||
|
||||
// 页面级 title 自动追加站点名后缀(如果没包含)
|
||||
if (!empty($pageSeo['title']) && mb_strpos($seoTitle, $name) === false) {
|
||||
$seoTitle = $seoTitle . ' - ' . $name;
|
||||
}
|
||||
|
||||
$current = trim(parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH), '/');
|
||||
$nav = [
|
||||
['label' => '首页', 'url' => ''],
|
||||
['label' => '产品中心', 'url' => 'products'],
|
||||
['label' => '新闻动态', 'url' => 'news'],
|
||||
['label' => '客户案例', 'url' => 'cases'],
|
||||
['label' => '关于我们', 'url' => 'page/about'],
|
||||
['label' => '联系我们', 'url' => 'contact'],
|
||||
];
|
||||
$isActive = function ($url) use ($current) {
|
||||
if ($url === '') return $current === '';
|
||||
return strpos($current, $url) === 0;
|
||||
};
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN" data-theme="<?php echo e($defaultMode); ?>">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo e($seoTitle); ?></title>
|
||||
<meta name="description" content="<?php echo e($seoDesc); ?>">
|
||||
<meta name="keywords" content="<?php echo e($seoKeywords); ?>">
|
||||
<?php if ($noindex): ?><meta name="robots" content="noindex, follow"><?php endif; ?>
|
||||
<link rel="canonical" href="<?php echo e($canonical); ?>">
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="<?php echo asset('img/favicon-32.png'); ?>">
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="<?php echo asset('img/favicon-16.png'); ?>">
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="<?php echo asset('img/apple-touch-icon.png'); ?>">
|
||||
|
||||
<!-- Open Graph (社交分享卡片: 微信/QQ/Facebook/LinkedIn 等) -->
|
||||
<meta property="og:title" content="<?php echo e($seoTitle); ?>">
|
||||
<meta property="og:description" content="<?php echo e($seoDesc); ?>">
|
||||
<meta property="og:image" content="<?php echo e($ogImage); ?>">
|
||||
<meta property="og:url" content="<?php echo e($canonical); ?>">
|
||||
<meta property="og:type" content="<?php echo e($ogType); ?>">
|
||||
<meta property="og:site_name" content="<?php echo e($name); ?>">
|
||||
<meta property="og:locale" content="zh_CN">
|
||||
|
||||
<!-- Twitter Card (Twitter/X 分享预览) -->
|
||||
<meta name="twitter:card" content="summary_large_image">
|
||||
<meta name="twitter:title" content="<?php echo e($seoTitle); ?>">
|
||||
<meta name="twitter:description" content="<?php echo e($seoDesc); ?>">
|
||||
<meta name="twitter:image" content="<?php echo e($ogImage); ?>">
|
||||
|
||||
<!-- ── 结构化数据(JSON-LD Schema.org)──── -->
|
||||
<!-- Organization - 全局组织信息,所有页面共用 -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
"name": <?php echo json_encode($name, JSON_UNESCAPED_UNICODE); ?>,
|
||||
"url": <?php echo json_encode(site_url(), JSON_UNESCAPED_UNICODE); ?>,
|
||||
"logo": <?php echo json_encode($logo ?: '', JSON_UNESCAPED_UNICODE); ?>,
|
||||
"description": <?php echo json_encode($slogan, JSON_UNESCAPED_UNICODE); ?>,
|
||||
"contactPoint": {
|
||||
"@type": "ContactPoint",
|
||||
"telephone": <?php echo json_encode($phone, JSON_UNESCAPED_UNICODE); ?>,
|
||||
"contactType": "customer service",
|
||||
"availableLanguage": ["Chinese"]
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<!-- WebSite - 搜索框结构化数据,可在 SERP 中显示站内搜索框 -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "WebSite",
|
||||
"name": <?php echo json_encode($name, JSON_UNESCAPED_UNICODE); ?>,
|
||||
"url": <?php echo json_encode(site_url(), JSON_UNESCAPED_UNICODE); ?>
|
||||
}
|
||||
</script>
|
||||
<?php if ($breadcrumb): ?>
|
||||
<!-- BreadcrumbList - 面包屑导航 -->
|
||||
<script type="application/ld+json">
|
||||
{
|
||||
"@context": "https://schema.org",
|
||||
"@type": "BreadcrumbList",
|
||||
"itemListElement": [
|
||||
<?php $bcCount = count($breadcrumb); $bcIdx = 0; foreach ($breadcrumb as $bc): $bcIdx++; ?>
|
||||
{
|
||||
"@type": "ListItem",
|
||||
"position": <?php echo $bcIdx; ?>,
|
||||
"name": <?php echo json_encode($bc['name'], JSON_UNESCAPED_UNICODE); ?>,
|
||||
"item": <?php echo json_encode($bc['url'] ?? '', JSON_UNESCAPED_UNICODE); ?>
|
||||
}<?php if ($bcIdx < $bcCount) echo ','; echo "\n"; ?>
|
||||
<?php endforeach; ?>
|
||||
]
|
||||
}
|
||||
</script>
|
||||
<?php endif; ?>
|
||||
<?php if ($jsonLd): ?>
|
||||
<?php echo $jsonLd; ?>
|
||||
|
||||
<?php endif; ?>
|
||||
|
||||
<link rel="stylesheet" href="<?php echo asset('css/theme.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php echo asset('css/site.css'); ?>">
|
||||
<script>
|
||||
(function () {
|
||||
try {
|
||||
var t = localStorage.getItem('site_theme');
|
||||
if (t) document.documentElement.setAttribute('data-theme', t);
|
||||
} catch (e) {}
|
||||
})();
|
||||
</script>
|
||||
</head>
|
||||
<body class="header-<?php echo e($headerStyle); ?>">
|
||||
|
||||
<header class="site-header" id="siteHeader">
|
||||
<div class="container nav-inner">
|
||||
<a class="brand" href="<?php echo site_url(); ?>">
|
||||
<?php $logoSrc = $logo ? (preg_match('#^https?://|^\/\/#i', (string)$logo) ? $logo : site_url(ltrim($logo, '/'))) : ''; ?>
|
||||
<?php if ($logoSrc): ?><img src="<?php echo e($logoSrc); ?>" alt="<?php echo e($name); ?>" class="brand-logo"><?php else: ?><span class="brand-mark">❄</span><?php endif; ?>
|
||||
</a>
|
||||
<nav class="nav-links" id="navLinks">
|
||||
<?php foreach ($nav as $n): ?>
|
||||
<a href="<?php echo site_url($n['url']); ?>" class="<?php echo $isActive($n['url']) ? 'active' : ''; ?>"><?php echo e($n['label']); ?></a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<div class="nav-actions">
|
||||
<button class="theme-toggle" id="themeToggle" aria-label="切换明暗">🌓</button>
|
||||
<a class="btn btn-primary magnetic" href="<?php echo site_url('contact'); ?>">免费拿样</a>
|
||||
<button class="nav-burger" id="navBurger" aria-label="菜单">☰</button>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
<main class="site-main">
|
||||
<?php echo $content; ?>
|
||||
</main>
|
||||
|
||||
<footer class="site-footer">
|
||||
<div class="container footer-grid">
|
||||
<div>
|
||||
<div class="brand">
|
||||
<?php if ($logoSrc): ?><img src="<?php echo e($logoSrc); ?>" alt="<?php echo e($name); ?>" class="brand-logo"><?php else: ?><span class="brand-mark">❄</span><span class="brand-name"><?php echo e($name); ?></span><?php endif; ?>
|
||||
</div>
|
||||
<p class="footer-slogan"><?php echo e($slogan); ?></p>
|
||||
<p class="footer-line">电话:<a href="tel:<?php echo e($phone); ?>"><?php echo e($phone); ?></a></p>
|
||||
<p class="footer-line">邮箱:<?php echo e($site['contact_email']); ?></p>
|
||||
<p class="footer-line">地址:<?php echo e($site['contact_address']); ?></p>
|
||||
</div>
|
||||
<div>
|
||||
<h4>产品系列</h4>
|
||||
<a href="<?php echo site_url('products'); ?>">水冷循环降温服</a>
|
||||
<a href="<?php echo site_url('products'); ?>">相变蓄冷凝胶服</a>
|
||||
<a href="<?php echo site_url('products'); ?>">涡扇风冷降温服</a>
|
||||
<a href="<?php echo site_url('products'); ?>">工业降温工装</a>
|
||||
</div>
|
||||
<div>
|
||||
<h4>快速链接</h4>
|
||||
<a href="<?php echo site_url('page/about'); ?>">关于我们</a>
|
||||
<a href="<?php echo site_url('page/service'); ?>">服务与优势</a>
|
||||
<a href="<?php echo site_url('cases'); ?>">客户案例</a>
|
||||
<a href="<?php echo site_url('news'); ?>">新闻动态</a>
|
||||
<a href="<?php echo site_url('order/query'); ?>">订单查询</a>
|
||||
</div>
|
||||
<div>
|
||||
<h4>关注我们</h4>
|
||||
<p class="footer-line">扫码或来电,获取专属降温方案</p>
|
||||
<a class="btn btn-ghost" href="<?php echo site_url('contact'); ?>">立即咨询</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer-bottom container">
|
||||
<span>© <?php echo date('Y'); ?> <?php echo e($name); ?> · 科技降温服装定制</span>
|
||||
<?php if ($icp): ?><span><?php echo e($icp); ?></span><?php endif; ?>
|
||||
<?php if ($gongan): ?><span><a href="https://beian.mps.gov.cn/" target="_blank" rel="noopener"><?php echo e($gongan); ?></a></span><?php endif; ?>
|
||||
</div>
|
||||
</footer>
|
||||
|
||||
<script src="<?php echo asset('js/main.js'); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,95 @@
|
||||
<?php
|
||||
/**
|
||||
* 分系统后台布局(CRM / 进销存 PSI 共用)
|
||||
* 独立框架:左侧导航使用各子系统自身的 $nav,不再复用 admin 全量后台导航,
|
||||
* 因此 CRM/PSI 内不会出现「管理后台」仪表盘及 products/news 等后台模块。
|
||||
*/
|
||||
use Core\Theme;
|
||||
$sys = $_sys ?? 'crm';
|
||||
$sysName = $sys === 'psi' ? '进销存 PSI' : '客户管理 CRM';
|
||||
$nav = \subsys_nav($sys);
|
||||
$seg = $_seg ?? '';
|
||||
$site = Theme::get('site_name', '酷冰甲 · 降温服');
|
||||
$brandIc = $sys === 'psi' ? 'package' : 'handshake';
|
||||
$isAuthed = is_admin() || subsys_user($sys);
|
||||
|
||||
// 子系统导航 key -> 图标(避免逐个控制器改造,统一在此映射)
|
||||
$icMap = [
|
||||
'dashboard' => 'dashboard', 'customers' => 'handshake', 'leads' => 'lightbulb',
|
||||
'followups' => 'phone', 'contacts' => 'users', 'materials' => 'package',
|
||||
'products' => 'shopping-bag', 'suppliers' => 'truck', 'purchases' => 'inbox',
|
||||
'sales' => 'cart', 'stock' => 'database', 'orders' => 'receipt', 'users' => 'users', 'admin' => 'shield',
|
||||
'sales_orders' => 'shopping-bag', 'purchase_orders' => 'file-text', 'outbounds' => 'package', 'reports' => 'bar-chart',
|
||||
'reminders' => 'bell', 'notifications' => 'settings',
|
||||
];
|
||||
?>
|
||||
<!doctype html>
|
||||
<html lang="zh-CN">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title><?php echo e($sysName); ?> · <?php echo e($site); ?></title>
|
||||
<link rel="stylesheet" href="<?php echo asset('css/admin.css'); ?>">
|
||||
<link rel="stylesheet" href="<?php echo asset('css/subsys.css'); ?>">
|
||||
</head>
|
||||
<body class="admin subsys subsys-<?php echo e($sys); ?>">
|
||||
<?php if ($isAuthed): ?>
|
||||
<aside class="ss-side">
|
||||
<a class="ss-brand" href="<?php echo site_url($sys); ?>">
|
||||
<span class="ss-brand-ic"><?php echo admin_icon($brandIc, 22); ?></span>
|
||||
<span class="ss-brand-text"><b><?php echo e($sysName); ?></b><small><?php echo e($site); ?></small></span>
|
||||
</a>
|
||||
<nav class="ss-nav">
|
||||
<?php foreach ($nav as $it): ?>
|
||||
<?php $k = $it['k'] ?? ''; ?>
|
||||
<?php if (in_array($k, subsys_pages($sys), true) && !subsys_page_can($sys, $k)) continue; ?>
|
||||
<?php $active = ($k === $seg); ?>
|
||||
<a href="<?php echo site_url($it['url'] ?? '#'); ?>" class="ss-nav-item<?php echo $active ? ' active' : ''; ?>">
|
||||
<span class="ss-ic"><?php echo admin_icon($icMap[$k] ?? 'file-text', 20); ?></span>
|
||||
<span class="ss-label"><?php echo e($it['label'] ?? ''); ?></span>
|
||||
</a>
|
||||
<?php endforeach; ?>
|
||||
</nav>
|
||||
<div class="ss-side-foot">
|
||||
<a href="<?php echo site_url(); ?>" target="_blank" class="ss-foot-link"><?php echo admin_icon('globe', 18); ?> 查看前台</a>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="ss-body">
|
||||
<header class="ss-top">
|
||||
<div class="ss-top-left">
|
||||
<button class="menu-toggle" type="button" aria-label="菜单"><?php echo admin_icon('menu', 22); ?></button>
|
||||
<span class="ss-crumb"><?php echo e($sysName); ?></span>
|
||||
</div>
|
||||
<?php if ($sys === 'psi'):
|
||||
$unread = \psi_unread_events(); ?>
|
||||
<a class="ss-bell" href="<?php echo \Core\App::url('PSI/reminders'); ?>" title="紧急提醒">
|
||||
<?php echo admin_icon('bell', 20) ?: '🔔'; ?>
|
||||
<?php if ($unread > 0): ?><span class="ss-badge"><?php echo $unread > 99 ? '99+' : $unread; ?></span><?php endif; ?>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<div class="ss-user">
|
||||
<span class="ss-user-name">
|
||||
<span class="ss-avatar"><?php echo admin_icon('user', 15); ?></span>
|
||||
<?php echo e($_SESSION['admin_name'] ?? '操作员'); ?>
|
||||
<span class="role-badge role-<?php echo e(admin_role()); ?>"><?php echo e(admin_role_label(admin_role())); ?></span>
|
||||
</span>
|
||||
<?php if (in_array(admin_role(), ['super_admin', 'admin'], true)): ?>
|
||||
<a class="btn-soft btn-sm" href="<?php echo site_url('admin'); ?>"><?php echo admin_icon('dashboard', 15); ?> 管理后台</a>
|
||||
<?php endif; ?>
|
||||
<a class="btn-soft btn-sm" href="<?php echo site_url('admin/password'); ?>"><?php echo admin_icon('key', 15); ?> 密码</a>
|
||||
<a class="btn-soft btn-sm" href="<?php echo site_url('admin/logout'); ?>"><?php echo admin_icon('logout', 15); ?> 退出</a>
|
||||
</div>
|
||||
</header>
|
||||
<main class="ss-content">
|
||||
<?php if (!empty($_SESSION['flash'])): $f = $_SESSION['flash']; unset($_SESSION['flash']); ?>
|
||||
<div class="alert alert-<?php echo $f['type'] === 'ok' ? 'ok' : 'err'; ?>"><?php echo e($f['msg']); ?></div>
|
||||
<?php endif; ?>
|
||||
<?php echo $content; ?>
|
||||
</main>
|
||||
</div>
|
||||
<?php else: ?>
|
||||
<div class="admin-login-wrap"><?php echo $content; ?></div>
|
||||
<?php endif; ?>
|
||||
<script src="<?php echo asset('js/admin.js'); ?>"></script>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user