feat: 新增分销分佣结算、商家认证及草稿管理功能,优化界面与版本更新
这个提交包含在:
163
public/assets/css/backend-theme.css
普通文件
163
public/assets/css/backend-theme.css
普通文件
@@ -0,0 +1,163 @@
|
||||
/**
|
||||
* 后台列表页样式
|
||||
* 中性后台风格,不继承小程序品牌色,不影响小程序端
|
||||
*/
|
||||
|
||||
/* ---------- 内容区 ---------- */
|
||||
body.inside-header .content {
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
/* ---------- 面板 ---------- */
|
||||
.panel {
|
||||
border: none;
|
||||
border-radius: 8px;
|
||||
box-shadow: 0 1px 2px rgba(23, 35, 61, .05), 0 6px 18px rgba(23, 35, 61, .04);
|
||||
}
|
||||
|
||||
.panel-intro {
|
||||
background: #FFFFFF;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-heading {
|
||||
background: #FFFFFF;
|
||||
border-bottom: 1px solid #EDEFF3;
|
||||
border-radius: 8px 8px 0 0;
|
||||
padding: 12px 14px;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-body {
|
||||
padding: 0 14px 14px;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-heading .nav-tabs {
|
||||
border-bottom: none;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-heading .nav-tabs > li > a {
|
||||
border: 1px solid transparent;
|
||||
border-radius: 6px;
|
||||
color: #5A6472;
|
||||
margin-right: 6px;
|
||||
padding: 6px 14px;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-heading .nav-tabs > li > a:hover,
|
||||
.panel-intro > .panel-heading .nav-tabs > li > a:focus {
|
||||
background: #F5F7FA;
|
||||
border-color: #EDEFF3;
|
||||
color: #262C36;
|
||||
}
|
||||
|
||||
.panel-intro > .panel-heading .nav-tabs > li.active > a,
|
||||
.panel-intro > .panel-heading .nav-tabs > li.active > a:hover,
|
||||
.panel-intro > .panel-heading .nav-tabs > li.active > a:focus {
|
||||
background: #444C69;
|
||||
border-color: #444C69;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* ---------- 工具栏 ---------- */
|
||||
.toolbar {
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
}
|
||||
|
||||
.toolbar .btn {
|
||||
margin-right: 6px;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
/* ---------- 表格 ---------- */
|
||||
.bootstrap-table .table > thead > tr > th {
|
||||
background: #F7F8FA;
|
||||
border-bottom: 1px solid #E5E8EC !important;
|
||||
color: #262C36;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.bootstrap-table .table > tbody > tr > td {
|
||||
border-color: #EDEFF3;
|
||||
vertical-align: middle;
|
||||
}
|
||||
|
||||
.table-striped > tbody > tr:nth-of-type(odd) {
|
||||
background-color: #FBFCFD;
|
||||
}
|
||||
|
||||
.table-hover > tbody > tr:hover {
|
||||
background-color: #F5F8FC;
|
||||
}
|
||||
|
||||
.bootstrap-table .table > tbody > tr:last-child > td {
|
||||
border-bottom: 1px solid #EDEFF3;
|
||||
}
|
||||
|
||||
.fc-serial {
|
||||
color: #8A94A6;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
.table .btn-xs {
|
||||
padding: 2px 7px;
|
||||
}
|
||||
|
||||
.pagination > .active > a,
|
||||
.pagination > .active > a:hover,
|
||||
.pagination > .active > a:focus,
|
||||
.pagination > .active > span {
|
||||
background-color: #444C69;
|
||||
border-color: #444C69;
|
||||
color: #FFFFFF;
|
||||
}
|
||||
|
||||
/* ---------- 状态徽标 ---------- */
|
||||
.fc-status {
|
||||
display: inline-block;
|
||||
padding: 1px 9px;
|
||||
border: 1px solid transparent;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
line-height: 20px;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.fc-status-success {
|
||||
background: #EAF7F0;
|
||||
border-color: #CDEBDA;
|
||||
color: #1E7B4F;
|
||||
}
|
||||
|
||||
.fc-status-warning {
|
||||
background: #FFF6E5;
|
||||
border-color: #F5E2BC;
|
||||
color: #8A5A00;
|
||||
}
|
||||
|
||||
.fc-status-danger {
|
||||
background: #FDECEC;
|
||||
border-color: #F7D2D2;
|
||||
color: #A82A2A;
|
||||
}
|
||||
|
||||
.fc-status-info {
|
||||
background: #EDF4FD;
|
||||
border-color: #D4E5FA;
|
||||
color: #1D5F9E;
|
||||
}
|
||||
|
||||
.fc-status-default {
|
||||
background: #F4F5F7;
|
||||
border-color: #E3E6EA;
|
||||
color: #5C6670;
|
||||
}
|
||||
|
||||
/* ---------- 首页分组标题 ---------- */
|
||||
.fc-section-title {
|
||||
margin: 20px 0 12px;
|
||||
color: #262C36;
|
||||
font-size: 15px;
|
||||
font-weight: 600;
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -30,7 +30,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true, },
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'username', title: __('Username')},
|
||||
{field: 'nickname', title: __('Nickname')},
|
||||
{field: 'groups_text', title: __('Group'), operate:false, formatter: Table.api.formatter.label},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -23,7 +23,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: 'ID', operate: false},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'admin_id', title: __('Admin_id'), formatter: Table.api.formatter.search, visible: false},
|
||||
{field: 'username', title: __('Username'), formatter: Table.api.formatter.search},
|
||||
{field: 'title', title: __('Title'), operate: 'LIKE %...%', placeholder: '模糊搜索'},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function ($, undefined, Backend, Table, Form, undefined) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree', 'backend/format'], function ($, undefined, Backend, Table, Form, undefined, Format) {
|
||||
//读取选中的条目
|
||||
$.jstree.core.prototype.get_all_checked = function (full) {
|
||||
var obj = this.get_selected(), i, j;
|
||||
@@ -45,8 +45,19 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'pid', title: __('Parent')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'pid', title: __('Parent'), formatter: function (value) {
|
||||
if (!value || parseInt(value) === 0) {
|
||||
return '顶级';
|
||||
}
|
||||
var data = $('#table').bootstrapTable('getData') || [];
|
||||
for (var i = 0; i < data.length; i++) {
|
||||
if (String(data[i].id) === String(value)) {
|
||||
return String(data[i].name).replace(/( |\s)/g, '');
|
||||
}
|
||||
}
|
||||
return '-';
|
||||
}},
|
||||
{field: 'name', title: __('Name'), align: 'left', formatter:function (value, row, index) {
|
||||
return value.toString().replace(/(&|&)nbsp;/g, ' ');
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function ($, undefined, Backend, Table, Form, Template) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template', 'backend/format'], function ($, undefined, Backend, Table, Form, Template, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'template'], function
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'title', title: __('Title'), align: 'left', formatter: Controller.api.formatter.title, clickToSelect: !false},
|
||||
{field: 'icon', title: __('Icon'), formatter: Controller.api.formatter.icon},
|
||||
{field: 'name', title: __('Name'), align: 'left', formatter: Controller.api.formatter.name},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -26,7 +26,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'type', title: __('Type'), operate: false, searchList: Config.searchList, formatter: Table.api.formatter.label},
|
||||
{field: 'name', title: __('Name'), align: 'left', formatter:function (value, row, index) {
|
||||
return value.toString().replace(/(&|&)nbsp;/g, ' ');
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,15 +25,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'enabled', title: __('Enabled'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: function (value) {
|
||||
var m = {0: '否', 1: '是'};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: '否', 1: '是'}, {0: 'default', 1: 'success'})
|
||||
},
|
||||
{field: 'sort', title: __('Sort')},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
/**
|
||||
* 同城轮播广告管理控制器
|
||||
*/
|
||||
var Controller = {
|
||||
/**
|
||||
* 轮播列表页逻辑初始化
|
||||
*/
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
@@ -22,24 +28,36 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'sort',
|
||||
sortOrder: 'asc',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{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: 'enabled', title: __('Enabled'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: function (value) {
|
||||
var m = {0: '否', 1: '是'};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
field: 'image',
|
||||
title: __('Image'),
|
||||
operate: false,
|
||||
events: Table.api.events.image,
|
||||
formatter: function (value, row, index) {
|
||||
if (!value) {
|
||||
return '<span class="text-muted"><i class="fa fa-paint-brush"></i> 内置插画</span>';
|
||||
}
|
||||
return Table.api.formatter.image.call(this, value, row, index);
|
||||
}
|
||||
},
|
||||
{field: 'sort', title: __('Sort')},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{
|
||||
field: 'enabled',
|
||||
title: __('Enabled'),
|
||||
align: 'center',
|
||||
table: table,
|
||||
searchList: {"1": '显示/上架', "0": '隐藏/下架'},
|
||||
formatter: Table.api.formatter.toggle
|
||||
},
|
||||
{field: 'sort', title: __('Sort'), sortable: true},
|
||||
{field: 'link', title: __('Link'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'color', title: __('Color'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'color', title: __('Color'), operate: 'LIKE', visible: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime, sortable: true},
|
||||
{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}
|
||||
]
|
||||
@@ -49,13 +67,25 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
|
||||
/**
|
||||
* 新增轮播页逻辑初始化
|
||||
*/
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
|
||||
/**
|
||||
* 编辑轮播页逻辑初始化
|
||||
*/
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
|
||||
api: {
|
||||
/**
|
||||
* 绑定表单事件与FastAdmin组件初始化
|
||||
*/
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,15 +25,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'enabled', title: __('Enabled'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: function (value) {
|
||||
var m = {0: '否', 1: '是'};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: '否', 1: '是'}, {0: 'default', 1: 'success'})
|
||||
},
|
||||
{field: 'post_count', title: __('Post_count')},
|
||||
{field: 'sort', title: __('Sort')},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,9 +27,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'post_id', title: __('Post_id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'post_id', title: '信息', addClass: 'selectpage', extend: "data-source='fc/post/index' data-field='title'", formatter: function (value, row) {
|
||||
return row.post_title || '-';
|
||||
}},
|
||||
{field: 'user_id', title: '评价人', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.user_name || '-';
|
||||
}},
|
||||
{field: 'score', title: __('Score'),
|
||||
searchList: {1: '1', 2: '2', 3: '3', 4: '4', 5: '5'},
|
||||
formatter: function (value) {
|
||||
@@ -40,23 +44,78 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'reply', title: __('Reply'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'top', title: __('Top'),
|
||||
searchList: {0: __('否'), 1: __('是')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('否'), 1: __('是')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
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: 'replytime', title: __('Replytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'status', title: __('Status'),
|
||||
searchList: {1: __('正常'), 0: __('隐藏')},
|
||||
formatter: function (value) {
|
||||
var m = {1: __('正常'), 0: __('隐藏')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({1: __('正常'), 0: __('隐藏')}, {1: 'success', 0: 'default'})
|
||||
},
|
||||
{field: 'images', title: __('Images'), 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}
|
||||
{
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'reply',
|
||||
text: __('ReplyComment'),
|
||||
title: __('ReplyComment'),
|
||||
classname: 'btn btn-xs btn-success btn-click',
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: __('请输入回复内容'), formType: 2, value: row.reply || ''}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/comment/reply',
|
||||
data: {ids: row.id, reply: value}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'top',
|
||||
text: __('TopComment'),
|
||||
title: __('TopComment'),
|
||||
classname: 'btn btn-xs btn-info btn-click',
|
||||
visible: function (row) {
|
||||
return Number(row.top) !== 1;
|
||||
},
|
||||
confirm: __('确认置顶该评价?'),
|
||||
click: function (options, row) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/comment/top',
|
||||
data: {ids: row.id, top: 1}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'untop',
|
||||
text: __('UnTopComment'),
|
||||
title: __('UnTopComment'),
|
||||
classname: 'btn btn-xs btn-default btn-click',
|
||||
visible: function (row) {
|
||||
return Number(row.top) === 1;
|
||||
},
|
||||
confirm: __('确认取消置顶该评价?'),
|
||||
click: function (options, row) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/comment/top',
|
||||
data: {ids: row.id, top: 0}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
@@ -64,21 +123,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 回复
|
||||
$(document).on('click', '.btn-reply', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.prompt({title: __('请输入回复内容'), formType: 2}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/comment/reply',
|
||||
data: {ids: ids.join(','), reply: value}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
// 置顶
|
||||
$(document).on('click', '.btn-top', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,9 +27,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), visible: false},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'from_user_id', title: __('From_user_id')},
|
||||
{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: 'from_user_id', title: '来源用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.from_user_name || '-';
|
||||
}},
|
||||
{
|
||||
field: 'amount', title: __('Amount'), operate: 'BETWEEN',
|
||||
formatter: function (value) {
|
||||
@@ -53,13 +57,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'status', title: __('Status'),
|
||||
searchList: {0: __('未结算'), 1: __('已结算')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('未结算'), 1: __('已结算')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: __('未结算'), 1: __('已结算')}, {0: 'warning', 1: 'success'})
|
||||
},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'order_id', title: __('Order_id')},
|
||||
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'order_type', title: __('Order_type'),
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{
|
||||
field: 'name', title: __('优惠券名称'), operate: 'LIKE',
|
||||
// 双保险:服务端 add/edit 已 strip_tags,这里再做一次 HTML 转义,
|
||||
@@ -69,10 +69,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'enabled', title: __('是否启用'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: function (value) {
|
||||
var m = {0: '否', 1: '是'};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: '否', 1: '是'}, {0: 'default', 1: 'success'})
|
||||
},
|
||||
{field: 'sort', title: __('排序')},
|
||||
{field: 'createtime', title: __('创建时间'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,9 +25,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'parent_id', title: __('Parent_id')},
|
||||
{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: 'parent_id', title: '上级', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.parent_name || '-';
|
||||
}},
|
||||
{
|
||||
field: 'level', title: __('Level'),
|
||||
searchList: {1: __('一级'), 2: __('二级')},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,10 +27,14 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{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: 'title', title: __('Title'), operate: 'LIKE'},
|
||||
{field: 'category_id', title: __('Category_id')},
|
||||
{field: 'category_id', title: '分类', addClass: 'selectpage', extend: "data-source='fc/category/index' data-field='name'", formatter: function (value, row) {
|
||||
return row.category_name || '-';
|
||||
}},
|
||||
{field: 'savedat', title: __('Savedat'), 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: 'contact', title: __('Contact'), operate: 'LIKE'},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), visible: false},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'flow_no', title: __('Flow_no'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'type', title: __('Type'),
|
||||
@@ -49,7 +49,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}
|
||||
},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'related_id', title: __('Related_id')},
|
||||
{field: 'related_text', title: '关联单号', operate: false, sortable: false, formatter: function (value) {
|
||||
return value ? value : '-';
|
||||
}},
|
||||
{field: 'remark', title: __('Remark'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,26 +27,22 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{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: 'contact', title: __('Contact'), operate: 'LIKE'},
|
||||
{field: 'category', title: __('Category'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'audit_status', title: __('Audit_status'),
|
||||
searchList: {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: __('待审核'), 1: __('已通过'), 2: __('已驳回')}, {0: 'warning', 1: 'success', 2: 'danger'})
|
||||
},
|
||||
{
|
||||
field: 'shop_status', title: __('Shop_status'),
|
||||
searchList: {normal: __('正常'), pending: __('待审核'), banned: __('已封禁')},
|
||||
formatter: function (value) {
|
||||
var m = {normal: __('正常'), pending: __('待审核'), banned: __('已封禁')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({normal: __('正常'), pending: __('待审核'), banned: __('已封禁')}, {normal: 'success', pending: 'warning', banned: 'danger'})
|
||||
},
|
||||
{field: 'license', title: __('License'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'violations', title: __('Violations')},
|
||||
@@ -55,7 +51,52 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{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}
|
||||
{
|
||||
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/merchant/audit',
|
||||
data: {ids: row.id, auditStatus: 1}
|
||||
}, function () {
|
||||
$('#' + options.tableId).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);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,8 +25,10 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{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: 'type', title: __('Type'),
|
||||
searchList: {system: __('系统通知'), interact: __('互动消息')},
|
||||
@@ -40,10 +42,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'isread', title: __('Isread'),
|
||||
searchList: {0: __('否'), 1: __('是')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('否'), 1: __('是')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: __('未读'), 1: __('已读')}, {0: 'warning', 1: 'default'})
|
||||
},
|
||||
{field: 'readtime', title: __('Readtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), visible: false},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'order_no', title: __('Order_no'), operate: 'LIKE'},
|
||||
{
|
||||
field: 'type', title: __('Type'),
|
||||
@@ -55,12 +55,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'status', title: __('Status'),
|
||||
searchList: {pending: __('待支付'), paid: __('已支付'), refunded: __('已退款'), closed: __('已关闭')},
|
||||
formatter: function (value) {
|
||||
var m = {pending: __('待支付'), paid: __('已支付'), refunded: __('已退款'), closed: __('已关闭')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({pending: __('待支付'), paid: __('已支付'), refunded: __('已退款'), closed: __('已关闭')}, {pending: 'warning', paid: 'success', refunded: 'info', closed: 'default'})
|
||||
},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'user_id', title: '下单用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.user_name || '-';
|
||||
}},
|
||||
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{
|
||||
@@ -72,7 +71,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'refund_reason', title: __('Refund_reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'related_id', title: __('Related_id'), 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}
|
||||
{
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'refund',
|
||||
text: __('RefundOrder'),
|
||||
title: __('RefundOrder'),
|
||||
classname: 'btn btn-xs btn-warning btn-click',
|
||||
visible: function (row) {
|
||||
return row.status === 'paid';
|
||||
},
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: __('请输入退款金额'), formType: 0, value: row.amount || ''}, function (value, index) {
|
||||
var amount = parseFloat(value);
|
||||
if (!amount || amount <= 0) {
|
||||
Layer.msg(__('退款金额需大于 0'));
|
||||
return;
|
||||
}
|
||||
Layer.prompt({title: __('请输入退款原因(可选)'), formType: 2}, function (reason, index2) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/order/refund',
|
||||
data: {ids: row.id, amount: amount, reason: reason}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index2);
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
@@ -80,29 +113,6 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 退款
|
||||
$(document).on('click', '.btn-refund', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.prompt({title: __('请输入退款金额'), formType: 0}, function (value, index) {
|
||||
var amount = parseFloat(value);
|
||||
if (!amount || amount <= 0) {
|
||||
Layer.msg(__('退款金额需大于 0'));
|
||||
return;
|
||||
}
|
||||
Layer.prompt({title: __('请输入退款原因(可选)'), formType: 2}, function (reason, index2) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/order/refund',
|
||||
data: {ids: ids.join(','), amount: amount, reason: reason}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index2);
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
// 补单
|
||||
$(document).on('click', '.btn-supplement', function () {
|
||||
Layer.prompt({title: __('请输入需要补单的订单号'), formType: 0}, function (value, index) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,9 +25,13 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), visible: false},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'post_id', title: __('Post_id')},
|
||||
{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: 'post_id', title: '信息', addClass: 'selectpage', extend: "data-source='fc/post/index' data-field='title'", formatter: function (value, row) {
|
||||
return row.post_title || '-';
|
||||
}},
|
||||
{
|
||||
field: 'pay_type', title: __('Pay_type'),
|
||||
searchList: {wxpay: __('微信支付'), balance: __('余额支付'), free: __('会员免费')},
|
||||
@@ -43,7 +47,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
}
|
||||
},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'order_id', title: __('Order_id')},
|
||||
{field: 'order_no', title: '订单号', operate: false, sortable: false, formatter: function (value) {
|
||||
return value ? value : '-';
|
||||
}},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,7 +27,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'plan_code', title: __('Plan_code'), operate: 'LIKE'},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{
|
||||
@@ -47,10 +47,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'enabled', title: __('Enabled'),
|
||||
searchList: {0: '否', 1: '是'},
|
||||
formatter: function (value) {
|
||||
var m = {0: '否', 1: '是'};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({0: '否', 1: '是'}, {0: 'default', 1: 'success'})
|
||||
},
|
||||
{field: 'sort', title: __('Sort')},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,9 +27,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{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: __('Category_id')},
|
||||
{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;
|
||||
@@ -39,24 +41,20 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'area', title: __('Area'), operate: 'LIKE'},
|
||||
{field: 'audit_status', title: __('Audit_status'),
|
||||
searchList: {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')},
|
||||
formatter: function (value) {
|
||||
var m = {0: __('待审核'), 1: __('已通过'), 2: __('已驳回')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
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: function (value) {
|
||||
var m = {0: __('否'), 1: __('是')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
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: __('User_id')},
|
||||
{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'},
|
||||
@@ -79,51 +77,113 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'comment_count', title: __('Comment_count')},
|
||||
{field: 'status', title: __('Status'),
|
||||
searchList: {1: __('正常'), 0: __('已下架')},
|
||||
formatter: function (value) {
|
||||
var m = {1: __('正常'), 0: __('已下架')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({1: __('正常'), 0: __('已下架')}, {1: 'success', 0: 'default'})
|
||||
},
|
||||
{field: 'is_top', title: __('Is_top'),
|
||||
searchList: {0: __('否'), 1: __('是')},
|
||||
formatter: function (value) {
|
||||
return Number(value) === 1
|
||||
? '<span class="label label-success">' + __('已置顶') + '</span>'
|
||||
: '<span class="label label-default">' + __('未置顶') + '</span>';
|
||||
}
|
||||
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;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
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);
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
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) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/post/offline',
|
||||
data: {ids: row.id}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
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},
|
||||
classname: 'btn btn-xs btn-info btn-click',
|
||||
visible: function (row) {
|
||||
return Number(row.is_top) !== 1;
|
||||
},
|
||||
confirm: __('确认置顶选中的信息?'),
|
||||
refresh: true
|
||||
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-ajax',
|
||||
icon: 'fa fa-arrow-down',
|
||||
url: 'fc/post/top',
|
||||
data: {isTop: 0},
|
||||
classname: 'btn btn-xs btn-default btn-click',
|
||||
visible: function (row) {
|
||||
return Number(row.is_top) === 1;
|
||||
},
|
||||
confirm: __('确认取消置顶选中的信息?'),
|
||||
refresh: true
|
||||
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;
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -228,7 +288,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'title', title: __('Title'), align: 'left'},
|
||||
{
|
||||
field: 'deletetime',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'target_type', title: __('Target_type'),
|
||||
searchList: {post: __('信息'), comment: __('评价')},
|
||||
formatter: function (value) {
|
||||
@@ -33,20 +33,47 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
},
|
||||
{field: 'target_id', title: __('Target_id')},
|
||||
{field: 'target_title', title: '举报对象', operate: false, sortable: false, formatter: function (value) {
|
||||
return value ? value : '-';
|
||||
}},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'reporter_id', title: __('Reporter_id')},
|
||||
{field: 'reporter_id', title: '举报人', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.reporter_name || '-';
|
||||
}},
|
||||
{field: 'status', title: __('Status'),
|
||||
searchList: {pending: __('待处理'), handled: __('已处理')},
|
||||
formatter: function (value) {
|
||||
var m = {pending: __('待处理'), handled: __('已处理')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({pending: __('待处理'), handled: __('已处理')}, {pending: 'warning', handled: 'success'})
|
||||
},
|
||||
{field: 'remark', title: __('Remark'), 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: '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}
|
||||
{
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'handle',
|
||||
text: __('HandleReport'),
|
||||
title: __('HandleReport'),
|
||||
classname: 'btn btn-xs btn-success btn-click',
|
||||
visible: function (row) {
|
||||
return row.status !== 'handled';
|
||||
},
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: __('请输入处理备注(可选)'), formType: 2}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/report/handle',
|
||||
data: {ids: row.id, remark: value}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,10 +27,9 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'nickname', title: '用户', operate: 'LIKE'},
|
||||
{field: 'mobile', title: '手机号', operate: 'LIKE'},
|
||||
{
|
||||
field: 'money', title: __('Money'), operate: false,
|
||||
formatter: function (value) {
|
||||
@@ -41,18 +40,12 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'user_type', title: __('User_type'),
|
||||
searchList: {'1': __('个人'), '2': __('商家')},
|
||||
formatter: function (value) {
|
||||
var m = {'1': __('个人'), '2': __('商家')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({'1': __('个人'), '2': __('商家')}, {'1': 'info', '2': 'warning'})
|
||||
},
|
||||
{
|
||||
field: 'is_member', title: __('Is_member'),
|
||||
searchList: {'0': __('否'), '1': __('是')},
|
||||
formatter: function (value) {
|
||||
var m = {'0': __('否'), '1': __('是')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({'0': __('非会员'), '1': __('会员')}, {'0': 'default', '1': 'warning'})
|
||||
},
|
||||
{field: 'member_level', title: __('Member_level'), operate: 'LIKE'},
|
||||
{field: 'member_expiretime', title: __('Member_expiretime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
|
||||
@@ -71,37 +64,41 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{field: 'free_view_used', title: __('Free_view_used'), visible: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate: 'RANGE', addclass: 'datetimerange', autocomplete: false, formatter: Table.api.formatter.datetime},
|
||||
{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}
|
||||
{
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'recharge',
|
||||
text: '余额充值',
|
||||
title: '余额充值',
|
||||
classname: 'btn btn-xs btn-warning btn-click',
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: '请输入充值金额(元)', formType: 0}, function (value, index) {
|
||||
var amount = parseFloat(value);
|
||||
if (!(amount > 0)) {
|
||||
Layer.msg('充值金额需大于 0');
|
||||
return;
|
||||
}
|
||||
Fast.api.ajax({
|
||||
url: 'fc/userext/recharge',
|
||||
data: {ids: row.id, amount: amount}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 余额充值:需先勾选用户,再输入金额
|
||||
$(document).on('click', '.btn-recharge', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
if (!ids.length) {
|
||||
Layer.msg('请先勾选要充值的用户');
|
||||
return;
|
||||
}
|
||||
Layer.prompt({title: '请输入充值金额(元)', formType: 0}, function (value, index) {
|
||||
var amount = parseFloat(value);
|
||||
if (!(amount > 0)) {
|
||||
Layer.msg('充值金额需大于 0');
|
||||
return;
|
||||
}
|
||||
Fast.api.ajax({
|
||||
url: 'fc/userext/recharge',
|
||||
data: {ids: ids.join(','), amount: amount}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -27,9 +27,11 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), visible: false},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'withdraw_no', title: __('Withdraw_no'), operate: 'LIKE'},
|
||||
{field: 'user_id', title: __('User_id')},
|
||||
{field: 'user_id', title: '用户', addClass: 'selectpage', extend: "data-source='user/user/index' data-field='nickname'", formatter: function (value, row) {
|
||||
return row.user_name || '-';
|
||||
}},
|
||||
{
|
||||
field: 'amount', title: __('Amount'), operate: 'BETWEEN',
|
||||
formatter: function (value) {
|
||||
@@ -47,53 +49,64 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
{
|
||||
field: 'status', title: __('Status'),
|
||||
searchList: {auditing: __('待审核'), paid: __('已打款'), rejected: __('已驳回')},
|
||||
formatter: function (value) {
|
||||
var m = {auditing: __('待审核'), paid: __('已打款'), rejected: __('已驳回')};
|
||||
return m[value] !== undefined ? m[value] : '-';
|
||||
}
|
||||
formatter: Format.statusFormatter({auditing: __('待审核'), paid: __('已打款'), rejected: __('已驳回')}, {auditing: 'warning', paid: 'success', rejected: 'danger'})
|
||||
},
|
||||
{field: 'reason', title: __('Reason'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'paytime', title: __('Paytime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{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}
|
||||
{
|
||||
field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate,
|
||||
formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'pay',
|
||||
text: __('PayWithdraw'),
|
||||
title: __('PayWithdraw'),
|
||||
classname: 'btn btn-xs btn-success btn-click',
|
||||
visible: function (row) {
|
||||
return row.status === 'auditing';
|
||||
},
|
||||
confirm: __('确认对该提现申请打款?'),
|
||||
click: function (options, row) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: row.id, op: 'pay'}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'reject',
|
||||
text: __('RejectWithdraw'),
|
||||
title: __('RejectWithdraw'),
|
||||
classname: 'btn btn-xs btn-danger btn-click',
|
||||
visible: function (row) {
|
||||
return row.status === 'auditing';
|
||||
},
|
||||
click: function (options, row) {
|
||||
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: row.id, op: 'reject', reason: value}
|
||||
}, function () {
|
||||
$('#' + options.tableId).bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
// 打款
|
||||
$(document).on('click', '.btn-pay', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.confirm(__('确认对选中的提现申请打款?'), {icon: 3, title: __('提示')}, function (index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: ids.join(','), op: 'pay'}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
// 驳回
|
||||
$(document).on('click', '.btn-reject', function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
Layer.prompt({title: __('请输入驳回原因'), formType: 2}, function (value, index) {
|
||||
Fast.api.ajax({
|
||||
url: 'fc/withdraw/pay',
|
||||
data: {ids: ids.join(','), op: 'reject', reason: value}
|
||||
}, function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
return false;
|
||||
});
|
||||
Layer.close(index);
|
||||
});
|
||||
});
|
||||
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
define(['jquery'], function ($) {
|
||||
|
||||
var Format = {
|
||||
/**
|
||||
* 列表序号(跨分页连续)
|
||||
*/
|
||||
serial: function (value, row, index) {
|
||||
var table = this.table ? $(this.table) : null;
|
||||
var pageSize = 0;
|
||||
var pageNumber = 1;
|
||||
if (table && table.length && table.data('bootstrap.table')) {
|
||||
var options = table.bootstrapTable('getOptions') || {};
|
||||
pageSize = parseInt(options.pageSize, 10) || 0;
|
||||
pageNumber = parseInt(options.pageNumber, 10) || 1;
|
||||
}
|
||||
return pageSize > 0 ? (pageNumber - 1) * pageSize + index + 1 : index + 1;
|
||||
},
|
||||
/**
|
||||
* 状态徽标
|
||||
*/
|
||||
status: function (text, tone) {
|
||||
if (text === null || typeof text === 'undefined' || text === '') {
|
||||
text = '-';
|
||||
}
|
||||
return '<span class="fc-status fc-status-' + (tone || 'default') + '">' + text + '</span>';
|
||||
},
|
||||
/**
|
||||
* 生成状态字段的 formatter
|
||||
* @param map 值 => 文案
|
||||
* @param tones 值 => 颜色(success/warning/danger/info/default)
|
||||
*/
|
||||
statusFormatter: function (map, tones) {
|
||||
tones = tones || {};
|
||||
return function (value) {
|
||||
var text = map[value] !== undefined ? map[value] : '-';
|
||||
return Format.status(text, tones[value] || 'default');
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
return Format;
|
||||
});
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'form', 'table', 'backend/format'], function ($, undefined, Backend, Form, Table, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -23,7 +23,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
|
||||
{field: 'admin_id', title: __('Admin_id'), visible: false, addClass: "selectpage", extend: "data-source='auth/admin/index' data-field='nickname'"},
|
||||
{field: 'user_id', title: __('User_id'), visible: false, addClass: "selectpage", extend: "data-source='user/user/index' data-field='nickname'"},
|
||||
@@ -148,7 +148,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: multiple, visible: multiple, operate: false},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'category', title: __('Category'), operate: 'in', formatter: Table.api.formatter.label, searchList: Config.categoryList},
|
||||
{field: 'admin_id', title: __('Admin_id'), formatter: Table.api.formatter.search, visible: false},
|
||||
{field: 'user_id', title: __('User_id'), formatter: Table.api.formatter.search, visible: false},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function ($, undefined, Backend, Table, Form, Upload) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload', 'backend/format'], function ($, undefined, Backend, Table, Form, Upload, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'upload'], function (
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'url', title: __('Url'), align: 'left', formatter: Table.api.formatter.url},
|
||||
{field: 'ip', title: __('ip'), formatter:Table.api.formatter.search},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function ($, undefined, Backend, Table, Form, undefined) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree', 'backend/format'], function ($, undefined, Backend, Table, Form, undefined, Format) {
|
||||
//读取选中的条目
|
||||
$.jstree.core.prototype.get_all_checked = function (full) {
|
||||
var obj = this.get_selected(), i, j;
|
||||
@@ -39,7 +39,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'jstree'], function (
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'name', title: __('Name')},
|
||||
{field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
||||
{field: 'updatetime', title: __('Updatetime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -25,7 +25,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'pid', title: __('Pid'), visible: false},
|
||||
{field: 'title', title: __('Title'), align: 'left', formatter: Controller.api.formatter.title},
|
||||
{field: 'name', title: __('Name'), align: 'left', formatter: Controller.api.formatter.name},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -26,7 +26,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id'), sortable: true},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'username', title: __('Username'), operate: 'LIKE'},
|
||||
{field: 'nickname', title: __('Nickname'), operate: 'LIKE'},
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefined, Backend, Form, Table) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'form', 'table', 'backend/format'], function ($, undefined, Backend, Form, Table, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -23,7 +23,7 @@ define(['jquery', 'bootstrap', 'backend', 'form', 'table'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'text', title: __('Text')},
|
||||
{field: 'eventkey', title: __('Event key')},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'backend/format'], function ($, undefined, Backend, Table, Form, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -24,7 +24,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'name', title: __('Name')},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'createtime', title: __('Createtime'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'adminlte'], function ($, undefined, Backend, Table, Form, Adminlte) {
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'adminlte', 'backend/format'], function ($, undefined, Backend, Table, Form, Adminlte, Format) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
@@ -22,7 +22,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'adminlte'], function
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'type', title: __('Type')},
|
||||
{field: 'title', title: __('Resource title')},
|
||||
{field: 'eventkey', title: __('Event key')},
|
||||
@@ -52,7 +52,7 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form', 'adminlte'], function
|
||||
columns: [
|
||||
[
|
||||
{field: 'state', checkbox: true,},
|
||||
{field: 'id', title: 'ID'},
|
||||
{field: 'id', title: __('SerialNo'), operate: false, sortable: false, align: 'center', width: '70px', class: 'fc-serial', table: table, formatter: Format.serial},
|
||||
{field: 'type', title: __('Type')},
|
||||
{field: 'title', title: __('Title')},
|
||||
{field: 'eventkey', title: __('Event key')},
|
||||
|
||||
在新工单中引用
屏蔽一个用户