feat(admin): 信息置顶 + 发布与费用配置(免费/付费开关、单条与月年卡价格含条数)
需求落地: - 置顶:fc/post 新增 top 动作(批量置顶/取消置顶 + 站内消息通知),列表加「置顶/取消置顶」工具栏按钮、 行内按钮与置顶状态徽章;置顶信息在用户端首页与「我的发布」中优先展示(Home::feed 按 is_top desc) - 发布与费用配置(新增页面:同城业务 → 基础数据 → 发布与费用配置,fc/publish): 发布模式(免费发布 / 付费发布)、会员单条发布价格、按月(价格 + 含条数)、按年(价格 + 含条数); 真源为 fc_config 的 post.*,保存时同步 fc_plan 的月卡(M1)/年卡(M12) 价格与 post_quota - FcInstall:新增 post.* 六项配置(默认免费发布,避免上线即撞付费墙);fc_user_ext 加 post_quota_left / post_quota_expire(套餐额度与有效期)、fc_plan 加 post_quota;新增 upgradePublish() 幂等升级老库并同步月/年卡 - tools/verify-api.mjs:新增 P9 发布配置 / P8 我的发布 契约校验,P1 发布改为「免费模式/额度内发布」并按付费模式容错 - 语言包与视图同步中文,均通过 php -l 与 node --check
这个提交包含在:
@@ -87,14 +87,46 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'is_top', title: __('Is_top'),
|
||||
searchList: {0: __('否'), 1: __('是')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('否'), 1: __('是')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
return Number(value) === 1
|
||||
? '<span class="label label-success">' + __('已置顶') + '</span>'
|
||||
: '<span class="label label-default">' + __('未置顶') + '</span>';
|
||||
}
|
||||
},
|
||||
{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}
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'top',
|
||||
text: __('TopPost'),
|
||||
title: __('TopPost'),
|
||||
classname: 'btn btn-xs btn-info btn-ajax',
|
||||
icon: 'fa fa-arrow-up',
|
||||
url: 'fc/post/top',
|
||||
data: {isTop: 1},
|
||||
visible: function (row) {
|
||||
return Number(row.is_top) !== 1;
|
||||
},
|
||||
confirm: __('确认置顶选中的信息?'),
|
||||
refresh: true
|
||||
},
|
||||
{
|
||||
name: 'untop',
|
||||
text: __('CancelTopPost'),
|
||||
title: __('CancelTopPost'),
|
||||
classname: 'btn btn-xs btn-default btn-ajax',
|
||||
icon: 'fa fa-arrow-down',
|
||||
url: 'fc/post/top',
|
||||
data: {isTop: 0},
|
||||
visible: function (row) {
|
||||
return Number(row.is_top) === 1;
|
||||
},
|
||||
confirm: __('确认取消置顶选中的信息?'),
|
||||
refresh: true
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
@@ -147,6 +179,36 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
});
|
||||
});
|
||||
|
||||
// 置顶(选中项在用户端首页优先展示)
|
||||
$(document).on('click', '.btn-top', 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: 1}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
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);
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
recyclebin: function () {
|
||||
// 初始化表格参数配置
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form'], function ($, undefined, Backend, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 发布与费用配置:表单校验 + 提交(保存成功后提示并由 FastAdmin 统一处理)
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
在新工单中引用
屏蔽一个用户