http://demo.h-ui.net/H-ui.admin/3.1/index.html
右键 查看框架源代码
common.js
function singwaapp_save(form) {
var data = $(form).serialize();
url = $(form).attr('url');
$.post(url, data, function (result) {
if (result.code == 0) {
layer.msg(result.msg, {icon: 5, time: 2000});
} else if (result.code == 1) {
self.location = result.data.jump_url;
}
}, 'JSON');
}
function selecttime(flag) {
if (flag == 1) {
var endTime = $("#countTimeend").val();
if (endTime != "") {
WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', maxDate: endTime})
} else {
WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
}
} else {
var startTime = $("#countTimestart").val();
if (startTime != "") {
WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm', minDate: startTime})
} else {
WdatePicker({dateFmt: 'yyyy-MM-dd HH:mm'})
}
}
}
/**
* 通用化删除操作
* @param obj
*/
function app_del(obj) {
//获取模板当中的url地址
url = $(obj).attr('del_url');
//index.php/admin/news/delete/id/-1.html
//alert(url);
layer.confirm('确认要删除吗?', function (index) {
$.ajax({
type: 'POST',
url: url,
dataType: 'json',
success: function (data) {
if (data.code == 1) {
//执行跳转
self.location = data.data.jump_url;
} else if (data.code == 0) {
layer.msg(data.msg, {icon: 2, time: 2000});
}
// $(obj).parents("tr").remove();
// layer.msg('已删除!', {icon: 1, time: 1000});
},
error: function (data) {
console.log(data.msg);
},
});
});
}
index.html
{include file="public/_meta" title="娱乐资讯"/}
{include file="public/_footer" /}