175 lines
4.3 KiB
HTML

{extend name="common/base"/}
<!-- 主体 -->
{block name="body"}
<div class="p-3">
<form class="layui-form gg-form-bar border-t border-x">
<div class="layui-input-inline" style="width:300px;">
<input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off" />
</div>
<button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
</form>
<table class="layui-hide" id="szxc_user_authentication" lay-filter="szxc_user_authentication"></table>
</div>
<script type="text/html" id="pic_z">
<img src="{{d.pic_z}}" />
</script>
<script type="text/html" id="pic_f">
<img src="{{d.pic_f}}"/>
</script>
<script type="text/html" id="toolbarDemo">
<div class="layui-btn-container">
<!-- <span class="layui-btn layui-btn-sm" lay-event="add" data-title="添加用户实名">+ 添加用户实名</span>-->
</div>
</script>
<script type="text/html" id="barDemo">
<div class="layui-btn-group"><a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a><a class="layui-btn layui-btn-xs" lay-event="edit"></a><a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"></a></div>
</script>
{/block}
<!-- /主体 -->
<!-- 脚本 -->
{block name="script"}
<script>
const moduleInit = ['tool'];
function gouguInit() {
var table = layui.table,tool = layui.tool, form = layui.form;
layui.pageTable = table.render({
elem: '#szxc_user_authentication',
title: '列表',
toolbar: '#toolbarDemo',
url: '/admin/szxc_user_authentication/datalist',
page: true,
limit: 20,
cellMinWidth: 300,
cols: [
[
{
fixed: 'left',
field: 'id',
title: '编号',
align: 'center',
width: 80
},{
field: 'user_id',
title: '用户id',
align: 'center',
width: 100
},{
field: 'name',
title: '姓名',
align: 'center',
width: 100
},{
field: 'idcard',
title: '身份证号',
align: 'center',
width: 150
},{
field: 'pic_z',
title: '身份证正面',
align: 'center',
width: 200,
toolbar: '#pic_z',
},{
field: 'pic_f',
title: '身份证反面',
align: 'center',
width: 200,
toolbar: '#pic_f',
},{
field: 'status',
title: '审核状态',
align: 'center',
width: 100,
templet: function (d) {
var html = '<span style="color:#fbbc05">审核中</span>';
if (d.status == '1') {
html = '<span style="color:#12bb37">通过</span>';
}
if (d.status == '2') {
html = '<span style="color:#EE5757">不通过</span>';
}
return html;
}
},{
field: 'create_time',
title: '提交时间',
align: 'center',
width: 150
},{
field: 'sh_time',
title: '审核时间',
align: 'center',
width: 150
},{
field: 'admin_id',
title: '审核人',
align: 'center',
width: 100
},
{
fixed: 'right',
field: 'right',
title: '操作',
toolbar: '#barDemo',
width: 136,
align: 'center'
}
]
]
});
//监听表头工具栏事件
table.on('toolbar(szxc_user_authentication)', function(obj){
if (obj.event === 'add') {
tool.side("/admin/szxc_user_authentication/add");
return false;
}
});
//监听表格行工具事件
table.on('tool(szxc_user_authentication)', function(obj) {
var data = obj.data;
if (obj.event === 'read') {
tool.side('/admin/szxc_user_authentication/read?id='+obj.data.id);
}
else if (obj.event === 'edit') {
tool.side('/admin/szxc_user_authentication/edit?id='+obj.data.id);
}
else if (obj.event === 'del') {
layer.confirm('确定要删除该记录吗?', {
icon: 3,
title: '提示'
}, function(index) {
let callback = function (e) {
layer.msg(e.msg);
if (e.code == 0) {
obj.del();
}
}
tool.delete("/admin/szxc_user_authentication/del", { id: data.id }, callback);
layer.close(index);
});
}
return false;
});
//监听搜索提交
form.on('submit(searchform)', function(data) {
layui.pageTable.reload({
where: {
keywords: data.field.keywords
},
page: {
curr: 1
}
});
return false;
});
}
</script>
{/block}
<!-- /脚本 -->