2017-06-25 23:37:00 +08:00

95 lines
4.1 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<extend name="Public/base" />
<block name="main">
<fieldset class="layui-elem-field">
<legend>应用管理 - 应用列表</legend>
<div class="layui-field-box">
<span class="layui-btn layui-btn-normal api-add"><i class="layui-icon">&#xe608;</i> 新增</span>
<table class="layui-table" lay-even>
<thead>
<tr>
<th>#</th>
<th>应用名称</th>
<th>AppId</th>
<th>AppSecret</th>
<th>应用说明</th>
<th>应用状态</th>
<th>操作</th>
</tr>
</thead>
<tbody>
<volist name="list" id="vo">
<tr>
<td>{$i}</td>
<td>{$vo['app_name']}</td>
<td>{$vo['app_id']}</td>
<td>{$vo['app_secret']}</td>
<td>{$vo['app_info']}</td>
<td>
<if condition="$vo['app_status']">
<span style="border-radius: 2px;background-color: #5FB878;padding:5px 10px;color: #ffffff">生效</span>
<else />
<span style="border-radius: 2px;background-color: #FF5722;padding:5px 10px;color: #ffffff">禁用</span>
</if>
</td>
<td>
<if condition="$vo['app_status']">
<span class="layui-btn layui-btn-danger confirm" data-info="你确定禁用当前APP么" data-id="{$vo['id']}" data-url="{:U('close')}">禁用</span>
<else />
<span class="layui-btn confirm" data-info="你确定启用当前APP么" data-id="{$vo['id']}" data-url="{:U('open')}">启用</span>
</if>
<span data-url="{:U('edit', array('id' => $vo['id']))}" class="layui-btn edit layui-btn-normal">编辑</span>
<span class="layui-btn layui-btn-danger confirm" data-id="{$vo['id']}" data-info="你确定删除当前APP么" data-url="{:U('del')}">删除</span>
</td>
</tr>
</volist>
</tbody>
</table>
</div>
</fieldset>
</block>
<block name="myScript">
<script>
layui.use(['layer'], function() {
$('.api-add').on('click', function () {
layer.open({
type: 2,
area: ['80%', '80%'],
maxmin: true,
content: '{:U("add")}'
});
});
$('.edit').on('click', function () {
var ownObj = $(this);
layer.open({
type: 2,
area: ['80%', '80%'],
maxmin: true,
content: ownObj.attr('data-url')
});
});
$('.confirm').on('click', function () {
var ownObj = $(this);
layer.confirm(ownObj.attr('data-info'), {
btn: ['确定','取消'] //按钮
}, function(){
$.ajax({
type: "POST",
url: ownObj.attr('data-url'),
data: {id:ownObj.attr('data-id')},
success: function(msg){
if( msg.code == 1 ){
location.reload();
}else{
layer.msg(msg.msg, {
icon: 5,
shade: [0.6, '#393D49'],
time:1500
});
}
}
});
});
});
});
</script>
</block>