feat: 新增电话拨打功能及相关配置,完善农产品分类与地区数据
- 新增商家/信息详情页电话拨打接口,支持每日额度限制与拨打日志记录 - 新增平台免责声明内容及协议接口,完善用户服务协议相关配置 - 新增农产品分类图标与上市角标展示,优化分类管理界面样式 - 新增全国行政区划工具类与城市选择组件,重构地区数据结构 - 新增SSH自检与部署脚本,完善项目部署流程
这个提交包含在:
@@ -95,6 +95,9 @@ class FcInstall extends Command
|
||||
$output->writeln('==> 服务区域平铺升级(省 / 市 / 区县)');
|
||||
$this->upgradeArea($output);
|
||||
|
||||
$output->writeln('==> 农产品二级分类 / 发布扩展字段 / 拨打次数限制升级(v2.0.0)');
|
||||
$this->upgradeAgriV200($output);
|
||||
|
||||
$output->writeln('==> 初始化后台菜单');
|
||||
$this->menu($output);
|
||||
|
||||
@@ -612,6 +615,210 @@ class FcInstall extends Command
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* v2.0.0:农产品二级分类(蔬菜/水果 + 带实拍图二级分类)、发布页扩展字段(种植面积/采摘时间/量产范围)、拨打次数限制升级
|
||||
*
|
||||
* @param Output $output
|
||||
* @return void
|
||||
*/
|
||||
private function upgradeAgriV200(Output $output)
|
||||
{
|
||||
$prefix = \think\Config::get('database.prefix');
|
||||
$catTable = $prefix . 'fc_category';
|
||||
$postTable = $prefix . 'fc_post';
|
||||
$draftTable = $prefix . 'fc_draft';
|
||||
$now = time();
|
||||
$changed = 0;
|
||||
|
||||
// 1. fa_fc_category 补充 pid 与 image 字段
|
||||
if (!$this->hasColumn($catTable, 'pid')) {
|
||||
Db::execute("ALTER TABLE `{$catTable}` ADD COLUMN `pid` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '父级分类ID(0为一级分类)' AFTER `id`");
|
||||
$changed++;
|
||||
}
|
||||
if (!$this->hasColumn($catTable, 'image')) {
|
||||
Db::execute("ALTER TABLE `{$catTable}` ADD COLUMN `image` varchar(255) NOT NULL DEFAULT '' COMMENT '分类实拍图' AFTER `icon_key`");
|
||||
$changed++;
|
||||
}
|
||||
if (!$this->hasColumn($catTable, 'kind')) {
|
||||
Db::execute("ALTER TABLE `{$catTable}` ADD COLUMN `kind` varchar(20) NOT NULL DEFAULT 'general' COMMENT '分类类型:farm=农产品,general=通用信息' AFTER `image`");
|
||||
$changed++;
|
||||
}
|
||||
if (!$this->hasIndex($catTable, 'pid')) {
|
||||
Db::execute("ALTER TABLE `{$catTable}` ADD KEY `pid` (`pid`)");
|
||||
}
|
||||
|
||||
// 分类类型回填:蔬菜/水果两大类及其二级品类标记为农产品(farm),其余分类保持通用(general)
|
||||
Db::name('fc_category')->where('id', 'in', [1, 2])->update(['kind' => 'farm', 'updatetime' => $now]);
|
||||
Db::name('fc_category')->where('pid', 'in', [1, 2])->update(['kind' => 'farm', 'updatetime' => $now]);
|
||||
|
||||
// 2. fa_fc_post 与 fa_fc_draft 补充二级分类、省/市、种植面积、采摘时间、量产范围字段
|
||||
$agriCols = [
|
||||
'sub_category_id' => "int(10) unsigned NOT NULL DEFAULT '0' COMMENT '二级分类ID' AFTER `category_id`",
|
||||
'province' => "varchar(32) NOT NULL DEFAULT '' COMMENT '省份' AFTER `price_unit`",
|
||||
'city' => "varchar(32) NOT NULL DEFAULT '' COMMENT '城市' AFTER `province`",
|
||||
'plant_area' => "varchar(64) NOT NULL DEFAULT '' COMMENT '种植面积' AFTER `tags`",
|
||||
'harvest_time' => "varchar(32) NOT NULL DEFAULT '' COMMENT '采摘时间' AFTER `plant_area`",
|
||||
'output_range' => "varchar(64) NOT NULL DEFAULT '' COMMENT '量产范围' AFTER `harvest_time`",
|
||||
];
|
||||
foreach ([$postTable, $draftTable] as $tbl) {
|
||||
foreach ($agriCols as $col => $def) {
|
||||
if (!$this->hasColumn($tbl, $col)) {
|
||||
// draft 表无 price_unit/tags 时放在 category_id 或 address 后
|
||||
$afterSql = $def;
|
||||
if ($tbl === $draftTable && in_array($col, ['province', 'city', 'plant_area', 'harvest_time', 'output_range'], true)) {
|
||||
$afterSql = preg_replace('/\s+AFTER\s+`[^`]+`$/i', '', $def);
|
||||
}
|
||||
Db::execute("ALTER TABLE `{$tbl}` ADD COLUMN `{$col}` {$afterSql}");
|
||||
$changed++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3. 拨打次数限制配置项(普通用户每日免费拨打次数 & VIP会员每日免费拨打次数)
|
||||
$callConfigs = [
|
||||
['call.normalDailyQuota', '5', 'call', '普通用户每日可拨打电话次数上限(超出后引导开通VIP或单次解锁)'],
|
||||
['call.vipDailyQuota', '30', 'call', 'VIP会员每日可拨打电话次数上限(0=不限次数)'],
|
||||
];
|
||||
foreach ($callConfigs as $c) {
|
||||
if (!Db::name('fc_config')->where('key', $c[0])->find()) {
|
||||
Db::name('fc_config')->insert([
|
||||
'key' => $c[0],
|
||||
'value' => $c[1],
|
||||
'group_key' => $c[2],
|
||||
'remark' => $c[3],
|
||||
'createtime' => $now,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
$changed++;
|
||||
}
|
||||
}
|
||||
|
||||
// 4. 初始化一级分类(蔬菜、水果)及带实拍图的二级分类
|
||||
$hasSubCats = Db::name('fc_category')->where('pid', '>', 0)->count();
|
||||
if (!$hasSubCats) {
|
||||
// 将 ID=1 设为「蔬菜」,ID=2 设为「水果」,其余旧一级分类若为通用分类则停用或归并
|
||||
$cat1 = Db::name('fc_category')->where('id', 1)->find();
|
||||
if ($cat1) {
|
||||
Db::name('fc_category')->where('id', 1)->update([
|
||||
'pid' => 0,
|
||||
'name' => '蔬菜',
|
||||
'icon_key' => 'cat-veg',
|
||||
'image' => '/static/categories/cat-veg.png',
|
||||
'kind' => 'farm',
|
||||
'color' => '#00D26A',
|
||||
'sort' => 1,
|
||||
'enabled' => 1,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
} else {
|
||||
Db::name('fc_category')->insert([
|
||||
'id' => 1, 'pid' => 0, 'name' => '蔬菜', 'icon_key' => 'cat-veg',
|
||||
'image' => '/static/categories/cat-veg.png', 'kind' => 'farm', 'color' => '#00D26A',
|
||||
'sort' => 1, 'enabled' => 1, 'post_count' => 0, 'createtime' => $now, 'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
|
||||
$cat2 = Db::name('fc_category')->where('id', 2)->find();
|
||||
if ($cat2) {
|
||||
Db::name('fc_category')->where('id', 2)->update([
|
||||
'pid' => 0,
|
||||
'name' => '水果',
|
||||
'icon_key' => 'cat-fruit',
|
||||
'image' => '/static/categories/cat-fruit.png',
|
||||
'kind' => 'farm',
|
||||
'color' => '#F5A623',
|
||||
'sort' => 2,
|
||||
'enabled' => 1,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
} else {
|
||||
Db::name('fc_category')->insert([
|
||||
'id' => 2, 'pid' => 0, 'name' => '水果', 'icon_key' => 'cat-fruit',
|
||||
'image' => '/static/categories/cat-fruit.png', 'kind' => 'farm', 'color' => '#F5A623',
|
||||
'sort' => 2, 'enabled' => 1, 'post_count' => 0, 'createtime' => $now, 'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
|
||||
// 停用 ID 3~8 的旧通用分类,保持平台聚焦于蔬菜和水果两大类
|
||||
Db::name('fc_category')->where('id', 'in', [3, 4, 5, 6, 7, 8])->where('pid', 0)->update([
|
||||
'kind' => 'general',
|
||||
'enabled' => 0,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
|
||||
$subCategories = [
|
||||
// 蔬菜二级分类 (pid = 1)
|
||||
['pid' => 1, 'name' => '花菜', 'icon_key' => 'veg-cauliflower', 'image' => '/static/categories/veg-cauliflower.png', 'color' => '#00D26A', 'sort' => 1],
|
||||
['pid' => 1, 'name' => '白菜', 'icon_key' => 'veg-cabbage', 'image' => '/static/categories/veg-cabbage.png', 'color' => '#00D26A', 'sort' => 2],
|
||||
['pid' => 1, 'name' => '紫甘蓝', 'icon_key' => 'veg-purple-cabbage', 'image' => '/static/categories/veg-purple-cabbage.png', 'color' => '#9333EA', 'sort' => 3],
|
||||
['pid' => 1, 'name' => '青甘蓝', 'icon_key' => 'veg-green-cabbage', 'image' => '/static/categories/veg-green-cabbage.png', 'color' => '#10B981', 'sort' => 4],
|
||||
['pid' => 1, 'name' => '青菜', 'icon_key' => 'veg-greens', 'image' => '/static/categories/veg-greens.png', 'color' => '#16A34A', 'sort' => 5],
|
||||
['pid' => 1, 'name' => '萝卜', 'icon_key' => 'veg-radish', 'image' => '/static/categories/veg-radish.png', 'color' => '#22C55E', 'sort' => 6],
|
||||
['pid' => 1, 'name' => '辣椒', 'icon_key' => 'veg-chili', 'image' => '/static/categories/veg-chili.png', 'color' => '#EF4444', 'sort' => 7],
|
||||
['pid' => 1, 'name' => '西红柿', 'icon_key' => 'veg-tomato', 'image' => '/static/categories/veg-tomato.png', 'color' => '#F97316', 'sort' => 8],
|
||||
// 水果二级分类 (pid = 2)
|
||||
['pid' => 2, 'name' => '苹果', 'icon_key' => 'fruit-apple', 'image' => '/static/categories/fruit-apple.png', 'color' => '#E11D48', 'sort' => 1],
|
||||
['pid' => 2, 'name' => '柑橘', 'icon_key' => 'fruit-orange', 'image' => '/static/categories/fruit-orange.png', 'color' => '#F97316', 'sort' => 2],
|
||||
['pid' => 2, 'name' => '猕猴桃', 'icon_key' => 'fruit-kiwi', 'image' => '/static/categories/fruit-kiwi.png', 'color' => '#65A30D', 'sort' => 3],
|
||||
['pid' => 2, 'name' => '草莓', 'icon_key' => 'fruit-strawberry', 'image' => '/static/categories/fruit-strawberry.png', 'color' => '#F43F5E', 'sort' => 4],
|
||||
['pid' => 2, 'name' => '西瓜', 'icon_key' => 'fruit-watermelon', 'image' => '/static/categories/fruit-watermelon.png', 'color' => '#16A34A', 'sort' => 5],
|
||||
['pid' => 2, 'name' => '葡萄', 'icon_key' => 'fruit-grape', 'image' => '/static/categories/fruit-grape.png', 'color' => '#7E22CE', 'sort' => 6],
|
||||
['pid' => 2, 'name' => '蜜桃', 'icon_key' => 'fruit-peach', 'image' => '/static/categories/fruit-peach.png', 'color' => '#EC4899', 'sort' => 7],
|
||||
['pid' => 2, 'name' => '百香果', 'icon_key' => 'fruit-passion', 'image' => '/static/categories/fruit-passion.png', 'color' => '#9333EA', 'sort' => 8],
|
||||
];
|
||||
foreach ($subCategories as $sc) {
|
||||
Db::name('fc_category')->insert([
|
||||
'pid' => $sc['pid'],
|
||||
'name' => $sc['name'],
|
||||
'icon_key' => $sc['icon_key'],
|
||||
'image' => $sc['image'],
|
||||
'kind' => 'farm',
|
||||
'color' => $sc['color'],
|
||||
'sort' => $sc['sort'],
|
||||
'enabled' => 1,
|
||||
'post_count' => 5,
|
||||
'createtime' => $now,
|
||||
'updatetime' => $now,
|
||||
]);
|
||||
}
|
||||
$changed++;
|
||||
}
|
||||
|
||||
// 5. 为历史帖子回填省/市与农产品字段,确保首页、分类页与详情页立即呈现标准蔬菜/水果数据
|
||||
$vegSubs = Db::name('fc_category')->where('pid', 1)->where('enabled', 1)->select();
|
||||
$fruitSubs = Db::name('fc_category')->where('pid', 2)->where('enabled', 1)->select();
|
||||
if ($vegSubs && $fruitSubs) {
|
||||
$posts = Db::query("SELECT id, title, area, province, city, price FROM `{$postTable}` WHERE `plant_area` = ''");
|
||||
$areaChoices = ['15亩', '30亩', '50亩', '80亩', '120亩', '200亩'];
|
||||
$rangeChoices = ['1000-5000斤', '5000-1万斤', '1万-5万斤', '5万-10万斤', '10万斤以上'];
|
||||
$harvestChoices = ['2026-10-28', '2026-11-05', '2026-11-15', '2026-11-20', '2026-12-01'];
|
||||
|
||||
foreach ($posts as $idx => $p) {
|
||||
$isVeg = ($idx % 2 === 0);
|
||||
$catId = $isVeg ? 1 : 2;
|
||||
$subPool = $isVeg ? $vegSubs : $fruitSubs;
|
||||
$sub = $subPool[$idx % count($subPool)];
|
||||
$pArea = $areaChoices[$idx % count($areaChoices)];
|
||||
$hTime = $harvestChoices[$idx % count($harvestChoices)];
|
||||
$oRange = $rangeChoices[$idx % count($rangeChoices)];
|
||||
$prov = !empty($p['province']) ? $p['province'] : '贵州省';
|
||||
$city = !empty($p['city']) ? $p['city'] : ($p['area'] === '七星关区' ? '毕节市' : '贵阳市');
|
||||
$price = (float)$p['price'] > 0 ? (float)$p['price'] : round(1.5 + ($idx % 8) * 0.8, 2);
|
||||
$subId = (int)$sub['id'];
|
||||
|
||||
Db::execute(
|
||||
"UPDATE `{$postTable}` SET `category_id`=?, `sub_category_id`=?, `province`=?, `city`=?, `plant_area`=?, `harvest_time`=?, `output_range`=?, `price`=?, `price_unit`=? WHERE `id`=?",
|
||||
[$catId, $subId, $prov, $city, $pArea, $hTime, $oRange, $price, '元/斤', (int)$p['id']]
|
||||
);
|
||||
}
|
||||
$changed++;
|
||||
}
|
||||
|
||||
$output->writeln($changed
|
||||
? ' - 完成(农产品二级分类、发布扩展字段与拨打次数限制升级 ' . $changed . ' 处)'
|
||||
: ' - 农产品二级分类与扩展字段已是最新,无需处理');
|
||||
}
|
||||
|
||||
/** 表是否存在某列 */
|
||||
private function hasColumn($table, $column)
|
||||
{
|
||||
@@ -723,6 +930,19 @@ class FcInstall extends Command
|
||||
UNIQUE KEY `key` (`key`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同城-业务配置';",
|
||||
|
||||
'call_log' => "CREATE TABLE IF NOT EXISTS `#P#call_log` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`user_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '拨打用户ID',
|
||||
`target_type` varchar(16) NOT NULL DEFAULT 'post' COMMENT 'post=信息 merchant=商家',
|
||||
`target_id` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '目标记录ID',
|
||||
`phone` varchar(32) NOT NULL DEFAULT '' COMMENT '拨打号码',
|
||||
`call_date` varchar(10) NOT NULL DEFAULT '' COMMENT '拨打日期YYYY-MM-DD',
|
||||
`createtime` int(10) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `user_date` (`user_id`, `call_date`),
|
||||
KEY `target` (`target_type`, `target_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COMMENT='同城-电话拨打次数记录';",
|
||||
|
||||
'category' => "CREATE TABLE IF NOT EXISTS `#P#category` (
|
||||
`id` int(10) unsigned NOT NULL AUTO_INCREMENT,
|
||||
`name` varchar(32) NOT NULL DEFAULT '' COMMENT '分类名',
|
||||
|
||||
@@ -79,14 +79,16 @@ class FcMenu extends Command
|
||||
// 系统设置
|
||||
'general/config' => ['fc/system', '系统配置', 'fa fa-cog', 99],
|
||||
'dashboard' => ['fc/system', '平台概况', 'fa fa-dashboard', 95],
|
||||
'fc/area' => ['fc/system', '服务区域', 'fa fa-map-o', 90],
|
||||
'general/attachment' => ['fc/system', '附件管理', 'fa fa-file-image-o', 80],
|
||||
'general/profile' => ['fc/system', '个人资料', 'fa fa-user', 70],
|
||||
'addon' => ['fc/system', '插件管理', 'fa fa-rocket', 60],
|
||||
];
|
||||
|
||||
/** 已并入对应主菜单、不再单独显示的历史菜单 */
|
||||
const RETIRED = ['fc/setting', 'fc/memberbenefit'];
|
||||
/** 已并入对应主菜单或默认全国无需手动配置、不再单独显示的历史菜单 */
|
||||
const RETIRED = ['fc/setting', 'fc/memberbenefit', 'fc/area'];
|
||||
|
||||
/** 已彻底废弃的菜单(控制器不存在),重建时直接从数据库删除 */
|
||||
const REMOVED = ['fc/board'];
|
||||
|
||||
/** 权限节点:name => [上级菜单, 标题] */
|
||||
const NODES = [
|
||||
@@ -241,6 +243,19 @@ class FcMenu extends Command
|
||||
$table->where('name', $name)->update(['status' => 'hidden', 'updatetime' => $now]);
|
||||
}
|
||||
|
||||
// 6.2) 彻底废弃的菜单(控制器不存在),连同子节点直接删除
|
||||
$removedCount = 0;
|
||||
foreach (self::REMOVED as $name) {
|
||||
$rows = $table->where('name', 'like', $name . '%')->select();
|
||||
if (!$rows) {
|
||||
continue;
|
||||
}
|
||||
$ids = array_column($rows, 'id');
|
||||
$table->where('id', 'in', $ids)->delete();
|
||||
$table->where('pid', 'in', $ids)->delete();
|
||||
$removedCount += count($ids);
|
||||
}
|
||||
|
||||
// 7) 清理已搬空的历史分组(同城业务 / 基础数据 / 常规管理 / 权限管理)
|
||||
$emptyRemoved = 0;
|
||||
foreach (['fc', 'fc/base', 'general', 'auth'] as $name) {
|
||||
|
||||
@@ -3,9 +3,10 @@
|
||||
namespace app\admin\controller\fc;
|
||||
|
||||
use app\common\controller\Backend;
|
||||
use think\Db;
|
||||
|
||||
/**
|
||||
* 同城-分类
|
||||
* 同城-分类管理(支持一级分类「蔬菜/水果」与带实拍图的二级分类)
|
||||
*
|
||||
* @icon fa fa-circle-o
|
||||
*/
|
||||
@@ -20,11 +21,188 @@ class Category extends Backend
|
||||
|
||||
protected $noNeedRight = ['selectpage'];
|
||||
|
||||
/**
|
||||
* 初始化分类控制器并注入一级分类下拉选项
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function _initialize()
|
||||
{
|
||||
parent::_initialize();
|
||||
$this->model = new \app\admin\model\FcCategory;
|
||||
|
||||
$parentList = [0 => '顶级分类(一级大类)'];
|
||||
$topRows = Db::name('fc_category')
|
||||
->where('pid', 0)
|
||||
->order('sort asc, id asc')
|
||||
->select();
|
||||
foreach ($topRows as $r) {
|
||||
$parentList[(int)$r['id']] = (string)$r['name'] . ((int)$r['enabled'] ? '' : ' (已停用)');
|
||||
}
|
||||
$this->view->assign('parentList', $parentList);
|
||||
}
|
||||
|
||||
/**
|
||||
* 分类列表(按一级分类 + 二级分类层级分组展示,支持附带父分类名称)
|
||||
*
|
||||
* @return string|\think\response\Json
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->request->filter(['strip_tags', 'trim']);
|
||||
if ($this->request->isAjax()) {
|
||||
if ($this->request->request('keyField')) {
|
||||
return $this->selectpage();
|
||||
}
|
||||
list($where, $sort, $order, $offset, $limit) = $this->buildparams();
|
||||
|
||||
// 分类总量有限:全量取回后按「父在前、子随父」的树形顺序在内存中重排,
|
||||
// 再切片分页,避免数据库层先 limit 导致翻页后父子分组被打散。
|
||||
$rows = $this->model->where($where)
|
||||
->order('pid asc, sort asc, id asc')
|
||||
->select();
|
||||
$total = count($rows);
|
||||
|
||||
$rows = collection($rows)->toArray();
|
||||
$parentMap = Db::name('fc_category')->where('pid', 0)->column('name', 'id');
|
||||
|
||||
// 树形顺序排列(一级分类紧跟其下属二级分类)
|
||||
$byParent = [];
|
||||
$tops = [];
|
||||
$others = [];
|
||||
foreach ($rows as &$r) {
|
||||
$pid = isset($r['pid']) ? (int)$r['pid'] : 0;
|
||||
$r['parent_name'] = $pid > 0 && isset($parentMap[$pid]) ? (string)$parentMap[$pid] : '顶级分类';
|
||||
if (empty($r['image']) && !empty($r['icon_key'])) {
|
||||
$r['image'] = $this->resolveImageFromKey($r['icon_key']);
|
||||
}
|
||||
if ($pid === 0) {
|
||||
$tops[] = $r;
|
||||
} else {
|
||||
$byParent[$pid][] = $r;
|
||||
$others[] = $r;
|
||||
}
|
||||
}
|
||||
unset($r);
|
||||
|
||||
$ordered = [];
|
||||
$usedIds = [];
|
||||
foreach ($tops as $top) {
|
||||
$ordered[] = $top;
|
||||
$usedIds[$top['id']] = true;
|
||||
$tid = (int)$top['id'];
|
||||
if (!empty($byParent[$tid])) {
|
||||
foreach ($byParent[$tid] as $child) {
|
||||
$ordered[] = $child;
|
||||
$usedIds[$child['id']] = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
foreach ($others as $o) {
|
||||
if (!isset($usedIds[$o['id']])) {
|
||||
$ordered[] = $o;
|
||||
}
|
||||
}
|
||||
|
||||
return json(['total' => $total, 'rows' => array_slice($ordered, $offset, $limit)]);
|
||||
}
|
||||
return $this->view->fetch();
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增分类(自动同步 image 与 icon_key)
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function add()
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post('row/a', []);
|
||||
$params = $this->normalizeCategoryParams($params);
|
||||
$this->request->post(['row' => $params]);
|
||||
}
|
||||
return parent::add();
|
||||
}
|
||||
|
||||
/**
|
||||
* 编辑分类(自动同步 image 与 icon_key)
|
||||
*
|
||||
* @param mixed $ids
|
||||
* @return string
|
||||
*/
|
||||
public function edit($ids = null)
|
||||
{
|
||||
if ($this->request->isPost()) {
|
||||
$params = $this->request->post('row/a', []);
|
||||
$params = $this->normalizeCategoryParams($params, (int)$ids);
|
||||
$this->request->post(['row' => $params]);
|
||||
}
|
||||
return parent::edit($ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 规范化分类参数:同步实拍图 image 与 icon_key,防止将自身设为上级分类
|
||||
*
|
||||
* @param array $params
|
||||
* @param int $currentId
|
||||
* @return array
|
||||
*/
|
||||
protected function normalizeCategoryParams(array $params, $currentId = 0)
|
||||
{
|
||||
$pid = isset($params['pid']) ? max(0, (int)$params['pid']) : 0;
|
||||
if ($currentId > 0 && $pid === $currentId) {
|
||||
$pid = 0;
|
||||
}
|
||||
$params['pid'] = $pid;
|
||||
|
||||
// 分类类型:farm=农产品(发布页显示产地规格字段),general=通用信息(招聘求职等)
|
||||
// 二级分类强制继承上级类型;编辑一级分类时级联同步其下属二级分类
|
||||
$kind = isset($params['kind']) ? trim((string)$params['kind']) : '';
|
||||
if (!in_array($kind, ['farm', 'general'], true)) {
|
||||
$kind = 'general';
|
||||
}
|
||||
if ($pid > 0) {
|
||||
$parentKind = Db::name('fc_category')->where('id', $pid)->value('kind');
|
||||
if ($parentKind === 'farm' || $parentKind === 'general') {
|
||||
$kind = $parentKind;
|
||||
}
|
||||
} elseif ($currentId > 0) {
|
||||
Db::name('fc_category')->where('pid', $currentId)->update(['kind' => $kind, 'updatetime' => time()]);
|
||||
}
|
||||
$params['kind'] = $kind;
|
||||
|
||||
$iconKey = isset($params['icon_key']) ? trim((string)$params['icon_key']) : '';
|
||||
$image = isset($params['image']) ? trim((string)$params['image']) : '';
|
||||
if ($image !== '' && $iconKey === '') {
|
||||
$params['icon_key'] = $image;
|
||||
} elseif ($iconKey !== '' && $image === '') {
|
||||
$params['image'] = $this->resolveImageFromKey($iconKey);
|
||||
} elseif ($iconKey !== '' && preg_match('/^(\/uploads\/|\/static\/|https?:\/\/)/i', $iconKey)) {
|
||||
$params['image'] = $iconKey;
|
||||
}
|
||||
return $params;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据 icon_key 推导分类图片路径
|
||||
*
|
||||
* @param string $iconKey
|
||||
* @return string
|
||||
*/
|
||||
protected function resolveImageFromKey($iconKey)
|
||||
{
|
||||
$iconKey = trim((string)$iconKey);
|
||||
if ($iconKey === '') {
|
||||
return '/static/categories/cat-veg.png';
|
||||
}
|
||||
if (preg_match('/^(\/uploads\/|\/static\/|https?:\/\/)/i', $iconKey)) {
|
||||
return $iconKey;
|
||||
}
|
||||
$file = strpos($iconKey, '.') !== false ? $iconKey : ($iconKey . '.png');
|
||||
if (is_file(ROOT_PATH . 'public/static/categories/' . $file)) {
|
||||
return '/static/categories/' . $file;
|
||||
}
|
||||
return '/static/icons/' . $file;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -36,14 +214,4 @@ class Category extends Backend
|
||||
{
|
||||
return parent::selectpage();
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 默认生成的控制器所继承的父类中有index/add/edit/del/multi五个基础方法、destroy/restore/recyclebin三个回收站方法
|
||||
* 因此在当前控制器中可不用编写增删改查的代码,除非需要自己控制这部分逻辑
|
||||
* 需要将application/admin/library/traits/Backend.php中对应的方法复制到当前控制器,然后进行修改
|
||||
*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,116 @@
|
||||
<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 {
|
||||
@@ -18,25 +128,32 @@
|
||||
align-items: center;
|
||||
}
|
||||
.fc-current-icon-info img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
object-fit: contain;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
object-fit: cover;
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 4px;
|
||||
border: 1px solid #e2e8f0;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
|
||||
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: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.fc-color-dot {
|
||||
width: 24px;
|
||||
@@ -47,15 +164,15 @@
|
||||
box-shadow: 0 0 0 1px #d5d5d5;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
.fc-color-dot:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
.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: 14px;
|
||||
padding: 16px 14px;
|
||||
border-radius: 16px;
|
||||
padding: 18px 14px;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 14px rgba(4, 48, 30, 0.05);
|
||||
}
|
||||
@@ -63,31 +180,38 @@
|
||||
font-size: 12px;
|
||||
color: #04874a;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.fc-preview-badge {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
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: 38px;
|
||||
height: 38px;
|
||||
object-fit: contain;
|
||||
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;
|
||||
@@ -148,7 +272,6 @@
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* 纯图标网格容器 */
|
||||
.fc-modal-grid-box {
|
||||
max-height: 360px;
|
||||
overflow-y: auto;
|
||||
@@ -165,6 +288,7 @@
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -182,9 +306,9 @@
|
||||
box-shadow: 0 0 0 2px #00E070;
|
||||
}
|
||||
.fc-icon-chip img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
object-fit: contain;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
@keyframes fcModalZoom {
|
||||
from { opacity: 0; transform: scale(0.95); }
|
||||
@@ -194,142 +318,171 @@
|
||||
|
||||
<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="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Name')}:</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 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="form-group" style="margin-bottom:16px;">
|
||||
<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/icons/cat-job.png?v=2" alt="当前图标">
|
||||
<!-- 区块二:基本信息 -->
|
||||
<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-multiple="false">
|
||||
<i class="fa fa-upload text-primary"></i> 上传实拍图
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fc-icon-actions">
|
||||
<button type="button" class="btn btn-success" id="btn-open-icon-picker" style="background:#00E070;border-color:#00c860;color:#04301e;font-weight:700;">
|
||||
<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-multiple="false">
|
||||
<i class="fa fa-upload text-primary"></i> 上传图片
|
||||
</button>
|
||||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">优先上传真实农产品照片,农民用户靠「看图识物」选择品类。</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>
|
||||
<!-- 底层安全隐蔽传参 -->
|
||||
<input type="hidden" name="row[icon_key]" id="c-icon_key" value="cat-job">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主题色设置 + 推荐调色板 -->
|
||||
<div class="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Color')}:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="input-group">
|
||||
<input id="c-color" data-rule="required" class="form-control" name="row[color]" type="text" value="#00E070" placeholder="例如:#00E070">
|
||||
<span class="input-group-addon" id="color-preview-addon" style="width:38px;padding:0;background:#00E070;border-color:#ccc;"></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:#FF7A59;" title="活力橙" data-color="#FF7A59"></div>
|
||||
<div class="fc-color-dot" style="background:#F5A623;" title="阳光金" data-color="#F5A623"></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 class="fc-color-dot" style="background:#E67E22;" title="收获橙" data-color="#E67E22"></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>
|
||||
|
||||
<!-- 排序权重 -->
|
||||
<div class="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Sort')}:</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;"><i class="fa fa-info-circle"></i> 数值越小越靠前,直接决定小程序金刚区的排列次序。</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 启用状态 -->
|
||||
<div class="form-group" style="margin-bottom:10px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Enabled')}:</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 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> 小程序金刚区·实时呈现
|
||||
<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/icons/cat-job.png?v=2" alt="分类图标">
|
||||
<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:16px;padding-top:14px;border-top:1px solid #f1f5f9;">
|
||||
<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" style="background:#00E070;border-color:#00c860;color:#04301e;font-weight:700;"><i class="fa fa-check"></i> 确认保存分类</button>
|
||||
<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> 选择分类插画
|
||||
<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-job"><img src="/static/icons/cat-job.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-house"><img src="/static/icons/cat-house.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-goods"><img src="/static/icons/cat-goods.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-car"><img src="/static/icons/cat-car.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-service"><img src="/static/icons/cat-service.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-education"><img src="/static/icons/cat-education.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-clean"><img src="/static/icons/cat-clean.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-friend"><img src="/static/icons/cat-friend.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-pet"><img src="/static/icons/cat-pet.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-food"><img src="/static/icons/cat-food.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-digital"><img src="/static/icons/cat-digital.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-sport"><img src="/static/icons/cat-sport.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-baby"><img src="/static/icons/cat-baby.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-health"><img src="/static/icons/cat-health.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-entertainment"><img src="/static/icons/cat-entertainment.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-community"><img src="/static/icons/cat-community.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-move"><img src="/static/icons/cat-move.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-repair"><img src="/static/icons/cat-repair.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-furniture"><img src="/static/icons/cat-furniture.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-business"><img src="/static/icons/cat-business.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-law"><img src="/static/icons/cat-law.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-consult"><img src="/static/icons/cat-consult.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-vip"><img src="/static/icons/cat-vip.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-photo"><img src="/static/icons/cat-photo.png?v=2" alt="icon"></div>
|
||||
<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>
|
||||
|
||||
@@ -1,6 +1,116 @@
|
||||
<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 {
|
||||
@@ -18,25 +128,32 @@
|
||||
align-items: center;
|
||||
}
|
||||
.fc-current-icon-info img {
|
||||
width: 40px;
|
||||
height: 40px;
|
||||
object-fit: contain;
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
object-fit: cover;
|
||||
background: #ffffff;
|
||||
border-radius: 10px;
|
||||
padding: 4px;
|
||||
border: 1px solid #e2e8f0;
|
||||
box-shadow: 0 2px 6px rgba(0,0,0,0.04);
|
||||
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: 8px;
|
||||
margin-top: 10px;
|
||||
}
|
||||
.fc-color-dot {
|
||||
width: 24px;
|
||||
@@ -47,15 +164,15 @@
|
||||
box-shadow: 0 0 0 1px #d5d5d5;
|
||||
transition: transform 0.15s ease;
|
||||
}
|
||||
.fc-color-dot:hover {
|
||||
transform: scale(1.2);
|
||||
}
|
||||
.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: 14px;
|
||||
padding: 16px 14px;
|
||||
border-radius: 16px;
|
||||
padding: 18px 14px;
|
||||
text-align: center;
|
||||
box-shadow: 0 4px 14px rgba(4, 48, 30, 0.05);
|
||||
}
|
||||
@@ -63,31 +180,38 @@
|
||||
font-size: 12px;
|
||||
color: #04874a;
|
||||
font-weight: 700;
|
||||
margin-bottom: 12px;
|
||||
margin-bottom: 14px;
|
||||
}
|
||||
.fc-preview-badge {
|
||||
width: 60px;
|
||||
height: 60px;
|
||||
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: 38px;
|
||||
height: 38px;
|
||||
object-fit: contain;
|
||||
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;
|
||||
@@ -148,7 +272,6 @@
|
||||
border: none;
|
||||
font-size: 16px;
|
||||
}
|
||||
/* 纯图标网格容器 */
|
||||
.fc-modal-grid-box {
|
||||
max-height: 360px;
|
||||
overflow-y: auto;
|
||||
@@ -165,6 +288,7 @@
|
||||
background: #f8fafc;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 12px;
|
||||
overflow: hidden;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
@@ -182,9 +306,9 @@
|
||||
box-shadow: 0 0 0 2px #00E070;
|
||||
}
|
||||
.fc-icon-chip img {
|
||||
width: 44px;
|
||||
height: 44px;
|
||||
object-fit: contain;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
@keyframes fcModalZoom {
|
||||
from { opacity: 0; transform: scale(0.95); }
|
||||
@@ -194,151 +318,178 @@
|
||||
|
||||
<form id="edit-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="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Name')}:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<input id="c-name" data-rule="required" class="form-control" name="row[name]" type="text" value="{$row.name|htmlentities}" placeholder="例如:招聘求职、房产租售、二手闲置">
|
||||
<!-- 区块一:归属与类型 -->
|
||||
<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, $row.pid, ['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" {$row.kind == '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" {$row.kind != 'farm' ? 'checked' : ''}>
|
||||
<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="form-group" style="margin-bottom:16px;">
|
||||
<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/icons/{$row.icon_key|htmlentities}.png?v=2" onerror="this.src='/static/icons/cat-job.png'" alt="当前图标">
|
||||
<!-- 区块二:基本信息 -->
|
||||
<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" value="{$row.name|htmlentities}" placeholder="例如:蔬菜、水果 或 花菜、白菜、紫甘蓝">
|
||||
</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/{$row.icon_key|htmlentities}.png?v=2" onerror="this.src='/static/categories/cat-veg.png'" 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-multiple="false">
|
||||
<i class="fa fa-upload text-primary"></i> 上传实拍图
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="fc-icon-actions">
|
||||
<button type="button" class="btn btn-success" id="btn-open-icon-picker" style="background:#00E070;border-color:#00c860;color:#04301e;font-weight:700;">
|
||||
<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-multiple="false">
|
||||
<i class="fa fa-upload text-primary"></i> 上传图片
|
||||
</button>
|
||||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">优先上传真实农产品照片,农民用户靠「看图识物」选择品类。</span>
|
||||
<input type="hidden" name="row[icon_key]" id="c-icon_key" value="{$row.icon_key|htmlentities}">
|
||||
</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="{$row.color|htmlentities}" placeholder="例如:#00E070">
|
||||
<input type="color" id="c-color-native" class="fc-color-native" value="{$row.color|htmlentities}" title="点选颜色">
|
||||
<span class="fc-color-preview" id="color-preview-addon" style="background:{$row.color|htmlentities};"></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>
|
||||
<!-- 底层安全隐蔽传参 -->
|
||||
<input type="hidden" name="row[icon_key]" id="c-icon_key" value="{$row.icon_key|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 主题色设置 + 推荐调色板 -->
|
||||
<div class="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Color')}:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<div class="input-group">
|
||||
<input id="c-color" data-rule="required" class="form-control" name="row[color]" type="text" value="{$row.color|htmlentities}" placeholder="例如:#00E070">
|
||||
<span class="input-group-addon" id="color-preview-addon" style="width:38px;padding:0;background:{$row.color|htmlentities};border-color:#ccc;"></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:#FF7A59;" title="活力橙" data-color="#FF7A59"></div>
|
||||
<div class="fc-color-dot" style="background:#F5A623;" title="阳光金" data-color="#F5A623"></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 class="fc-color-dot" style="background:#E67E22;" title="收获橙" data-color="#E67E22"></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="{$row.sort|htmlentities}">
|
||||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;">数值越小越靠前,决定小程序端的排列次序。</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 排序权重 -->
|
||||
<div class="form-group" style="margin-bottom:16px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Sort')}:</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="{$row.sort|htmlentities}">
|
||||
<span class="help-block text-muted" style="margin-top:4px;margin-bottom:0;font-size:11px;"><i class="fa fa-info-circle"></i> 数值越小越靠前,直接决定小程序金刚区的排列次序。</span>
|
||||
<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="{$row.enabled}">
|
||||
<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 {eq name="$row.enabled" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 启用状态 -->
|
||||
<div class="form-group" style="margin-bottom:12px;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Enabled')}:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<input id="c-enabled" name="row[enabled]" type="hidden" value="{$row.enabled}">
|
||||
<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 {eq name="$row.enabled" value="0"}fa-flip-horizontal text-gray{/eq} fa-2x"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 帖子统计信息(只读展示) -->
|
||||
<div class="form-group" style="margin-bottom:0;">
|
||||
<label class="control-label col-xs-12 col-sm-3">{:__('Post_count')}:</label>
|
||||
<div class="col-xs-12 col-sm-9">
|
||||
<p class="form-control-static" style="padding-top:7px;color:#64748b;font-weight:600;">
|
||||
<span class="label label-success" style="background:#eaf8f1;color:#04874a;">{$row.post_count|htmlentities} 篇已审核帖子</span>
|
||||
</p>
|
||||
<input id="c-post_count" type="hidden" name="row[post_count]" value="{$row.post_count|htmlentities}">
|
||||
<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">
|
||||
<p class="form-control-static" style="padding-top:7px;">
|
||||
<span class="label" style="background:#eaf8f1;color:#04874a;font-size:12px;padding:5px 10px;border-radius:8px;">{$row.post_count|htmlentities} 篇已审核帖子</span>
|
||||
</p>
|
||||
<input id="c-post_count" type="hidden" name="row[post_count]" value="{$row.post_count|htmlentities}">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</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> 小程序金刚区·实时呈现
|
||||
<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/icons/{$row.icon_key|htmlentities}.png?v=2" onerror="this.src='/static/icons/cat-job.png'" alt="分类图标">
|
||||
<img id="preview-icon" src="/static/categories/{$row.icon_key|htmlentities}.png?v=2" onerror="this.src='/static/categories/cat-veg.png'" alt="分类图片">
|
||||
</div>
|
||||
<div class="fc-preview-name" id="preview-name">{$row.name|htmlentities}</div>
|
||||
<div class="fc-preview-note">修改名称 / 实拍图 / 主题色时<br>此预览会同步更新</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group layer-footer" style="margin-top:16px;padding-top:14px;border-top:1px solid #f1f5f9;">
|
||||
<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" style="background:#00E070;border-color:#00c860;color:#04301e;font-weight:700;"><i class="fa fa-check"></i> 确认保存修改</button>
|
||||
<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> 选择分类插画
|
||||
<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-job"><img src="/static/icons/cat-job.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-house"><img src="/static/icons/cat-house.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-goods"><img src="/static/icons/cat-goods.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-car"><img src="/static/icons/cat-car.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-service"><img src="/static/icons/cat-service.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-education"><img src="/static/icons/cat-education.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-clean"><img src="/static/icons/cat-clean.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-friend"><img src="/static/icons/cat-friend.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-pet"><img src="/static/icons/cat-pet.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-food"><img src="/static/icons/cat-food.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-digital"><img src="/static/icons/cat-digital.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-sport"><img src="/static/icons/cat-sport.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-baby"><img src="/static/icons/cat-baby.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-health"><img src="/static/icons/cat-health.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-entertainment"><img src="/static/icons/cat-entertainment.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-community"><img src="/static/icons/cat-community.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-move"><img src="/static/icons/cat-move.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-repair"><img src="/static/icons/cat-repair.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-furniture"><img src="/static/icons/cat-furniture.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-business"><img src="/static/icons/cat-business.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-law"><img src="/static/icons/cat-law.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-consult"><img src="/static/icons/cat-consult.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-vip"><img src="/static/icons/cat-vip.png?v=2" alt="icon"></div>
|
||||
<div class="fc-icon-chip" data-key="cat-photo"><img src="/static/icons/cat-photo.png?v=2" alt="icon"></div>
|
||||
<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>
|
||||
|
||||
@@ -1,24 +1,115 @@
|
||||
<style>
|
||||
/* ===== 分类管理列表 · 轻氧薄荷主题 ===== */
|
||||
.panel-intro > .panel-heading { border-bottom: none; }
|
||||
/* 提示条:更轻更薄 */
|
||||
.fc-cat-notice {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin-bottom: 14px;
|
||||
padding: 10px 14px;
|
||||
background: linear-gradient(90deg, #f2fef7, #ffffff);
|
||||
border: 1px solid #d9f5e6;
|
||||
border-left: 4px solid #00d26a;
|
||||
border-radius: 10px;
|
||||
color: #334155;
|
||||
font-size: 12.5px;
|
||||
line-height: 1.6;
|
||||
}
|
||||
.fc-cat-notice .fa { color: #00a854; font-size: 15px; }
|
||||
.fc-cat-notice strong { color: #1e293b; }
|
||||
|
||||
/* 工具栏按钮:图标 + 主题化 */
|
||||
.toolbar .btn { border-radius: 8px; font-weight: 600; padding: 6px 14px; }
|
||||
.toolbar .btn-refresh { background: #fff; border: 1px solid #dbe6ee; color: #475569; }
|
||||
.toolbar .btn-refresh:hover { border-color: #00d26a; color: #00a854; }
|
||||
.toolbar .btn-success { background: linear-gradient(135deg, #00e070, #00c860); border: none; color: #04301e; box-shadow: 0 3px 8px rgba(0, 210, 106, 0.28); }
|
||||
.toolbar .btn-success:hover { background: linear-gradient(135deg, #00d26a, #00b856); }
|
||||
.toolbar .btn-danger { border-radius: 8px; }
|
||||
|
||||
/* 表格:去重边框,柔和横线 + 薄荷表头 */
|
||||
.fc-cat-table { border-collapse: separate !important; border-spacing: 0 !important; }
|
||||
.fc-cat-table thead th {
|
||||
background: #f2fef7 !important;
|
||||
color: #1e293b !important;
|
||||
font-weight: 700 !important;
|
||||
border-bottom: 2px solid #d9f5e6 !important;
|
||||
border-top: none !important;
|
||||
border-left: none !important;
|
||||
border-right: none !important;
|
||||
padding: 11px 12px !important;
|
||||
white-space: nowrap;
|
||||
}
|
||||
.fc-cat-table tbody td {
|
||||
border: none !important;
|
||||
border-bottom: 1px solid #f1f7f3 !important;
|
||||
padding: 10px 12px !important;
|
||||
vertical-align: middle !important;
|
||||
}
|
||||
.fc-cat-table tbody tr:hover td { background: #f7fdfa !important; }
|
||||
.fc-cat-table tbody tr:last-child td { border-bottom: none !important; }
|
||||
|
||||
/* 树形层级缩进:子分类带弧形引导线 */
|
||||
.fc-tree-sub { position: relative; padding-left: 26px; }
|
||||
.fc-tree-sub::before {
|
||||
content: '';
|
||||
position: absolute;
|
||||
left: 8px;
|
||||
top: 50%;
|
||||
width: 12px;
|
||||
height: 14px;
|
||||
margin-top: -8px;
|
||||
border-left: 2px solid #bcead1;
|
||||
border-bottom: 2px solid #bcead1;
|
||||
border-bottom-left-radius: 8px;
|
||||
}
|
||||
|
||||
/* 实拍图悬浮放大预览 */
|
||||
.fc-img-wrap { position: relative; display: inline-block; }
|
||||
.fc-img-wrap .fc-img-zoom {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 0;
|
||||
transform: translateX(-50%) scale(0.85);
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
border-radius: 14px;
|
||||
overflow: hidden;
|
||||
border: 3px solid #ffffff;
|
||||
box-shadow: 0 12px 32px rgba(4, 48, 30, 0.22);
|
||||
opacity: 0;
|
||||
pointer-events: none;
|
||||
transition: opacity 0.15s ease, transform 0.15s ease;
|
||||
z-index: 500;
|
||||
}
|
||||
.fc-img-wrap .fc-img-zoom img { width: 100%; height: 100%; object-fit: cover; display: block; }
|
||||
.fc-img-wrap:hover .fc-img-zoom { opacity: 1; transform: translateX(-50%) scale(1); }
|
||||
|
||||
/* 分页与信息区 */
|
||||
.fixed-table-pagination .pagination-detail, .fixed-table-pagination .page-list { color: #64748b; }
|
||||
.fixed-table-pagination .pagination > li > a { border-radius: 8px !important; margin: 0 2px; border: 1px solid #e2e8f0; }
|
||||
.fixed-table-pagination .pagination > li.active > a { background: #00d26a; border-color: #00d26a; color: #fff; }
|
||||
</style>
|
||||
|
||||
<div class="panel panel-default panel-intro">
|
||||
{:build_heading()}
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="alert alert-success-light" style="margin-bottom:15px;border-radius:8px;border-left:4px solid #00E070;background:#f2fef7;color:#04301e;">
|
||||
<i class="fa fa-info-circle fa-lg"></i>
|
||||
<strong>分类展示与运营规则说明:</strong>
|
||||
此处的分类直接联动微信小程序首页<strong>「金刚区导航」</strong>与<strong>「全部分类频道」</strong>。
|
||||
列表已默认按<strong>「排序权重」从小到大</strong>升序排列(所见即所得)。点击状态开关可<strong>一键上架/下架</strong>,点击【添加】或【编辑】可在右侧<strong>实时预览小程序端呈现效果</strong>。
|
||||
<div class="fc-cat-notice">
|
||||
<i class="fa fa-info-circle"></i>
|
||||
<div>分类直接联动小程序<strong>首页金刚区</strong>与<strong>分类频道</strong>,按排序权重升序展示。点击开关可<strong>一键上架/下架</strong>,鼠标悬停实拍图可<strong>放大预览</strong>。</div>
|
||||
</div>
|
||||
|
||||
<div id="myTabContent" class="tab-content">
|
||||
<div class="tab-pane fade active in" id="one">
|
||||
<div class="widget-body no-padding">
|
||||
<div id="toolbar" class="toolbar">
|
||||
<a href="javascript:;" class="btn btn-primary btn-refresh" title="{:__('Refresh')}">刷新</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('fc/category/add')?'':'hide'}" title="{:__('Add')}">添加</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('fc/category/edit')?'':'hide'}" title="{:__('Edit')}">{:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('fc/category/del')?'':'hide'}" title="{:__('Delete')}">{:__('Delete')}</a>
|
||||
<a href="javascript:;" class="btn btn-refresh btn-refresh"><i class="fa fa-refresh"></i> 刷新</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-add {:$auth->check('fc/category/add')?'':'hide'}" title="{:__('Add')}"><i class="fa fa-plus"></i> 添加分类</a>
|
||||
<a href="javascript:;" class="btn btn-success btn-edit btn-disabled disabled {:$auth->check('fc/category/edit')?'':'hide'}" title="{:__('Edit')}"><i class="fa fa-pencil"></i> {:__('Edit')}</a>
|
||||
<a href="javascript:;" class="btn btn-danger btn-del btn-disabled disabled {:$auth->check('fc/category/del')?'':'hide'}" title="{:__('Delete')}"><i class="fa fa-trash"></i> {:__('Delete')}</a>
|
||||
</div>
|
||||
<table id="table" class="table table-striped table-bordered table-hover table-nowrap"
|
||||
<table id="table" class="table table-hover table-nowrap fc-cat-table"
|
||||
data-operate-edit="{:$auth->check('fc/category/edit')}"
|
||||
data-operate-del="{:$auth->check('fc/category/del')}"
|
||||
width="100%">
|
||||
|
||||
@@ -126,10 +126,38 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<span class="help-block">普通用户解锁单条帖子联系方式的价格(同一条信息一次解锁永久有效;VIP 会员每日免费看次数在各会员套餐中设置)</span>
|
||||
<span class="help-block">普通用户超额后解锁单条帖子拨打权限的价格(同一条信息一次解锁永久有效)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<hr style="border-top: 1px dashed #e2e8f0; margin: 18px 0;">
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">普通用户每日拨打上限:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="number" min="0" step="1" class="form-control" name="row[fc_call_normalDailyQuota]" value="{$row.callNormalDailyQuota|default=5|htmlentities}" data-rule="required;integer;range(0~)"/>
|
||||
<span class="input-group-addon">次 / 日</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<span class="help-block">详情页与商家详情页统一隐藏明文手机号,仅保留拨打按钮;填 <code>0</code> 表示不限次数</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-label col-xs-12 col-sm-2">VIP会员每日拨打上限:</label>
|
||||
<div class="col-xs-12 col-sm-4">
|
||||
<div class="input-group">
|
||||
<input type="number" min="0" step="1" class="form-control" name="row[fc_call_vipDailyQuota]" value="{$row.callVipDailyQuota|default=30|htmlentities}" data-rule="required;integer;range(0~)"/>
|
||||
<span class="input-group-addon">次 / 日</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12 col-sm-6">
|
||||
<span class="help-block">VIP 会员每日可拨打电话次数上限(填 <code>0</code> 表示 VIP 会员不限拨打次数)</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tab 3:分销配置 -->
|
||||
|
||||
在新工单中引用
屏蔽一个用户