This repository has been archived on 2022-06-28. You can view files and clone it, but cannot push or open issues or pull requests.
magic_box_server/src/main/webapp/admin/magbox/popularize.jsp

114 lines
2.8 KiB
Plaintext
Raw Normal View History

2020-01-02 02:10:13 +08:00
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>推广设置</title>
</head>
<link rel="stylesheet" href="/layui/css/layui.css">
<script src="/layui/layui.all.js"></script>
<script src="/layui/layui.js"></script>
<script src="/js/jquery-3.2.1.js"></script>
<script src="/js/user.js"></script>
<body>
<table id="banner" lay-filter="banner"></table>
</body>
<script type="text/html" id="bar">
<a class="layui-btn layui-btn-xs" lay-event="title">标题</a>
<a class="layui-btn layui-btn-xs" lay-event="url">URL</a>
<a class="layui-btn layui-btn-xs" lay-event="click">点击地址</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="state">上/下线</a>
</script>
<script>
layui.use('table', function() {
var table = layui.table;
table.render({
elem: '#banner',
height: 312,
url: '/android/config/home.do?all=true',
page: false,
response: {
statusCode: 100
},
cols: [
[{
field: 'id',
title: 'id',
width: 80,
sort: true,
fixed: 'left'
}, {
field: 'text',
title: '标题',
width: 120,
}, {
field: 'imageurl',
title: '图片链接',
width: 300,
},
{
field: 'click',
title: '跳转地址',
width: 300,
},
{
field: 'isshow',
title: '是否显示',
width: 120,
}, {
fixed: 'right',
width: 250,
align: 'center',
toolbar: '#bar'
}
]
]
})
table.on('tool(banner)', function(obj) {
var data = obj.data;
if (obj.event === 'title') {
layer.prompt(function(value, index, elem) {
layer.close(index);
layer.msg(value)
active['reload'](this)
});
} else if (obj.event === 'url') {
layer.prompt(function(value, index, elem) {
layer.close(index);
layer.msg(value)
active['reload'](this)
});
} else if (obj.event === 'click') {
layer.prompt(function(value, index, elem) {
layer.close(index);
layer.msg(value)
active['reload'](this)
});
} else if (obj.event == 'state') {
layer.prompt(function(value, index, elem) {
layer.close(index);
layer.msg(value)
active['reload'](this)
});
}
})
var $ = layui.$,
active = {
reload: function() {
//执行重载
table.reload('banner', {
page: {
curr: 1 //重新从第 1 页开始
},
where: {
type: $('#searchType').val(),
key: $('#searchKey').val()
}
});
}
};
})
</script>
</html>