chore: 重写初始提交(清空历史,整理后全量提交)
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
|
||||
<div class="layui-card" style="margin:20px;">
|
||||
<div class="layui-card-header">收益账本(开发者分红)</div>
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-row" id="summary" style="margin-bottom:12px;"></div>
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'jquery'], function () {
|
||||
var table = layui.table, $ = layui.jquery;
|
||||
var summaryData = null;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
url: '{:url("/appmall/backend/revenue/index")}',
|
||||
page: true,
|
||||
// Result::success 返回 code:0 / message / data:{list,summary} / count
|
||||
response: { statusName: 'code', msgName: 'message', countName: 'count', dataName: 'data' },
|
||||
parseData: function (res) {
|
||||
summaryData = (res.data && res.data.summary) ? res.data.summary : null;
|
||||
return {
|
||||
code: res.code,
|
||||
msg: res.message,
|
||||
count: res.count || 0,
|
||||
data: (res.data && res.data.list) ? res.data.list : []
|
||||
};
|
||||
},
|
||||
cols: [[
|
||||
{field: 'id', title: 'ID', width: 70},
|
||||
{field: 'developer_id', title: '开发者ID', width: 100},
|
||||
{field: 'aid', title: '商品ID', width: 90},
|
||||
{field: 'uid', title: '购买用户', width: 90},
|
||||
{field: 'amount', title: '订单金额', width: 100},
|
||||
{field: 'commission', title: '平台抽成', width: 100},
|
||||
{field: 'income', title: '开发者收益', width: 110, templet: function(d){return '<b>'+d.income+'</b>';}},
|
||||
{field: 'status', title: '结算', width: 90, templet: function(d){return d.status==1?'<span class="layui-badge layui-bg-green">已结算</span>':'<span class="layui-badge">待结算</span>';}},
|
||||
{field: 'create_at', title: '时间', width: 170, templet: function(d){return layui.util.toDateString(d.create_at*1000);}}
|
||||
]],
|
||||
done: function () {
|
||||
if (summaryData) {
|
||||
$('#summary').html(
|
||||
'总销售额:<b>' + summaryData.total_amount + '</b> | ' +
|
||||
'平台抽成:<b>' + summaryData.total_commission + '</b> | ' +
|
||||
'开发者收益:<b style="color:#16a34a;">' + summaryData.total_income + '</b>'
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@@ -0,0 +1,48 @@
|
||||
|
||||
<div class="layui-card" style="margin:20px;">
|
||||
<div class="layui-card-header">提现管理(开发者分红结算)</div>
|
||||
<div class="layui-card-body">
|
||||
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
layui.use(['table', 'jquery', 'layer'], function () {
|
||||
var table = layui.table, $ = layui.jquery, layer = layui.layer;
|
||||
table.render({
|
||||
elem: '#dataTable',
|
||||
url: '{:url("/appmall/backend/revenue/withdrawals")}',
|
||||
page: true,
|
||||
cols: [[
|
||||
{field: 'id', title: 'ID', width: 70},
|
||||
{field: 'developer_id', title: '开发者ID', width: 100},
|
||||
{field: 'amount', title: '提现金额', width: 110},
|
||||
{field: 'channel', title: '渠道', width: 90},
|
||||
{field: 'account', title: '收款账号', width: 180},
|
||||
{field: 'status', title: '状态', width: 100, templet: function(d){
|
||||
return d.status==1?'<span class="layui-badge layui-bg-green">已打款</span>'
|
||||
: (d.status==-1?'<span class="layui-badge layui-bg-orange">已驳回</span>'
|
||||
:'<span class="layui-badge">待处理</span>');
|
||||
}},
|
||||
{field: 'create_at', title: '申请时间', width: 170, templet: function(d){return layui.util.toDateString(d.create_at*1000);}},
|
||||
{title: '操作', width: 160, templet: function(d){
|
||||
if(d.status!=0) return '-';
|
||||
return '<a class="layui-btn layui-btn-xs layui-btn-normal" lay-event="settle">打款</a>'
|
||||
+ '<a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="reject">驳回</a>';
|
||||
}}
|
||||
]]
|
||||
});
|
||||
table.on('tool(dataTable)', function(obj){
|
||||
var d = obj.data;
|
||||
if(obj.event==='settle'){
|
||||
layer.confirm('确认已向开发者打款?', function(){
|
||||
$.post('{:url("revenue/settle")}', {id:d.id}, function(r){layer.msg(r.message||r.msg);if(r.code===0)table.reload('dataTable');});
|
||||
});
|
||||
} else if(obj.event==='reject'){
|
||||
layer.prompt({title:'驳回原因'}, function(val, index){
|
||||
$.post('{:url("revenue/reject")}', {id:d.id, reason:val}, function(r){layer.msg(r.message||r.msg);if(r.code===0)table.reload('dataTable');layer.close(index);});
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user