-
layui.util 使用的是毫秒时间戳,也就是13位数的时间戳
layui.use(['table','laypage','laydate','util'], function(){
var laypage = layui.laypage //分页
var table = layui.table //表格
var laydate = layui.laydate //时间日期
var util = layui.util //时间戳转日期格式
// 数据遍历
table.render({
elem: '#dlist'
,url: "/admin/thisapi/listreview"
,page: {
layout: ['limit', 'count', 'prev', 'page', 'next', 'skip']
,limit: 15
,limits: [15,25,40]
,groups: 5//连续页
,prev:'上一页'
,next:'下一页'
,first:'首页'
,last:'尾页'
} //开启分页
,cols: [[ //表头
{type: 'checkbox', fixed: 'left'}
,{field: 'id', title: 'ID', width:70, sort: true, fixed: 'left',align:'center'}
,{field: 'name', width: 250, title: '公司名称', align:'center'}
,{field: 'b_name', width: 160, title: '营业类型', align:'center',}
,{field: 'g_name', width: 180, title: '客户类型', align:'center'}
,{field: 'license_img', width: 180, title: '营业执照', align:'center',}
,{field: 'c_name', width: 140, title: '省区', align:'center',}
,{field: 'd_name', width: 200, title: '市区', align:'center'}
,{field: 'address', width: 180, title: '详细地址', align:'center'}
,{field: 'time', width: 180, title: '提交时间', align:'center',templet: '<div>{{ util.toDateString(d.time*1000) }}</div>'}
// ,templet: '<div>{{ layui.util.timeAgo(d.time*1000) }}</div>'这个显示的是多少分钟前 10位的时间戳需要*1000
// ,templet:function(d){return util.toDateString(d.time)} 10位的时间戳需要*1000
,{field: 'right', title: '操作', width: 160, align:'center', templet: '#barDemo', fixed: 'right'}
]]
,id:'flinklist'
});
});