feat: 重构后台管理界面样式并新增商户/帖子审核功能

- 重构后台所有管理页面工具栏,移除图标改用纯文字按钮
- 新增商户管理的批量审核功能与商家详情/审核页面
- 新增帖子管理的批量审核/上下架功能与帖子详情/审核页面
- 新增多媒体相册字段的前后台处理逻辑
- 新增微信订阅消息兼容导出层
- 更新站点版本号并优化品牌色变量
- 新增商户/帖子控制器的详情与审核方法
- 新增 .sql 文件忽略规则
这个提交包含在:
2026-10-23 09:26:22 +08:00
父节点 cb12bf5fc8
当前提交 3a2fcf7142
共有 44 个文件被更改,包括 3080 次插入 和 917 次删除

查看文件

@@ -663,3 +663,538 @@ body.inside-header .content {
transition: none !important;
}
}
/* ==========================================================================
FC 模块现代标准模态表单(Modal Form)与审核质检组件样式
遵循 ui-ux-pro-max 设计系统:双列卡片布局、清晰呼吸感、消除多选灰色轰炸
========================================================================== */
/* ---------- 弹窗主体容器 ---------- */
.fc-modal-form {
padding: 12px 18px 70px;
background: #F8FAFC;
}
/* ---------- 表单区块卡片 (Section Card) ---------- */
.fc-form-section {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 8px;
margin-bottom: 16px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
overflow: hidden;
transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.fc-form-section:hover {
border-color: #CBD5E1;
box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.06);
}
.fc-form-section__header {
display: flex;
align-items: center;
padding: 12px 16px;
background: #F8FAFC;
border-bottom: 1px solid #EDF2F7;
}
.fc-form-section__badge {
display: inline-flex;
align-items: center;
justify-content: center;
width: 22px;
height: 22px;
border-radius: 50%;
background: #2563EB;
color: #FFFFFF;
font-size: 12px;
font-weight: 700;
margin-right: 10px;
}
.fc-form-section__title {
font-size: 14px;
font-weight: 700;
color: #1E293B;
letter-spacing: 0.2px;
}
.fc-form-section__body {
padding: 16px 18px 4px;
}
.fc-form-section__body .form-group {
margin-bottom: 14px;
}
.fc-form-section__body .control-label {
color: #334155;
font-weight: 600;
font-size: 13px;
padding-top: 7px;
}
/* ---------- 弹窗底部操作条 (吸底保证) ---------- */
.fc-modal-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
padding: 12px 24px;
background: #FFFFFF;
border-top: 1px solid #E2E8F0;
box-shadow: 0 -2px 10px rgba(15, 23, 42, 0.05);
margin-bottom: 0 !important;
z-index: 100;
display: flex;
justify-content: flex-end;
align-items: center;
}
.fc-modal-footer .btn {
padding: 7px 20px;
font-size: 14px;
font-weight: 600;
border-radius: 6px;
margin-left: 10px;
}
/* ---------- 动态批量操作工具栏 (Contextual Batch Bar) ---------- */
.fc-batch-bar {
display: inline-flex;
align-items: center;
gap: 8px;
background: #EFF6FF;
border: 1px solid #BFDBFE;
padding: 4px 10px;
border-radius: 6px;
animation: fcBatchFadeIn 0.2s ease-out;
}
@keyframes fcBatchFadeIn {
from {
opacity: 0;
transform: translateY(-4px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.fc-batch-bar__tag {
font-size: 13px;
color: #1E40AF;
font-weight: 600;
margin-right: 6px;
}
/* ---------- 审核与质检弹窗多图画廊 (Gallery) ---------- */
.fc-inspect-gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
gap: 12px;
margin-top: 10px;
}
.fc-inspect-gallery__item {
position: relative;
display: block;
height: 110px;
border-radius: 6px;
overflow: hidden;
border: 1px solid #E2E8F0;
background: #F1F5F9;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fc-inspect-gallery__item:hover {
transform: translateY(-2px);
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.12);
}
.fc-inspect-gallery__item img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.fc-inspect-gallery__zoom {
position: absolute;
inset: 0;
background: rgba(15, 23, 42, 0.45);
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
opacity: 0;
font-size: 18px;
transition: opacity 0.2s ease;
}
.fc-inspect-gallery__item:hover .fc-inspect-gallery__zoom {
opacity: 1;
}
.fc-upload-preview {
margin-top: 10px;
}
.fc-upload-preview li {
margin-right: 10px;
margin-bottom: 10px;
}
.fc-upload-preview img {
border-radius: 4px;
border: 1px solid #E2E8F0;
}
/* ==========================================================================
专属【信息审核与质检工作台】样式(纯净只读核验模式,杜绝 input 框反模式)
========================================================================== */
.fc-audit-view {
padding: 18px 22px 90px;
background: #F8FAFC;
min-height: 100%;
}
/* ---------- 顶部送审人画像条 ---------- */
.fc-audit-user-bar {
display: flex;
align-items: center;
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 8px;
padding: 14px 18px;
margin-bottom: 14px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.fc-audit-user-bar__avatar {
width: 48px;
height: 48px;
border-radius: 50%;
object-fit: cover;
margin-right: 14px;
border: 2px solid #E2E8F0;
}
.fc-audit-user-bar__meta {
flex: 1;
}
.fc-audit-user-bar__name {
font-size: 16px;
font-weight: 700;
color: #0F172A;
display: flex;
align-items: center;
gap: 8px;
}
.fc-audit-user-bar__uid {
font-size: 12px;
color: #64748B;
background: #F1F5F9;
padding: 2px 8px;
border-radius: 12px;
font-weight: normal;
}
.fc-audit-user-bar__sub {
font-size: 12px;
color: #64748B;
margin-top: 4px;
}
.fc-audit-badge {
display: inline-flex;
align-items: center;
padding: 5px 12px;
border-radius: 20px;
font-size: 13px;
font-weight: 600;
}
.fc-audit-badge--warning {
background: #FEF3C7;
color: #B45309;
border: 1px solid #FDE68A;
}
.fc-audit-badge--success {
background: #DEF7EC;
color: #03543F;
border: 1px solid #BCF0DA;
}
.fc-audit-badge--danger {
background: #FDE8E8;
color: #9B1C1C;
border: 1px solid #FBD5D5;
}
.fc-audit-reject-alert {
background: #FFF1F2;
border: 1px solid #FECDD3;
color: #BE123C;
padding: 10px 16px;
border-radius: 6px;
margin-bottom: 14px;
font-size: 13px;
display: flex;
align-items: center;
gap: 8px;
}
/* ---------- 送审核心凭据卡片 ---------- */
.fc-audit-card {
background: #FFFFFF;
border: 1px solid #E2E8F0;
border-radius: 8px;
padding: 18px 20px;
margin-bottom: 14px;
box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
}
.fc-audit-card__head {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 10px;
}
.fc-audit-card__category {
font-size: 13px;
font-weight: 600;
color: #2563EB;
background: #EFF6FF;
padding: 3px 10px;
border-radius: 4px;
}
.fc-audit-card__price {
font-size: 20px;
font-weight: 700;
color: #EA580C;
letter-spacing: -0.5px;
}
.fc-audit-card__price small {
font-size: 12px;
color: #64748B;
font-weight: normal;
}
.fc-audit-card__title {
margin: 0 0 12px;
font-size: 18px;
font-weight: 700;
color: #0F172A;
line-height: 1.4;
}
.fc-audit-card__tags {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-bottom: 14px;
}
.fc-audit-tag {
font-size: 12px;
background: #F1F5F9;
color: #334155;
padding: 2px 10px;
border-radius: 4px;
border: 1px solid #E2E8F0;
}
.fc-audit-card__props {
display: flex;
flex-wrap: wrap;
gap: 16px;
padding: 10px 14px;
background: #F8FAFC;
border-radius: 6px;
font-size: 13px;
color: #475569;
margin-bottom: 14px;
}
.fc-audit-prop-item {
display: flex;
align-items: center;
gap: 6px;
}
.fc-audit-card__content-title {
font-size: 13px;
font-weight: 600;
color: #475569;
margin-bottom: 6px;
}
.fc-audit-card__content-box {
background: #F8FAFC;
border: 1px solid #EDF2F7;
border-left: 3px solid #2563EB;
border-radius: 6px;
padding: 14px 16px;
color: #334155;
line-height: 1.7;
font-size: 14px;
white-space: pre-wrap;
max-height: 240px;
overflow-y: auto;
}
/* ---------- 图片画廊质检区 ---------- */
.fc-audit-gallery {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
gap: 12px;
margin-top: 8px;
}
.fc-audit-gallery__card {
position: relative;
display: block;
height: 120px;
border-radius: 8px;
overflow: hidden;
border: 1px solid #E2E8F0;
background: #F1F5F9;
transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.fc-audit-gallery__card:hover {
transform: translateY(-2px);
box-shadow: 0 6px 12px rgba(15, 23, 42, 0.12);
}
.fc-audit-gallery__card img {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
.fc-audit-gallery__cover-tag {
position: absolute;
top: 6px;
left: 6px;
background: rgba(15, 23, 42, 0.75);
color: #FFFFFF;
font-size: 11px;
padding: 1px 6px;
border-radius: 3px;
}
.fc-audit-gallery__overlay {
position: absolute;
inset: 0;
background: rgba(15, 23, 42, 0.5);
color: #FFFFFF;
display: flex;
align-items: center;
justify-content: center;
font-size: 13px;
font-weight: 600;
gap: 4px;
opacity: 0;
transition: opacity 0.2s ease;
}
.fc-audit-gallery__card:hover .fc-audit-gallery__overlay {
opacity: 1;
}
.fc-audit-empty-media {
padding: 24px;
text-align: center;
color: #94A3B8;
background: #F8FAFC;
border: 1px dashed #E2E8F0;
border-radius: 6px;
font-size: 13px;
}
/* ---------- 底部审核决策吸底条 ---------- */
.fc-audit-footer {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: #FFFFFF;
border-top: 1px solid #E2E8F0;
box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
padding: 12px 24px;
z-index: 100;
display: flex;
align-items: center;
justify-content: space-between;
gap: 16px;
}
.fc-audit-footer__reason-box {
display: flex;
align-items: center;
gap: 12px;
flex: 1;
}
.fc-audit-footer__col-tpl {
width: 260px;
}
.fc-audit-footer__col-tpl label,
.fc-audit-footer__col-input label {
font-size: 11px;
color: #64748B;
margin-bottom: 2px;
display: block;
font-weight: 600;
}
.fc-audit-footer__col-input {
flex: 1;
}
.fc-audit-footer__btns {
display: flex;
align-items: center;
gap: 10px;
}
.fc-audit-footer__btns .btn {
padding: 8px 18px;
font-size: 14px;
font-weight: 700;
border-radius: 6px;
}
/* ---------- 列表纯两字按钮精致排版 ---------- */
.bootstrap-table .table > tbody > tr > td .btn-xs {
padding: 3px 8px;
font-size: 12px;
line-height: 1.4;
border-radius: 4px;
margin: 0 2px;
font-weight: 600;
letter-spacing: 0.5px;
}
.toolbar .btn {
font-size: 13px;
font-weight: 600;
border-radius: 6px;
padding: 6px 14px;
}

查看文件

@@ -10,131 +10,269 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
edit_url: 'fc/merchant/edit',
del_url: 'fc/merchant/del',
multi_url: 'fc/merchant/multi',
import_url: 'fc/merchant/import',
table: 'fc_merchant',
}
});
var table = $("#table");
var batchBar = $("#batch-bar");
var selectedCount = $("#selected-count");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
sortOrder: 'desc',
escape: false,
clickToSelect: false, // 禁用点击行任意位置自动勾选复选框,杜绝误触发多选
columns: [
[
{checkbox: true},
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
{field: 'user_id', title: '用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
return row.user_name || '-';
}},
{field: 'name', title: __('Name'), operate: 'LIKE'},
{field: 'id', title: '序号', operate: false, formatter: function (value, row, index) {
return '<span class="fc-serial">' + (index + 1) + '</span>';
}},
{field: 'logo', title: '门头Logo', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{
field: 'name', title: __('Name'), operate: 'LIKE',
events: {
'click .btn-view-merchant': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/merchant/detail?ids=' + row.id + '&mode=view', '详情', {area: ['820px', '85%']});
}
},
formatter: function (value, row) {
return '<a href="javascript:;" class="btn-view-merchant" style="color:#0F172A;font-weight:600;" title="详情">' + value + '</a>';
}
},
{field: 'user_id', title: '入驻用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'"},
{field: 'category', title: '所属行业', operate: 'LIKE'},
{field: 'contact', title: __('Contact'), operate: 'LIKE'},
{field: 'category', title: __('Category'), operate: 'LIKE'},
{field: 'license', title: '营业执照', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
{
field: 'audit_status', title: __('Audit_status'),
searchList: {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')},
formatter: Format.statusFormatter({0: __('待审核'), 1: __('已通过'), 2: __('已驳回')}, {0: 'warning', 1: 'success', 2: 'danger'})
},
{
field: 'shop_status', title: __('Shop_status'),
searchList: {normal: __('正常'), pending: __('待审核'), banned: __('已封禁')},
formatter: Format.statusFormatter({normal: __('正常'), pending: __('待审核'), banned: __('已封禁')}, {normal: 'success', pending: 'warning', banned: 'danger'})
field: 'shop_status', title: '营业状态',
searchList: {normal: __('正常营业'), closed: __('暂停歇业')},
formatter: function (value) {
return value === 'normal' ? '<span class="text-success">正常营业</span>' : '<span class="text-muted">暂停歇业</span>';
}
},
{field: 'license', title: __('License'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'violations', title: __('Violations')},
{field: 'post_count', title: __('Post_count')},
{field: 'audit_reason', title: __('Audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'logo', title: __('Logo'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content, visible: false},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime, visible: false},
{
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
formatter: Table.api.formatter.operate,
buttons: [
{
name: 'auditpass',
text: __('AuditPass'),
title: __('AuditPass'),
classname: 'btn btn-xs btn-success btn-click',
visible: function (row) {
return Number(row.audit_status) !== 1;
},
confirm: __('确认审核通过该商家?'),
click: function (options, row) {
field: 'recommend', title: '推荐位',
searchList: {0: __('否'), 1: __('是')},
formatter: Format.statusFormatter({0: __('否'), 1: __('已推荐')}, {0: 'default', 1: 'warning'})
},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{
field: 'operate', title: '操作', align: 'center', width: '130px',
events: {
'click .btn-audit-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/merchant/detail?ids=' + row.id + '&mode=audit', '审核', {area: ['820px', '85%']});
},
'click .btn-detail-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/merchant/detail?ids=' + row.id + '&mode=view', '详情', {area: ['820px', '85%']});
},
'click .btn-edit-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/merchant/edit?ids=' + row.id, '编辑', {area: ['820px', '85%']});
},
'click .btn-del-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Layer.confirm(__('Are you sure you want to delete this item?'), {title: __('Warning'), btn: ['确定', '取消']}, function (confirmIndex) {
Fast.api.ajax({
url: 'fc/merchant/audit',
data: {ids: row.id, auditStatus: 1}
url: 'fc/merchant/del',
data: {ids: row.id}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
table.bootstrapTable('refresh');
return false;
});
}
},
{
name: 'auditreject',
text: __('AuditReject'),
title: __('AuditReject'),
classname: 'btn btn-xs btn-danger btn-click',
visible: function (row) {
return Number(row.audit_status) !== 2;
},
click: function (options, row) {
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
Fast.api.ajax({
url: 'fc/merchant/audit',
data: {ids: row.id, auditStatus: 2, reason: value}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
return false;
});
Layer.close(index);
});
}
Layer.close(confirmIndex);
});
}
]
},
formatter: function (value, row) {
var isPending = Number(row.audit_status) === 0;
var actionBtn = isPending
? '<a href="javascript:;" class="btn btn-xs btn-success btn-audit-one" title="审核">审核</a> '
: '<a href="javascript:;" class="btn btn-xs btn-default btn-detail-one" title="详情">详情</a> ';
var editBtn = '<a href="javascript:;" class="btn btn-xs btn-default btn-edit-one" title="编辑">编辑</a> ';
var delBtn = '<a href="javascript:;" class="btn btn-xs btn-danger btn-del-one" title="删除">删除</a>';
return actionBtn + editBtn + delBtn;
}
}
]
]
});
// 为表格绑定事件
Table.api.bindevent(table);
// 审核通过
/**
* 联动动态批量操作栏
*/
function updateBatchBar() {
var selectedIds = Table.api.selectedids(table);
if (selectedIds.length > 0) {
selectedCount.text(selectedIds.length);
batchBar.removeClass('hide').show();
} else {
batchBar.addClass('hide').hide();
}
}
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table', function () {
updateBatchBar();
});
// 双击行直接打开资质核验或详情
table.on('dbl-click-row.bs.table', function (e, row) {
var isPending = Number(row.audit_status) === 0;
var mode = isPending ? 'audit' : 'view';
var title = isPending ? '审核' : '详情';
Fast.api.open('fc/merchant/detail?ids=' + row.id + '&mode=' + mode, title, {area: ['820px', '85%']});
});
$(document).on('click', '.btn-clear-selection', function () {
table.bootstrapTable('uncheckAll');
updateBatchBar();
});
// 批量审核通过
$(document).on('click', '.btn-audit-pass', function () {
var ids = Table.api.selectedids(table);
Layer.confirm(__('确认审核通过选中的商家?'), {icon: 3, title: __('提示')}, function (index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要批量操作的商家');
return;
}
Layer.confirm('确认批量审核通过选中的 ' + ids.length + ' 个商家入驻?', {title: '批量审核确认', btn: ['通过', '取消']}, function (index) {
Fast.api.ajax({
url: 'fc/merchant/audit',
data: {ids: ids.join(','), auditStatus: 1}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 审核驳回
// 批量审核驳回
$(document).on('click', '.btn-audit-reject', function () {
var ids = Table.api.selectedids(table);
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要批量操作的商家');
return;
}
Layer.prompt({title: '请输入批量驳回的原因(将通知给申请商户)', formType: 2}, function (value, index) {
if (!$.trim(value)) {
Toastr.error('驳回原因不可为空');
return;
}
Fast.api.ajax({
url: 'fc/merchant/audit',
data: {ids: ids.join(','), auditStatus: 2, reason: value}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 批量设为推荐
$(document).on('click', '.btn-merchant-batch-recommend', function () {
var ids = Table.api.selectedids(table);
if (ids.length === 0) {
Toastr.warning('请先勾选需要推荐的商家');
return;
}
Layer.confirm('确认批量将选中的 ' + ids.length + ' 个商家设为首页推荐?', {title: '推荐确认', btn: ['推荐', '取消']}, function (index) {
Fast.api.ajax({
url: 'fc/merchant/recommend',
data: {ids: ids.join(','), recommend: 1}
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
},
detail: function () {
var merchantId = Fast.api.query('ids') || Fast.api.query('id');
function submitAudit(status, reason) {
Fast.api.ajax({
url: 'fc/merchant/audit',
type: 'POST',
data: {
ids: merchantId,
auditStatus: status,
reason: reason || ''
}
}, function (data, ret) {
Toastr.success(ret.msg || '操作成功');
setTimeout(function () {
Fast.api.close();
if (parent.$ && parent.$('#table').length) {
parent.$('#table').bootstrapTable('refresh');
}
}, 400);
return false;
}, function (data, ret) {
Toastr.error(ret.msg || '操作失败');
return false;
});
}
// 点击通过:弹窗确认通过
$('#btn-pass').off('click').on('click', function () {
Layer.confirm('确认审核通过此商家的入驻申请吗?', {
title: '通过确认',
btn: ['通过', '取消']
}, function (index) {
Layer.close(index);
submitAudit(1, '');
});
});
// 点击驳回:弹窗确认输入驳回原因
$('#btn-reject').off('click').on('click', function () {
Layer.prompt({
title: '请输入驳回原因(将通知给申请商户)',
formType: 2,
value: ''
}, function (value, promptIndex) {
var reason = $.trim(value);
if (!reason) {
Toastr.warning('驳回原因不可为空');
return;
}
Layer.close(promptIndex);
submitAudit(2, reason);
});
});
// 点击关闭
$('#btn-close').off('click').on('click', function () {
Fast.api.close();
});
},
add: function () {
Controller.api.bindevent();
},
@@ -147,5 +285,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
}
}
};
return Controller;
});

查看文件

@@ -10,182 +10,126 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
edit_url: 'fc/post/edit',
del_url: 'fc/post/del',
multi_url: 'fc/post/multi',
import_url: 'fc/post/import',
table: 'fc_post',
}
});
var table = $("#table");
var batchBar = $("#batch-bar");
var selectedCount = $("#selected-count");
// 初始化表格
table.bootstrapTable({
url: $.fn.bootstrapTable.defaults.extend.index_url,
pk: 'id',
sortName: 'id',
fixedColumns: true,
fixedRightNumber: 1,
sortOrder: 'desc',
escape: false,
clickToSelect: false, // 禁用点击行任意位置自动勾选复选框,杜绝点击操作按钮误触发多选
columns: [
[
{checkbox: true},
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
{field: 'title', title: __('Title'), operate: 'LIKE'},
{field: 'category_id', title: '分类', addClass: 'selectpage', extend: "data-source='fc/category/index' data-field='name'", formatter: function (value, row) {
return row.category_name || '-';
}},
{field: 'price', title: __('Price'), operate: 'BETWEEN',
formatter: function (value) {
return (value === null || value === '' || value === undefined) ? '-' : '¥' + value;
{field: 'id', title: '序号', operate: false, formatter: function (value, row, index) {
return '<span class="fc-serial">' + (index + 1) + '</span>';
}},
{
field: 'cover', title: '封面', operate: false, align: 'center', width: '65px',
events: Table.api.events.image,
formatter: function (value, row) {
var img = value || (row.media && row.media.length > 0 ? (typeof row.media === 'string' && row.media.indexOf('[') === 0 ? JSON.parse(row.media)[0] : row.media.split(',')[0]) : '');
return img ? Table.api.formatter.image.call(this, img, row) : '<span class="text-muted" style="font-size:11px;">无图</span>';
}
},
{field: 'price_unit', title: __('Price_unit'), operate: 'LIKE'},
{field: 'area', title: __('Area'), operate: 'LIKE'},
{field: 'audit_status', title: __('Audit_status'),
{
field: 'title', title: __('Title'), operate: 'LIKE', align: 'left',
events: {
'click .btn-view-detail': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/post/detail?ids=' + row.id + '&mode=view', '详情', {area: ['850px', '85%']});
}
},
formatter: function (value, row) {
var topBadge = Number(row.is_top) === 1 ? '<span class="label label-warning" style="margin-right:4px;">置顶</span>' : '';
return topBadge + '<a href="javascript:;" class="btn-view-detail" style="color:#0F172A;font-weight:600;" title="详情">' + value + '</a>';
}
},
{
field: 'category_id', title: '分类', addClass: 'selectpage', extend: "data-source='fc/category/index' data-field='name'",
formatter: function (value, row) {
return row.category_name ? '<span class="label label-default" style="font-weight:normal;">' + row.category_name + '</span>' : '-';
}
},
{
field: 'price', title: __('Price'), operate: 'BETWEEN', align: 'right',
formatter: function (value, row) {
if (value === null || value === '' || value === undefined || Number(value) === 0) {
return '<span class="text-muted">面议/免费</span>';
}
return '<strong style="color:#EA580C;">¥' + value + '</strong>' + (row.price_unit ? ' <small class="text-muted">' + row.price_unit + '</small>' : '');
}
},
{field: 'area', title: __('Area'), operate: 'LIKE', formatter: function (value) { return value || '-'; }},
{
field: 'user_id', title: '发布用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'",
formatter: function (value, row) {
return row.user_name ? '<i class="fa fa-user-circle text-muted"></i> ' + row.user_name : '-';
}
},
{
field: 'audit_status', title: __('Audit_status'),
searchList: {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')},
formatter: Format.statusFormatter({0: __('待审核'), 1: __('已通过'), 2: __('已驳回')}, {0: 'warning', 1: 'success', 2: 'danger'})
},
{field: 'views', title: __('Views')},
{field: 'is_paid', title: __('Is_paid'),
searchList: {0: __('否'), 1: __('是')},
formatter: Format.statusFormatter({0: __('未付费'), 1: __('已付费')}, {0: 'default', 1: 'success'})
},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{field: 'content', title: __('Content'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'cover', title: __('Cover'), operate: 'LIKE'},
{field: 'media', title: __('Media'), visible: false},
{field: 'user_id', title: '发布用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
return row.user_name || '-';
}},
{field: 'address', title: __('Address'), operate: 'LIKE'},
{field: 'contact', title: __('Contact'), operate: 'LIKE'},
{field: 'phone', title: __('Phone'), operate: 'LIKE'},
{field: 'wechat', title: __('Wechat'), operate: 'LIKE'},
{field: 'tags', title: __('Tags'), operate: 'LIKE', formatter: Table.api.formatter.flag},
{field: 'amount', title: __('Amount'), operate: 'BETWEEN',
formatter: function (value) {
return (value === null || value === '' || value === undefined) ? '-' : '¥' + value;
}
},
{field: 'pay_type', title: __('Pay_type'),
searchList: {wxpay: __('微信支付'), balance: __('余额支付')},
formatter: function (value) {
var m = {wxpay: __('微信支付'), balance: __('余额支付')};
return m[value] !== undefined ? m[value] : '-';
}
},
{field: 'audit_reason', title: __('Audit_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
{field: 'likes', title: __('Likes')},
{field: 'comment_count', title: __('Comment_count')},
{field: 'status', title: __('Status'),
{
field: 'status', title: '上架状态',
searchList: {1: __('正常'), 0: __('已下架')},
formatter: Format.statusFormatter({1: __('正常'), 0: __('已下架')}, {1: 'success', 0: 'default'})
},
{field: 'is_top', title: __('Is_top'),
searchList: {0: __('否'), 1: __('是')},
formatter: Format.statusFormatter({0: __('未置顶'), 1: __('已置顶')}, {0: 'default', 1: 'warning'})
},
{field: 'distance', title: __('Distance')},
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime, visible: false},
{field: 'deletetime', title: __('Deletetime'), visible: false},
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
buttons: [
{
name: 'auditpass',
text: __('AuditPass'),
title: __('AuditPass'),
classname: 'btn btn-xs btn-success btn-click',
visible: function (row) {
return Number(row.audit_status) !== 1;
},
confirm: __('确认审核通过该信息?'),
click: function (options, row) {
Fast.api.ajax({
url: 'fc/post/audit',
data: {ids: row.id, auditStatus: 1}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
return false;
});
}
{field: 'views', title: __('Views'), sortable: true, operate: false},
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
{
field: 'operate', title: '操作', align: 'center', width: '130px',
events: {
'click .btn-audit-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/post/detail?ids=' + row.id + '&mode=audit', '审核', {area: ['850px', '85%']});
},
{
name: 'auditreject',
text: __('AuditReject'),
title: __('AuditReject'),
classname: 'btn btn-xs btn-danger btn-click',
visible: function (row) {
return Number(row.audit_status) !== 2;
},
click: function (options, row) {
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
Fast.api.ajax({
url: 'fc/post/audit',
data: {ids: row.id, auditStatus: 2, reason: value}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
return false;
});
Layer.close(index);
});
}
'click .btn-detail-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/post/detail?ids=' + row.id + '&mode=view', '详情', {area: ['850px', '85%']});
},
{
name: 'offline',
text: __('OfflinePost'),
title: __('OfflinePost'),
classname: 'btn btn-xs btn-warning btn-click',
visible: function (row) {
return Number(row.status) === 1;
},
confirm: __('确认下架该信息?'),
click: function (options, row) {
'click .btn-edit-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Fast.api.open('fc/post/edit?ids=' + row.id, '编辑', {area: ['850px', '85%']});
},
'click .btn-del-one': function (e, value, row, index) {
e.stopPropagation();
e.preventDefault();
Layer.confirm(__('Are you sure you want to delete this item?'), {title: __('Warning'), btn: ['确定', '取消']}, function (confirmIndex) {
Fast.api.ajax({
url: 'fc/post/offline',
url: 'fc/post/del',
data: {ids: row.id}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
table.bootstrapTable('refresh');
return false;
});
}
},
{
name: 'top',
text: __('TopPost'),
title: __('TopPost'),
classname: 'btn btn-xs btn-info btn-click',
visible: function (row) {
return Number(row.is_top) !== 1;
},
confirm: __('确认置顶该信息?'),
click: function (options, row) {
Fast.api.ajax({
url: 'fc/post/top',
data: {ids: row.id, isTop: 1}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
return false;
});
}
},
{
name: 'untop',
text: __('CancelTopPost'),
title: __('CancelTopPost'),
classname: 'btn btn-xs btn-default btn-click',
visible: function (row) {
return Number(row.is_top) === 1;
},
confirm: __('确认取消置顶该信息?'),
click: function (options, row) {
Fast.api.ajax({
url: 'fc/post/top',
data: {ids: row.id, isTop: 0}
}, function () {
$('#' + options.tableId).bootstrapTable('refresh');
return false;
});
}
Layer.close(confirmIndex);
});
}
]
},
formatter: function (value, row) {
var isPending = Number(row.audit_status) === 0;
var actionBtn = isPending
? '<a href="javascript:;" class="btn btn-xs btn-success btn-audit-one" title="审核">审核</a> '
: '<a href="javascript:;" class="btn btn-xs btn-default btn-detail-one" title="详情">详情</a> ';
var editBtn = '<a href="javascript:;" class="btn btn-xs btn-default btn-edit-one" title="编辑">编辑</a> ';
var delBtn = '<a href="javascript:;" class="btn btn-xs btn-danger btn-del-one" title="删除">删除</a>';
return actionBtn + editBtn + delBtn;
}
}
]
]
@@ -194,84 +138,192 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
// 为表格绑定事件
Table.api.bindevent(table);
// 审核通过
/**
* 联动动态批量操作工具栏(仅勾选多项时显示,杜绝界面臃肿)
*/
function updateBatchBar() {
var selectedIds = Table.api.selectedids(table);
if (selectedIds.length > 0) {
selectedCount.text(selectedIds.length);
batchBar.removeClass('hide').show();
} else {
batchBar.addClass('hide').hide();
}
}
table.on('check.bs.table uncheck.bs.table check-all.bs.table uncheck-all.bs.table load-success.bs.table', function () {
updateBatchBar();
});
// 双击行打开详情弹窗
table.on('dbl-click-row.bs.table', function (e, row) {
var isPending = Number(row.audit_status) === 0;
var mode = isPending ? 'audit' : 'view';
var title = isPending ? '审核' : '详情';
Fast.api.open('fc/post/detail?ids=' + row.id + '&mode=' + mode, title, {area: ['850px', '85%']});
});
// 清除多选选中状态
$(document).on('click', '.btn-clear-selection', function () {
table.bootstrapTable('uncheckAll');
updateBatchBar();
});
// 批量审核通过
$(document).on('click', '.btn-audit-pass', function () {
var ids = Table.api.selectedids(table);
Layer.confirm(__('确认审核通过选中的信息?'), {icon: 3, title: __('提示')}, function (index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要批量操作的信息');
return;
}
Layer.confirm('确认批量审核通过选中的 ' + ids.length + ' 条信息?', {title: '批量审核确认', btn: ['通过', '取消']}, function (index) {
Fast.api.ajax({
url: 'fc/post/audit',
data: {ids: ids.join(','), auditStatus: 1}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 审核驳回
// 批量审核驳回
$(document).on('click', '.btn-audit-reject', function () {
var ids = Table.api.selectedids(table);
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要批量操作的信息');
return;
}
Layer.prompt({title: '请输入批量驳回的原因(将通知给发布用户)', formType: 2}, function (value, index) {
if (!$.trim(value)) {
Toastr.error('驳回原因不可为空');
return;
}
Fast.api.ajax({
url: 'fc/post/audit',
data: {ids: ids.join(','), auditStatus: 2, reason: value}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 下架
// 批量下架
$(document).on('click', '.btn-offline', function () {
var ids = Table.api.selectedids(table);
Layer.confirm(__('确认下架选中的信息?'), {icon: 3, title: __('提示')}, function (index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要下架的信息');
return;
}
Layer.confirm('确认批量下架选中的 ' + ids.length + ' 条信息?', {title: '下架确认', btn: ['下架', '取消']}, function (index) {
Fast.api.ajax({
url: 'fc/post/offline',
data: {ids: ids.join(',')}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 置顶(选中项在用户端首页优先展示)
// 批量置顶
$(document).on('click', '.btn-top', function () {
var ids = Table.api.selectedids(table);
Layer.confirm(__('确认置顶选中的信息?'), {icon: 3, title: __('提示')}, function (index) {
if (ids.length === 0) {
Toastr.warning('请先勾选需要置顶的信息');
return;
}
Layer.confirm('确认批量置顶选中的 ' + ids.length + ' 条信息?', {title: '置顶确认', btn: ['置顶', '取消']}, function (index) {
Fast.api.ajax({
url: 'fc/post/top',
data: {ids: ids.join(','), isTop: 1}
}, function (data) {
}, function () {
table.bootstrapTable('refresh');
updateBatchBar();
return false;
});
Layer.close(index);
});
});
// 取消置顶
$(document).on('click', '.btn-untop', function () {
var ids = Table.api.selectedids(table);
Layer.confirm(__('确认取消置顶选中的信息?'), {icon: 3, title: __('提示')}, function (index) {
Fast.api.ajax({
url: 'fc/post/top',
data: {ids: ids.join(','), isTop: 0}
}, function (data) {
table.bootstrapTable('refresh');
return false;
});
Layer.close(index);
});
});
},
/**
* 详情与审核窗口逻辑
*/
detail: function () {
var postId = Fast.api.query('ids') || Fast.api.query('id');
/**
* 提交审核结果
* @param {number} status 1=通过, 2=驳回
* @param {string} reason 驳回原因
*/
function submitAudit(status, reason) {
Fast.api.ajax({
url: 'fc/post/audit',
type: 'POST',
data: {
ids: postId,
auditStatus: status,
reason: reason || ''
}
}, function (data, ret) {
Toastr.success(ret.msg || '操作成功');
setTimeout(function () {
Fast.api.close();
if (parent.$ && parent.$('#table').length) {
parent.$('#table').bootstrapTable('refresh');
}
}, 400);
return false;
}, function (data, ret) {
Toastr.error(ret.msg || '操作失败');
return false;
});
}
// 点击通过:弹窗确认通过
$('#btn-pass').off('click').on('click', function () {
Layer.confirm('确认审核通过此信息吗?', {
title: '通过确认',
btn: ['通过', '取消']
}, function (index) {
Layer.close(index);
submitAudit(1, '');
});
});
// 点击驳回:弹窗确认输入驳回原因
$('#btn-reject').off('click').on('click', function () {
Layer.prompt({
title: '请输入驳回原因(将通知给发布用户)',
formType: 2,
value: ''
}, function (value, promptIndex) {
var reason = $.trim(value);
if (!reason) {
Toastr.warning('驳回原因不可为空');
return;
}
Layer.close(promptIndex);
submitAudit(2, reason);
});
});
// 点击关闭
$('#btn-close').off('click').on('click', function () {
Fast.api.close();
});
},
recyclebin: function () {
// 初始化表格参数配置
Table.api.init({
extend: {
'dragsort_url': ''
@@ -280,15 +332,17 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
var table = $("#table");
// 初始化表格
table.bootstrapTable({
url: 'fc/post/recyclebin' + location.search,
pk: 'id',
sortName: 'id',
clickToSelect: false,
columns: [
[
{checkbox: true},
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
{field: 'id', title: '序号', operate: false, formatter: function (value, row, index) {
return '<span class="fc-serial">' + (index + 1) + '</span>';
}},
{field: 'title', title: __('Title'), align: 'left'},
{
field: 'deletetime',
@@ -299,24 +353,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
},
{
field: 'operate',
width: '140px',
title: __('Operate'),
width: '120px',
title: '操作',
table: table,
events: Table.api.events.operate,
buttons: [
{
name: 'Restore',
text: __('Restore'),
text: '还原',
classname: 'btn btn-xs btn-info btn-ajax btn-restoreit',
icon: 'fa fa-rotate-left',
url: 'fc/post/restore',
refresh: true
},
{
name: 'Destroy',
text: __('Destroy'),
text: '销毁',
classname: 'btn btn-xs btn-danger btn-ajax btn-destroyit',
icon: 'fa fa-times',
url: 'fc/post/destroy',
refresh: true
}
@@ -327,7 +379,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
]
});
// 为表格绑定事件
Table.api.bindevent(table);
},
@@ -343,5 +394,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
}
}
};
return Controller;
});

查看文件

@@ -53,8 +53,8 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
buttons: [
{
name: 'handle',
text: __('HandleReport'),
title: __('HandleReport'),
text: '处理',
title: '处理',
classname: 'btn btn-xs btn-success btn-click',
visible: function (row) {
return row.status !== 'handled';

查看文件

@@ -77,7 +77,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
buttons: [
{
name: 'pay',
text: __('PayWithdraw'),
text: '打款',
title: __('PayWithdraw'),
classname: 'btn btn-xs btn-success btn-click',
visible: function (row) {
@@ -96,7 +96,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], fu
},
{
name: 'reject',
text: __('RejectWithdraw'),
text: '驳回',
title: __('RejectWithdraw'),
classname: 'btn btn-xs btn-danger btn-click',
visible: function (row) {