统一全部表单控件尺寸与外观;删除下载地址字段
用户:「输入框、按钮、下拉框特别丑,一点设计感都没有,高度太随意,
全面检查一下。还有那个下载链接要它干什么?」
一、表单控件(这是主要工作量)
原来样式散在 6 处(.field / .filter-row / .filters / .mail-test / .admin 各一套),
padding 有 8/9/12px 三种,select 与 input 高度不等,并排放参差不齐。
改成一套体系:
- CSS 变量统一尺度:--ctl-h 38px / --ctl-h-sm 32px / --ctl-h-lg 42px,
统一圆角 9px、统一左右内边距 12px、统一边框与阴影
- 高度用「固定 height + line-height 居中」而不是 padding 撑
- 🔴 选择器必须**宽松**(按 type 通吃,不用 .field 之类限定)。
第一版限制了容器,导致后台零散布局里的裸 select/input 只有 19/21px,
和旁边 38px 按钮并排,正是用户说的高度随意。
放开后实测:19px → 38px,全部一致
- 下拉框自绘箭头(内联 SVG),不再用各平台不一的原生箭头,右侧留 34px
- 搜索框加左侧放大镜图标,并去掉 Chrome 自带清除按钮
- 聚焦统一 brand 光晕,悬停边框加深
- 按钮也改固定 height(原来 padding 撑出 38.3px,与输入框差 0.3px)
- .btn.sm 必须显式改 height,否则 padding 被 height 吃掉、小按钮还是 38px
文件选择按钮:原生控件重做成真按钮
<label class=file-btn> 包住 input[type=file]
input 用 clip 视觉隐藏(不能用 display:none,那样点不到也聚焦不了)
按钮内显示「选择图片」+ 图标 + 选中后的文件名
二、删除「下载地址」字段
它唯一用途:状态改为「已解决」时把邮件按钮换成「下载最新版本」。
收益小、维护成本高(每个软件都要填一条 URL)。
- 后台表单项删除
- mailer 里对应的判断分支也删掉,按钮统一「查看详情」
- ⚠️ 数据库 download_url 列**保留不删**:删列不可逆,万一要恢复还得迁一次
验证(用控件总览测试页 + 真实页面实测):
10 类控件高度全部 38px(文本/数字/下拉/搜索/文件按钮/主按钮/小按钮…),
文本域 110px,同一行垂直中心完全一致(935.3)
裸 select/input 从 19/21px 修正到 38px
下拉箭头 SVG 生效、右内边距 34px;搜索框放大镜生效、左内边距 36px
真实三个页面(提交页/列表页/详情页)逐一检查:
没有 checkbox/radio/file 被误改,所有可见控件高度收敛为 38(文本域 110)
下载地址字段:admin.php 输出与源码中均无 download_url 表单项
5 个路由 200
This commit is contained in:
+27
-10
@@ -510,10 +510,19 @@ function fb_admin_taxonomy_page($pdo, $editSw, $editCat) {
|
||||
}
|
||||
echo ' </div>';
|
||||
echo ' <div class="icon-up-main">';
|
||||
echo ' <input type="file" name="icon_file" accept="image/png,image/jpeg,image/webp" id="iconFile' . ($esw ? (int)$esw['id'] : 'new') . '">';
|
||||
echo ' <i class="hint" style="margin-top:4px">建议 256×256 或 512×512 的方形图;带透明背景的 PNG 效果最好。</i>';
|
||||
/* 文件选择按钮重做成真按钮(用户:原生那个太丑)。
|
||||
* <label class="file-btn"> 包住 input[type=file],点 label 就等于点 input;
|
||||
* input 用 clip 视觉隐藏但仍可聚焦(不能用 display:none,那样点不到)。 */
|
||||
$ficonFileId = 'iconFile' . ($esw ? (int)$esw['id'] : 'new');
|
||||
echo ' <label class="file-btn" for="' . $ficonFileId . '">'
|
||||
. '<span class="file-btn-ic" aria-hidden="true"></span>'
|
||||
. '<span class="file-btn-txt">选择图片</span>'
|
||||
. '<span class="file-btn-name" data-file-name></span>'
|
||||
. '<input type="file" name="icon_file" accept="image/png,image/jpeg,image/webp" id="' . $ficonFileId . '">'
|
||||
. '</label>';
|
||||
echo ' <i class="hint" style="margin-top:6px">建议 256×256 或 512×512 的方形图;带透明背景的 PNG 效果最好。</i>';
|
||||
if ($curIconUrl !== '') {
|
||||
echo ' <label class="check" style="margin-top:6px"><input type="checkbox" name="icon_clear" value="1"> 移除当前图片,改用下面的字符图标</label>';
|
||||
echo ' <label class="check" style="margin-top:8px"><input type="checkbox" name="icon_clear" value="1"> 移除当前图片,改用下面的字符图标</label>';
|
||||
}
|
||||
echo ' </div>';
|
||||
echo ' </div>';
|
||||
@@ -529,11 +538,17 @@ function fb_admin_taxonomy_page($pdo, $editSw, $editCat) {
|
||||
}
|
||||
echo '</span></label>';
|
||||
|
||||
// 下载地址:状态改成「已解决」时,邮件里会给用户一个去下新版的按钮
|
||||
echo ' <label class="field"><span>下载地址<i class="hint">可留空。填了之后「已解决」的通知邮件里会多一个「下载最新版」按钮</i></span>'
|
||||
. '<input type="url" name="download_url" maxlength="300" value="'
|
||||
. e($esw ? (string)(isset($esw['download_url']) ? $esw['download_url'] : '') : '')
|
||||
. '" placeholder="https://..."></label>';
|
||||
/* ── 「下载地址」字段已删除 ──
|
||||
* 用户 2026-11-04:「有个什么下载链接,这个东西不要,要它干什么?」
|
||||
*
|
||||
* 它原本的唯一用途:当反馈状态改成「已解决」时,把通知邮件里的按钮
|
||||
* 从「查看详情」换成「下载最新版本」。属于可有可无的小功能,
|
||||
* 却要求管理员为每个软件再维护一条 URL —— 收益远小于维护成本。
|
||||
*
|
||||
* ⚠️ 数据库的 download_url 列**保留不删**:
|
||||
* ① 删列会让历史数据不可逆丢失;
|
||||
* ② 万一以后想恢复,不用再走一次迁移。
|
||||
* 只是前台表单不再暴露,mailer 里也已改为始终用「查看详情」。 */
|
||||
|
||||
// 主题色:前台按软件换色,用短链接进不同软件一眼就能区分
|
||||
$curColor = $esw ? fb_color_norm((string)$esw['color']) : '';
|
||||
@@ -577,8 +592,10 @@ function fb_admin_taxonomy_page($pdo, $editSw, $editCat) {
|
||||
echo ' </div>';
|
||||
echo ' </div>';
|
||||
if ($esw) {
|
||||
echo ' <label class="field"><span>排序<i class="hint">数字小的排前面</i></span>'
|
||||
. '<input type="number" name="sort_order" value="' . (int)$esw['sort_order'] . '"></label>';
|
||||
/* 排序是 1-2 位的小整数,占满整行很难看 —— 收窄成定宽。
|
||||
* 用 .field-narrow 限制宽度,而不是让它跟着 .field 铺满。 */
|
||||
echo ' <label class="field field-narrow"><span>排序<i class="hint">数字小的排前面,同级按名称排</i></span>'
|
||||
. '<input type="number" name="sort_order" min="0" max="999" value="' . (int)$esw['sort_order'] . '"></label>';
|
||||
echo ' <button class="btn primary" name="act" value="sw_edit" type="submit">保存</button> '
|
||||
. '<a class="btn" href="admin.php?tab=taxonomy">取消</a>';
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user