68 lines
2.6 KiB
HTML
68 lines
2.6 KiB
HTML
<div class="layui-fluid">
|
|
<div class="layui-card">
|
|
<div class="layui-card-header">积分流水</div>
|
|
<div class="layui-card-body">
|
|
<form class="layui-form" lay-filter="data-search-form">
|
|
<div class="layui-form-item">
|
|
<div class="layui-inline">
|
|
<input type="text" name="uid" placeholder="用户ID" autocomplete="off" class="layui-input">
|
|
</div>
|
|
<div class="layui-inline">
|
|
<button class="layui-btn layui-btn-normal" lay-submit lay-filter="data-search-btn"><i class="layui-icon"></i> 搜索</button>
|
|
<button type="button" class="layui-btn layui-btn-primary" id="btn-reset">重置</button>
|
|
<a class="layui-btn" href="{:url('score/index')}"><i class="layui-icon"></i> 返回规则</a>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
<table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<script type="text/html" id="typeTpl">
|
|
{{# if(d.type == 2){ }}
|
|
<span class="layui-badge layui-bg-orange">支出</span>
|
|
{{# } else { }}
|
|
<span class="layui-badge layui-bg-green">收入</span>
|
|
{{# } }}
|
|
</script>
|
|
<script>
|
|
layui.use(['table', 'form'], function () {
|
|
var table = layui.table, form = layui.form, $ = layui.jquery;
|
|
|
|
function renderTable() {
|
|
var where = form.val('data-search-form');
|
|
table.render({
|
|
elem: '#dataTable',
|
|
url: "{:url('score/log')}",
|
|
method: 'post',
|
|
where: where,
|
|
page: true,
|
|
cols: [[
|
|
{field: 'id', title: 'ID', width: 70},
|
|
{field: 'uid', title: '用户ID', width: 90},
|
|
{field: 'type_text', title: '类型', width: 90, templet: '#typeTpl'},
|
|
{field: 'value', title: '变动值', width: 90},
|
|
{field: 'balance', title: '余额', width: 90},
|
|
{field: 'remark', title: '备注'},
|
|
{field: 'create_at', title: '时间', width: 170, templet: function (d) {
|
|
return layui.util.toDateString(d.create_at * 1000);
|
|
}}
|
|
]]
|
|
});
|
|
}
|
|
|
|
renderTable();
|
|
|
|
form.on('submit(data-search-btn)', function () {
|
|
renderTable();
|
|
return false;
|
|
});
|
|
|
|
$('#btn-reset').on('click', function () {
|
|
form.val('data-search-form', {uid: ''});
|
|
renderTable();
|
|
});
|
|
});
|
|
</script>
|