feat(admin): 主题对齐春绿(Spring Green v4 · #00E070)
- FcInstall:BANNERS 种子改 105deg 亮绿→深绿(与小程序 common/mock/data.js 逐字对齐) - FcInstall:幂等升级新增 LEGACY_COLOR_KEYS,可识别「旧暖橙 + v1.2 生态绿」两种历史底色并覆盖为春绿, 已是春绿渐变或运营自定义标题的轮播自动跳过(老库执行 php think fc:install 即可,无需 --reset) - 轮播表单:占位示例与帮助文案改春绿 105deg,并注明小程序侧文字为墨绿字 - 登录页:品牌色改春绿(--brand 白底可读 #04874A / --brand-bright #00E070 只做按钮面 + 墨绿字), 品牌栏深绿渐变与光晕同步 - docs/05:fc_banner.color 取值约定与 §7.6 升级规则同步 v1.3.0
这个提交包含在:
@@ -12,7 +12,7 @@ use think\Db;
|
||||
* 同城分类信息 · 业务表安装器
|
||||
*
|
||||
* 用法:
|
||||
* php think fc:install 建表 + 首次注入种子数据(已存在则跳过种子)+ 轮播底色与生态绿主题对齐
|
||||
* php think fc:install 建表 + 首次注入种子数据(已存在则跳过种子)+ 轮播底色与春绿主题对齐
|
||||
* php think fc:install --reset 建表 + 强制重置种子数据
|
||||
*
|
||||
* 说明:全部使用 CREATE TABLE IF NOT EXISTS,幂等安全,不影响 FastAdmin 原有表。
|
||||
@@ -22,13 +22,24 @@ class FcInstall extends Command
|
||||
{
|
||||
/**
|
||||
* 内置轮播(标题 / 跳转 / 底色)——种子数据与「底色升级」共用同一份定义。
|
||||
* color 取前端 uni.scss 的生态绿渐变家族:绿 = 平台与内容;
|
||||
* image 留空时小程序用「绿底 + 白色插画」内置配图渲染。
|
||||
* color 取前端 uni.scss 的春绿主题(v4):105deg 亮绿(左)→ 深绿(右),
|
||||
* 文字区落在亮绿端(小程序用墨绿字 #04301E),白色插画落在右侧深绿端;
|
||||
* image 留空时小程序用「亮绿底 + 墨绿字 + 白色插画」内置配图渲染。
|
||||
*/
|
||||
const BANNERS = [
|
||||
['同城好物节 · 二手直降', '/pages/post/list?categoryId=3', 'linear-gradient(135deg, #18a587 0%, #0e7c66 55%, #0a5d4d 100%)'],
|
||||
['招聘旺季 · 免费发布', '/pages/post/create', 'linear-gradient(135deg, #0e7c66 0%, #0a5d4d 55%, #04302a 100%)'],
|
||||
['本地服务 · 上门更省心', '/pages/post/list?categoryId=5', 'linear-gradient(135deg, #16897f 0%, #0e6b62 55%, #07443e 100%)'],
|
||||
['同城好物节 · 二手直降', '/pages/post/list?categoryId=3', 'linear-gradient(105deg, #00e070 0%, #00c860 42%, #046b3b 100%)'],
|
||||
['招聘旺季 · 免费发布', '/pages/post/create', 'linear-gradient(105deg, #00d96c 0%, #00b85c 40%, #023a21 100%)'],
|
||||
['本地服务 · 上门更省心', '/pages/post/list?categoryId=5', 'linear-gradient(105deg, #00e878 0%, #049e52 45%, #045c34 100%)'],
|
||||
];
|
||||
|
||||
/**
|
||||
* 需要被主题升级覆盖的历史底色特征:
|
||||
* ① 旧暖橙纯色(#FF8A5B 一族);② v1.2 生态绿(#0e7c66 一族);
|
||||
* 命中任一即按标题覆盖为上面的春绿渐变(只动 color 字段,不动业务数据)。
|
||||
*/
|
||||
const LEGACY_COLOR_KEYS = [
|
||||
'18a587', '0e7c66', '0a5d4d', '04302a', '16897f', '0e6b62', '07443e',
|
||||
'ff8a5b', 'ffb86b', 'ff6f61',
|
||||
];
|
||||
|
||||
protected function configure()
|
||||
@@ -63,7 +74,7 @@ class FcInstall extends Command
|
||||
$output->writeln('==> 已有数据,跳过种子(如需重置请加 --reset)');
|
||||
}
|
||||
|
||||
$output->writeln('==> 轮播底色与生态绿主题对齐');
|
||||
$output->writeln('==> 轮播底色与春绿主题对齐');
|
||||
$this->upgradeBanners($output);
|
||||
|
||||
$output->writeln('==> 初始化后台菜单');
|
||||
@@ -75,10 +86,11 @@ class FcInstall extends Command
|
||||
/**
|
||||
* 轮播底色升级(幂等,可重复执行)
|
||||
*
|
||||
* v1.2 起主题改为生态绿,旧版种子里的轮播底色是暖橙纯色(#FF8A5B / #FFB86B / #FF6F61)。
|
||||
* 线上库若还是旧值,这里按「标题」精确匹配把内置 3 条轮播的底色覆盖为生态绿渐变;
|
||||
* 主题迭代史:v1.0.x 暖橙纯色(#FF8A5B 一族)→ v1.2 生态绿(#0e7c66 一族)→ v1.3 春绿(本次)。
|
||||
* 线上库若还是历史值,这里按「标题」精确匹配把内置 3 条轮播的底色覆盖为春绿渐变;
|
||||
* 只动 color 字段,不新增/删除记录,也不影响发布、订单等业务数据。
|
||||
* 自定义过标题或已填渐变(linear-gradient(...))的轮播不会被改动。
|
||||
* 判定规则:color 为空/非渐变(旧纯色),或命中 LEGACY_COLOR_KEYS(上一版主题色)→ 覆盖;
|
||||
* 自定义过标题、或已是春绿渐变(#00e070 一族)的轮播不会被改动(幂等)。
|
||||
*/
|
||||
private function upgradeBanners(Output $output)
|
||||
{
|
||||
@@ -90,23 +102,35 @@ class FcInstall extends Command
|
||||
$type = isset($row['Type']) ? (string)$row['Type'] : (isset($row['type']) ? (string)$row['type'] : '');
|
||||
if (preg_match('/^varchar\((\d+)\)$/i', $type, $m) && (int)$m[1] < 255) {
|
||||
Db::execute("ALTER TABLE `{$table}` MODIFY COLUMN `color` varchar(255) NOT NULL DEFAULT ''"
|
||||
. " COMMENT '底色:CSS 渐变 linear-gradient(...),留空则用内置生态绿渐变'");
|
||||
. " COMMENT '底色:CSS 渐变 linear-gradient(...),留空则用内置春绿渐变'");
|
||||
$output->writeln(' - 轮播底色列 color 已由 ' . $type . ' 扩容为 varchar(255)(存 CSS 渐变)');
|
||||
}
|
||||
|
||||
// ② 旧暖色纯色 → 生态绿渐变
|
||||
// ② 历史底色(旧纯色 / 上一版生态绿)→ 春绿渐变
|
||||
$upgraded = 0;
|
||||
foreach (self::BANNERS as $b) {
|
||||
$row = Db::name('fc_banner')->where('title', $b[0])->find();
|
||||
if ($row && strpos((string)$row['color'], 'gradient(') === false) {
|
||||
if (!$row) {
|
||||
continue;
|
||||
}
|
||||
$color = strtolower((string)$row['color']);
|
||||
$isGradient = strpos($color, 'gradient(') !== false;
|
||||
$isLegacy = false;
|
||||
foreach (self::LEGACY_COLOR_KEYS as $k) {
|
||||
if (strpos($color, $k) !== false) {
|
||||
$isLegacy = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!$isGradient || $isLegacy) {
|
||||
Db::name('fc_banner')->where('id', $row['id'])
|
||||
->update(['color' => $b[2], 'updatetime' => time()]);
|
||||
$upgraded++;
|
||||
}
|
||||
}
|
||||
$output->writeln($upgraded
|
||||
? ' - 已把 ' . $upgraded . ' 条旧纯色轮播底色升级为生态绿渐变'
|
||||
: ' - 轮播底色已是渐变或非内置轮播,无需处理');
|
||||
? ' - 已把 ' . $upgraded . ' 条内置轮播底色升级为春绿渐变(105deg 亮绿→深绿)'
|
||||
: ' - 轮播底色已是春绿渐变或非内置轮播,无需处理');
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -250,7 +274,7 @@ class FcInstall extends Command
|
||||
`title` varchar(64) NOT NULL DEFAULT '',
|
||||
`image` varchar(255) NOT NULL DEFAULT '' COMMENT '图片,空则用渐变占位',
|
||||
`link` varchar(255) NOT NULL DEFAULT '' COMMENT '跳转路径',
|
||||
`color` varchar(255) NOT NULL DEFAULT '' COMMENT '底色:CSS 渐变 linear-gradient(...),留空则用内置生态绿渐变',
|
||||
`color` varchar(255) NOT NULL DEFAULT '' COMMENT '底色:CSS 渐变 linear-gradient(...),留空则用内置春绿渐变',
|
||||
`sort` int(10) NOT NULL DEFAULT '0',
|
||||
`enabled` tinyint(1) NOT NULL DEFAULT '1',
|
||||
`createtime` int(10) DEFAULT NULL,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-image" class="form-control" name="row[image]" type="text" value="" placeholder="整幅配图地址,可留空">
|
||||
<span class="help-block">留空时小程序用内置白色插画(生态绿渐变底 + 圆环大徽章)渲染;填了图则铺满整张卡面并隐藏装饰层。</span>
|
||||
<span class="help-block">留空时小程序用内置白色插画(春绿渐变底 + 圆环大徽章,文字为墨绿字)渲染;填了图则铺满整张卡面并隐藏装饰层。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -22,8 +22,8 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Color')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-color" class="form-control" name="row[color]" type="text" value="" placeholder="linear-gradient(135deg, #18a587 0%, #0e7c66 55%, #0a5d4d 100%)">
|
||||
<span class="help-block">填 CSS 渐变(生态绿家族,纯色请写成同色双色标,如 <code>linear-gradient(135deg, #0E7C66 0%, #0E7C66 100%)</code>);留空或填纯色时小程序会回落到内置生态绿渐变。</span>
|
||||
<input id="c-color" class="form-control" name="row[color]" type="text" value="" placeholder="linear-gradient(105deg, #00E070 0%, #00C860 42%, #046B3B 100%)">
|
||||
<span class="help-block">填 CSS 渐变(春绿家族;纯色请写成同色双色标,如 <code>linear-gradient(105deg, #00E070 0%, #00E070 100%)</code>);留空或填纯色时小程序会回落到内置春绿渐变。建议方向 105deg(亮绿在左,深绿在右),文字区落在左侧亮绿端更清晰。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Image')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-image" class="form-control" name="row[image]" type="text" value="{$row.image|htmlentities}" placeholder="整幅配图地址,可留空">
|
||||
<span class="help-block">留空时小程序用内置白色插画(生态绿渐变底 + 圆环大徽章)渲染;填了图则铺满整张卡面并隐藏装饰层。</span>
|
||||
<span class="help-block">留空时小程序用内置白色插画(春绿渐变底 + 圆环大徽章,文字为墨绿字)渲染;填了图则铺满整张卡面并隐藏装饰层。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -22,8 +22,8 @@
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">{:__('Color')}:</label>
|
||||
<div class="col-xs-12 col-sm-8">
|
||||
<input id="c-color" class="form-control" name="row[color]" type="text" value="{$row.color|htmlentities}" placeholder="linear-gradient(135deg, #18a587 0%, #0e7c66 55%, #0a5d4d 100%)">
|
||||
<span class="help-block">填 CSS 渐变(生态绿家族,纯色请写成同色双色标,如 <code>linear-gradient(135deg, #0E7C66 0%, #0E7C66 100%)</code>);留空或填纯色时小程序会回落到内置生态绿渐变。</span>
|
||||
<input id="c-color" class="form-control" name="row[color]" type="text" value="{$row.color|htmlentities}" placeholder="linear-gradient(105deg, #00E070 0%, #00C860 42%, #046B3B 100%)">
|
||||
<span class="help-block">填 CSS 渐变(春绿家族;纯色请写成同色双色标,如 <code>linear-gradient(105deg, #00E070 0%, #00E070 100%)</code>);留空或填纯色时小程序会回落到内置春绿渐变。建议方向 105deg(亮绿在左,深绿在右),文字区落在左侧亮绿端更清晰。</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
||||
@@ -5,9 +5,11 @@
|
||||
<title>山间小仓 · 同城分类信息平台 — 后台登录</title>
|
||||
<style type="text/css">
|
||||
:root {
|
||||
--brand: #0e7c66;
|
||||
--brand-dark: #0a5d4d;
|
||||
--brand-deep: #04302a;
|
||||
--brand: #04874a; /* 白底可读的绿字/描边(4.6:1) */
|
||||
--brand-bright: #00e070; /* 品牌亮绿(与小程序 $fc-primary 同色号):只做「面」 */
|
||||
--brand-ink: #04301e; /* 亮绿面上的字(8.2:1) */
|
||||
--brand-dark: #046b3b;
|
||||
--brand-deep: #023a21;
|
||||
--accent: #ffb020;
|
||||
--ink: #16241f;
|
||||
--muted: #7b8a86;
|
||||
@@ -43,8 +45,8 @@
|
||||
overflow: hidden;
|
||||
background:
|
||||
radial-gradient(900px 600px at 12% 8%, rgba(255, 176, 32, .18), transparent 55%),
|
||||
radial-gradient(820px 700px at 92% 92%, rgba(18, 161, 132, .45), transparent 60%),
|
||||
linear-gradient(152deg, #04302a 0%, #0a5f4d 50%, #0f8f72 115%);
|
||||
radial-gradient(820px 700px at 92% 92%, rgba(0, 224, 112, .42), transparent 60%),
|
||||
linear-gradient(152deg, #023a21 0%, #046b3b 50%, #04874a 115%);
|
||||
}
|
||||
|
||||
.brand-panel::after {
|
||||
@@ -243,17 +245,17 @@
|
||||
font-weight: 700;
|
||||
letter-spacing: 8px;
|
||||
text-indent: 8px;
|
||||
color: #fff !important;
|
||||
color: var(--brand-ink) !important;
|
||||
border: none;
|
||||
border-radius: 13px;
|
||||
background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
|
||||
box-shadow: 0 16px 30px -14px rgba(14, 124, 102, .9);
|
||||
background: linear-gradient(135deg, var(--brand-bright) 0%, #00c860 55%, #00b85c 100%);
|
||||
box-shadow: 0 16px 30px -14px rgba(0, 168, 85, .75);
|
||||
transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
|
||||
}
|
||||
.login-btn:hover, .login-btn:focus {
|
||||
filter: brightness(1.07);
|
||||
box-shadow: 0 18px 34px -14px rgba(14, 124, 102, 1);
|
||||
color: #fff !important;
|
||||
box-shadow: 0 18px 34px -14px rgba(0, 168, 85, .9);
|
||||
color: var(--brand-ink) !important;
|
||||
outline: none;
|
||||
}
|
||||
.login-btn:active { transform: translateY(1px); }
|
||||
|
||||
在新工单中引用
屏蔽一个用户