490 行
21 KiB
HTML
490 行
21 KiB
HTML
<style>
|
||
.fc-form-container {
|
||
padding: 15px 15px 0;
|
||
background: #f7faf9;
|
||
}
|
||
/* 分区卡片:把表单切成三个认知区块 */
|
||
.fc-section {
|
||
background: #ffffff;
|
||
border: 1px solid #eef2f6;
|
||
border-radius: 14px;
|
||
padding: 18px 18px 4px;
|
||
margin-bottom: 14px;
|
||
box-shadow: 0 1px 4px rgba(15, 23, 42, 0.03);
|
||
}
|
||
.fc-section-title {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 9px;
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
color: #1e293b;
|
||
margin-bottom: 16px;
|
||
padding-bottom: 10px;
|
||
border-bottom: 1px dashed #eef2f6;
|
||
}
|
||
.fc-sec-icon {
|
||
width: 26px;
|
||
height: 26px;
|
||
border-radius: 8px;
|
||
background: #e6fbf1;
|
||
color: #00a854;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
font-size: 13px;
|
||
flex: 0 0 auto;
|
||
}
|
||
.fc-sec-tip {
|
||
margin-left: auto;
|
||
font-size: 11px;
|
||
font-weight: 400;
|
||
color: #94a3b8;
|
||
}
|
||
/* 分类类型:分段选择器 */
|
||
.fc-kind-seg {
|
||
display: flex;
|
||
gap: 10px;
|
||
flex-wrap: wrap;
|
||
}
|
||
.fc-kind-seg label {
|
||
position: relative;
|
||
margin: 0;
|
||
cursor: pointer;
|
||
flex: 1;
|
||
min-width: 180px;
|
||
}
|
||
.fc-kind-seg input {
|
||
position: absolute;
|
||
opacity: 0;
|
||
pointer-events: none;
|
||
}
|
||
.fc-kind-seg .fc-pill {
|
||
display: block;
|
||
padding: 10px 14px;
|
||
border-radius: 12px;
|
||
border: 1.5px solid #e2e8f0;
|
||
background: #f8fafc;
|
||
transition: all 0.15s ease;
|
||
}
|
||
.fc-kind-seg .fc-pill b {
|
||
display: block;
|
||
font-size: 13.5px;
|
||
color: #334155;
|
||
margin-bottom: 2px;
|
||
}
|
||
.fc-kind-seg .fc-pill small {
|
||
display: block;
|
||
font-size: 11px;
|
||
color: #94a3b8;
|
||
line-height: 1.5;
|
||
}
|
||
.fc-kind-seg input:checked + .fc-pill {
|
||
border-color: #00d26a;
|
||
background: #f2fef7;
|
||
box-shadow: 0 0 0 2px rgba(0, 210, 106, 0.18);
|
||
}
|
||
.fc-kind-seg input:checked + .fc-pill.farm b { color: #059669; }
|
||
.fc-kind-seg input:checked + .fc-pill.general b { color: #2563eb; }
|
||
.fc-kind-seg input:focus-visible + .fc-pill { outline: 2px solid #00d26a; outline-offset: 2px; }
|
||
/* 主题色:原生取色器 */
|
||
.fc-color-row {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 10px;
|
||
}
|
||
.fc-color-row .form-control { flex: 1; }
|
||
.fc-color-native {
|
||
width: 42px;
|
||
height: 36px;
|
||
padding: 2px 3px;
|
||
border: 1px solid #e2e8f0;
|
||
border-radius: 9px;
|
||
background: #ffffff;
|
||
cursor: pointer;
|
||
flex: 0 0 auto;
|
||
}
|
||
.fc-color-preview {
|
||
width: 42px;
|
||
height: 36px;
|
||
border-radius: 9px;
|
||
border: 1px solid #e2e8f0;
|
||
flex: 0 0 auto;
|
||
box-shadow: inset 0 0 0 2px #ffffff;
|
||
}
|
||
/* 当前选中的图标微卡片展示区 */
|
||
.fc-current-icon-box {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
background: #f8fafc;
|
||
border: 1px solid #e2e8f0;
|
||
border-radius: 12px;
|
||
padding: 8px 14px;
|
||
min-height: 54px;
|
||
}
|
||
.fc-current-icon-info {
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
.fc-current-icon-info img {
|
||
width: 44px;
|
||
height: 44px;
|
||
object-fit: cover;
|
||
background: #ffffff;
|
||
border-radius: 10px;
|
||
border: 1px solid #e2e8f0;
|
||
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
|
||
}
|
||
.fc-icon-actions {
|
||
display: flex;
|
||
gap: 8px;
|
||
}
|
||
.fc-icon-actions .btn { border-radius: 9px; font-weight: 600; }
|
||
.fc-btn-main {
|
||
background: linear-gradient(135deg, #00e070, #00c860) !important;
|
||
border: none !important;
|
||
color: #04301e !important;
|
||
font-weight: 700 !important;
|
||
box-shadow: 0 3px 8px rgba(0, 210, 106, 0.28);
|
||
}
|
||
/* 推荐调色板 */
|
||
.fc-color-presets {
|
||
display: flex;
|
||
align-items: center;
|
||
gap: 8px;
|
||
margin-top: 10px;
|
||
}
|
||
.fc-color-dot {
|
||
width: 24px;
|
||
height: 24px;
|
||
border-radius: 50%;
|
||
cursor: pointer;
|
||
border: 2px solid #fff;
|
||
box-shadow: 0 0 0 1px #d5d5d5;
|
||
transition: transform 0.15s ease;
|
||
}
|
||
.fc-color-dot:hover { transform: scale(1.2); }
|
||
/* 右侧迷你小程序模拟器 */
|
||
.fc-preview-box {
|
||
position: sticky;
|
||
top: 15px;
|
||
background: linear-gradient(150deg, #f2fef7 0%, #e6fbf1 100%);
|
||
border: 1px solid #c8f2de;
|
||
border-radius: 16px;
|
||
padding: 18px 14px;
|
||
text-align: center;
|
||
box-shadow: 0 4px 14px rgba(4, 48, 30, 0.05);
|
||
}
|
||
.fc-preview-title {
|
||
font-size: 12px;
|
||
color: #04874a;
|
||
font-weight: 700;
|
||
margin-bottom: 14px;
|
||
}
|
||
.fc-preview-badge {
|
||
width: 64px;
|
||
height: 64px;
|
||
border-radius: 18px;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
margin: 0 auto 8px;
|
||
overflow: hidden;
|
||
box-shadow: 0 4px 12px rgba(4, 48, 30, 0.08);
|
||
transition: all 0.2s ease;
|
||
}
|
||
.fc-preview-badge img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
}
|
||
.fc-preview-name {
|
||
font-size: 14px;
|
||
font-weight: 700;
|
||
color: #1e293b;
|
||
}
|
||
.fc-preview-note {
|
||
font-size: 11px;
|
||
color: #64748b;
|
||
margin-top: 10px;
|
||
line-height: 1.6;
|
||
}
|
||
|
||
/* 插画选择模态窗口 */
|
||
.fc-icon-modal-wrap {
|
||
display: none;
|
||
position: fixed;
|
||
left: 0;
|
||
top: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
z-index: 1999;
|
||
}
|
||
.fc-icon-modal-wrap.open {
|
||
display: flex !important;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.fc-modal-overlay {
|
||
position: absolute;
|
||
left: 0;
|
||
top: 0;
|
||
right: 0;
|
||
bottom: 0;
|
||
background: rgba(15, 23, 42, 0.6);
|
||
backdrop-filter: blur(2px);
|
||
}
|
||
.fc-modal-card {
|
||
position: relative;
|
||
background: #ffffff;
|
||
border-radius: 16px;
|
||
width: 660px;
|
||
max-width: 95%;
|
||
box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
|
||
padding: 18px 22px 20px;
|
||
z-index: 2000;
|
||
animation: fcModalZoom 0.2s ease-out;
|
||
}
|
||
.fc-modal-header {
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
padding-bottom: 12px;
|
||
border-bottom: 1px solid #f1f5f9;
|
||
margin-bottom: 16px;
|
||
}
|
||
.fc-modal-title {
|
||
font-size: 16px;
|
||
font-weight: 700;
|
||
color: #0f172a;
|
||
}
|
||
.fc-modal-close {
|
||
width: 28px;
|
||
height: 28px;
|
||
border-radius: 50%;
|
||
background: #f1f5f9;
|
||
color: #64748b;
|
||
display: inline-flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
border: none;
|
||
font-size: 16px;
|
||
}
|
||
.fc-modal-grid-box {
|
||
max-height: 360px;
|
||
overflow-y: auto;
|
||
padding: 2px 4px 6px;
|
||
}
|
||
.fc-modal-grid {
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
gap: 12px;
|
||
}
|
||
.fc-icon-chip {
|
||
flex: 0 0 calc(16.666% - 10px);
|
||
height: 72px;
|
||
background: #f8fafc;
|
||
border: 1px solid #e2e8f0;
|
||
border-radius: 12px;
|
||
overflow: hidden;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
cursor: pointer;
|
||
transition: all 0.15s ease;
|
||
}
|
||
.fc-icon-chip:hover {
|
||
border-color: #00E070;
|
||
background: #f0fdf4;
|
||
transform: translateY(-2px);
|
||
}
|
||
.fc-icon-chip.active {
|
||
border-color: #00E070;
|
||
background: #e6fbf1;
|
||
box-shadow: 0 0 0 2px #00E070;
|
||
}
|
||
.fc-icon-chip img {
|
||
width: 100%;
|
||
height: 100%;
|
||
object-fit: cover;
|
||
}
|
||
@keyframes fcModalZoom {
|
||
from { opacity: 0; transform: scale(0.95); }
|
||
to { opacity: 1; transform: scale(1); }
|
||
}
|
||
</style>
|
||
|
||
<form id="add-form" class="form-horizontal fc-form-container" role="form" data-toggle="validator" method="POST" action="">
|
||
<div class="row">
|
||
<div class="col-xs-12 col-sm-8">
|
||
<!-- 区块一:归属与类型 -->
|
||
<div class="fc-section">
|
||
<div class="fc-section-title">
|
||
<span class="fc-sec-icon"><i class="fa fa-sitemap"></i></span> 归属与类型
|
||
<span class="fc-sec-tip">决定发布页展示哪些字段</span>
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:14px;">
|
||
<label class="control-label col-xs-12 col-sm-3">上级分类:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
{:build_select('row[pid]', $parentList, 0, ['class'=>'form-control selectpicker', 'id'=>'c-pid', 'data-rule'=>'required'])}
|
||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">选「顶级分类」创建一级大类;选「蔬菜」「水果」则创建其下属二级品类。</span>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:10px;">
|
||
<label class="control-label col-xs-12 col-sm-3">分类类型:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<div class="fc-kind-seg">
|
||
<label>
|
||
<input type="radio" name="row[kind]" value="farm" checked>
|
||
<span class="fc-pill farm"><b><i class="fa fa-leaf"></i> 农产品</b><small>发布时需填写种植面积、采摘时间、量产</small></span>
|
||
</label>
|
||
<label>
|
||
<input type="radio" name="row[kind]" value="general">
|
||
<span class="fc-pill general"><b><i class="fa fa-briefcase"></i> 通用信息</b><small>招聘求职等,无产地字段</small></span>
|
||
</label>
|
||
</div>
|
||
<span class="help-block text-muted" style="margin-top:8px;margin-bottom:0;font-size:11px;">二级分类自动跟随上级分类的类型,无需单独设置。</span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 区块二:基本信息 -->
|
||
<div class="fc-section">
|
||
<div class="fc-section-title">
|
||
<span class="fc-sec-icon"><i class="fa fa-pencil-square-o"></i></span> 基本信息
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:14px;">
|
||
<label class="control-label col-xs-12 col-sm-3">分类名称:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" placeholder="例如:蔬菜、水果 或 花菜、白菜、紫甘蓝" value="">
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:14px;">
|
||
<label class="control-label col-xs-12 col-sm-3">实拍图:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<div class="fc-current-icon-box">
|
||
<div class="fc-current-icon-info">
|
||
<img id="current-icon-img" src="/static/categories/cat-veg.png?v=2" alt="当前图片">
|
||
</div>
|
||
<div class="fc-icon-actions">
|
||
<button type="button" class="btn btn-success fc-btn-main" id="btn-open-icon-picker">
|
||
<i class="fa fa-th-large"></i> 挑选果蔬实拍图
|
||
</button>
|
||
<button type="button" id="faupload-icon_key" class="btn btn-default faupload" data-input-id="c-icon_key" data-mimetype="image/gif,image/jpeg,image/png,image/jpg,image/svg+xml" data-maxsize="500KB" data-multiple="false">
|
||
<i class="fa fa-upload text-primary"></i> 上传实拍图
|
||
</button>
|
||
</div>
|
||
</div>
|
||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">优先上传真实农产品照片,农民用户靠「看图识物」选择品类;建议 500×500 以上方形图,单张不超过 <b class="text-danger">500KB</b>,过大的图片会拖慢小程序加载。</span>
|
||
<input type="hidden" name="row[icon_key]" id="c-icon_key" value="cat-veg">
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<!-- 区块三:视觉与排序 -->
|
||
<div class="fc-section">
|
||
<div class="fc-section-title">
|
||
<span class="fc-sec-icon"><i class="fa fa-paint-brush"></i></span> 视觉与排序
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:14px;">
|
||
<label class="control-label col-xs-12 col-sm-3">主题色:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<div class="fc-color-row">
|
||
<input id="c-color" data-rule="required" class="form-control" name="row[color]" type="text" value="#00E070" placeholder="例如:#00E070">
|
||
<input type="color" id="c-color-native" class="fc-color-native" value="#00E070" title="点选颜色">
|
||
<span class="fc-color-preview" id="color-preview-addon" style="background:#00E070;"></span>
|
||
</div>
|
||
<div class="fc-color-presets">
|
||
<span style="font-size:11px;color:#64748b;">推荐:</span>
|
||
<div class="fc-color-dot" style="background:#00E070;" title="春绿(品牌主色)" data-color="#00E070"></div>
|
||
<div class="fc-color-dot" style="background:#F5A623;" title="阳光金" data-color="#F5A623"></div>
|
||
<div class="fc-color-dot" style="background:#FF7A59;" title="活力橙" data-color="#FF7A59"></div>
|
||
<div class="fc-color-dot" style="background:#2ECC71;" title="翠青绿" data-color="#2ECC71"></div>
|
||
<div class="fc-color-dot" style="background:#3498DB;" title="晴空蓝" data-color="#3498DB"></div>
|
||
<div class="fc-color-dot" style="background:#9B59B6;" title="典雅紫" data-color="#9B59B6"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:14px;">
|
||
<label class="control-label col-xs-12 col-sm-3">排序权重:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<input id="c-sort" data-rule="required" class="form-control" name="row[sort]" type="number" value="10">
|
||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">数值越小越靠前,决定小程序端的排列次序。</span>
|
||
</div>
|
||
</div>
|
||
<div class="form-group" style="margin-bottom:10px;">
|
||
<label class="control-label col-xs-12 col-sm-3">启用状态:</label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<input id="c-enabled" name="row[enabled]" type="hidden" value="1">
|
||
<a href="javascript:;" data-toggle="switcher" class="btn-switcher" data-input-id="c-enabled" data-yes="1" data-no="0">
|
||
<i class="fa fa-toggle-on text-success fa-2x"></i>
|
||
</a>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<input id="c-post_count" name="row[post_count]" type="hidden" value="0">
|
||
</div>
|
||
|
||
<!-- 右侧:小程序端实时预览 -->
|
||
<div class="col-xs-12 col-sm-4 hidden-xs">
|
||
<div class="fc-preview-box">
|
||
<div class="fc-preview-title">
|
||
<i class="fa fa-mobile fa-lg"></i> 小程序端 · 实时预览
|
||
</div>
|
||
<div class="fc-preview-badge" id="preview-badge" style="background: rgba(0, 224, 112, 0.15); border: 1px solid rgba(0, 224, 112, 0.35);">
|
||
<img id="preview-icon" src="/static/categories/cat-veg.png?v=2" alt="分类图片">
|
||
</div>
|
||
<div class="fc-preview-name" id="preview-name">未命名分类</div>
|
||
<div class="fc-preview-note">修改名称 / 实拍图 / 主题色时<br>此预览会同步更新</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="form-group layer-footer" style="margin-top:10px;padding-top:14px;border-top:1px solid #eef2f6;">
|
||
<label class="control-label col-xs-12 col-sm-3"></label>
|
||
<div class="col-xs-12 col-sm-9">
|
||
<button type="submit" class="btn btn-success btn-embossed disabled fc-btn-main"><i class="fa fa-check"></i> 确认保存分类</button>
|
||
<button type="reset" class="btn btn-default btn-embossed" style="margin-left:10px;">重置</button>
|
||
</div>
|
||
</div>
|
||
</form>
|
||
|
||
<!-- 插画选择面板(默认完全隐藏,只有主动点击按钮才唤起) -->
|
||
<div class="fc-icon-modal-wrap" id="fc-icon-modal" style="display:none !important;">
|
||
<div class="fc-modal-overlay"></div>
|
||
<div class="fc-modal-card">
|
||
<div class="fc-modal-header">
|
||
<div class="fc-modal-title">
|
||
<i class="fa fa-th-large text-success"></i> 选择分类实拍图
|
||
</div>
|
||
<button type="button" class="fc-modal-close" id="btn-close-icon-modal">×</button>
|
||
</div>
|
||
|
||
<div class="fc-modal-grid-box">
|
||
<div class="fc-modal-grid">
|
||
<div class="fc-icon-chip" data-key="cat-veg" title="新鲜蔬菜"><img src="/static/categories/cat-veg.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="cat-fruit" title="时令水果"><img src="/static/categories/cat-fruit.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-cauliflower" title="花菜"><img src="/static/categories/veg-cauliflower.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-cabbage" title="白菜"><img src="/static/categories/veg-cabbage.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-purple-cabbage" title="紫甘蓝"><img src="/static/categories/veg-purple-cabbage.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-green-cabbage" title="青甘蓝"><img src="/static/categories/veg-green-cabbage.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-greens" title="青菜"><img src="/static/categories/veg-greens.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-radish" title="萝卜"><img src="/static/categories/veg-radish.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-chili" title="辣椒"><img src="/static/categories/veg-chili.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="veg-tomato" title="西红柿"><img src="/static/categories/veg-tomato.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-apple" title="苹果"><img src="/static/categories/fruit-apple.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-orange" title="柑橘"><img src="/static/categories/fruit-orange.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-kiwi" title="猕猴桃"><img src="/static/categories/fruit-kiwi.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-strawberry" title="草莓"><img src="/static/categories/fruit-strawberry.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-watermelon" title="西瓜"><img src="/static/categories/fruit-watermelon.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-grape" title="葡萄"><img src="/static/categories/fruit-grape.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-peach" title="蜜桃"><img src="/static/categories/fruit-peach.png?v=2" alt="icon"></div>
|
||
<div class="fc-icon-chip" data-key="fruit-passion" title="百香果"><img src="/static/categories/fruit-passion.png?v=2" alt="icon"></div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|