You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
237 lines
8.3 KiB
237 lines
8.3 KiB
<!DOCTYPE html>
|
|
<html lang="zh-cn">
|
|
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<!--#include file="/widget/head.html"-->
|
|
|
|
</head>
|
|
<body class="layui-layout-body" layadmin-themealias="default">
|
|
|
|
<div id="wrapper" >
|
|
<!--#include file="/widget/nav.html"-->
|
|
<div id="page-wrapper" class="layui-body layadmin-tabsbody-item layui-show layui-fluid layui-row layui-col-space15">
|
|
<div class="layui-card" id="card-page-wrapper">
|
|
<div class="row">
|
|
<div class="container" style="margin-left: 15px">
|
|
<div class="col-md-1">
|
|
<button type="button" class="layui-btn pull-right" id="add">立刻添加</button>
|
|
</div>
|
|
<div class="layui-form layui-row layui-col-space16">
|
|
<div class="layui-col-md4">
|
|
<div class="layui-input-wrap">
|
|
<div class="layui-input-prefix">
|
|
<i class="layui-icon layui-icon-username">名字</i>
|
|
</div>
|
|
<input type="text" name="name" id="name" value="" placeholder="name" class="layui-input" lay-affix="clear">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-md4">
|
|
<div class="layui-input-prefix">
|
|
<i class="layui-icon layui-icon-account">uid</i>
|
|
</div>
|
|
<div class="layui-input-wrap">
|
|
<input type="text" name="target_uid" id="target_uid" placeholder="uid" lay-affix="clear" class="layui-input">
|
|
</div>
|
|
</div>
|
|
<div class="layui-col-md4">
|
|
<div class="layui-input-prefix">
|
|
<i class="layui-icon layui-icon-account">`</i>
|
|
</div>
|
|
<div class="layui-btn-container layui-col-xs12">
|
|
<button class="layui-btn" lay-submit lay-filter="demo-table-search" onclick="Search()">立刻查询</button>
|
|
<button type="reset" class="layui-btn layui-btn-primary">清理</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="row table-responsive" id="form" style="width:90%">
|
|
<table class="table table-striped table-bordered table-hover inline" id="hero_table">
|
|
</table>
|
|
<div id="test1"></div>
|
|
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<label style="color:blue;">关闭</label>
|
|
</div>
|
|
<script id="btn" type="text/template">
|
|
|
|
|
|
|
|
<div style="width:80px;">
|
|
|
|
{{if Status==2}}
|
|
<input type="button" class="layui-btn layui-btn-xs" style="background-color:red;" value="开启" onclick="delnotice({{Id}},'{{ExchangeCode}}',1)" />
|
|
{{else}}
|
|
<input type="button" class="layui-btn layui-btn-xs" style="background-color:green;" value="禁用" onclick="delnotice({{Id}},'{{ExchangeCode}}',2)" />
|
|
{{/if}}
|
|
</div>
|
|
</script>
|
|
<!--#include file="/widget/tail.html"-->
|
|
<script type="text/javascript">
|
|
|
|
var m_limit = 0;
|
|
function FilterData() {
|
|
console.info(exchange_data);
|
|
var State = Number($('input[name="State"]:checked').val());
|
|
var Status = Number($('input[name="Status"]:checked').val());
|
|
|
|
var _exchange_data = exchange_data.concat();
|
|
|
|
if (State == 0 && Status == 0) {
|
|
_exchange_data = _exchange_data.filter(f => 1 == 1);
|
|
}
|
|
else {
|
|
if (State != 0) {
|
|
_exchange_data = _exchange_data.filter(f => f.State == State);
|
|
}
|
|
if (Status != 0) {
|
|
_exchange_data = _exchange_data.filter(f => f.Status == Status);
|
|
}
|
|
}
|
|
console.info(_exchange_data);
|
|
inihero_table(_exchange_data, m_limit);
|
|
|
|
}
|
|
|
|
|
|
$("#add").click(function () {
|
|
opennotice(0);
|
|
});
|
|
|
|
function opennotice(id) {
|
|
var title = "";
|
|
if (id == 0) {
|
|
title = "添加";
|
|
} else {
|
|
title = "编辑";
|
|
}
|
|
layer.open({
|
|
content: `/pages/EditPayment.html?id=${id}`,
|
|
type: 2,
|
|
title: title,
|
|
area: ['500px', '450px'],
|
|
success:function(){
|
|
form.render();
|
|
}
|
|
});
|
|
}
|
|
|
|
|
|
var herotable;
|
|
var exchange_data;
|
|
|
|
|
|
function Search(){
|
|
Select_data(1,20,0)
|
|
}
|
|
|
|
|
|
|
|
function ini_page(data) {
|
|
layui.laypage.render({
|
|
elem: 'test1',
|
|
count: data.count,
|
|
limits: [10, 20, 30, 40, 50, 80, 100],
|
|
limit: 20,
|
|
layout: ["count", "prev", "page", "next", "limit", "skip"],
|
|
jump: function (obj, first) {
|
|
if (!first) {
|
|
Select_data(obj.curr, obj.limit, 0);
|
|
}
|
|
}
|
|
});
|
|
}
|
|
|
|
function inihero_table(data, limit) {
|
|
m_limit = limit;
|
|
console.info(data);
|
|
herotable = layui.table.render({
|
|
elem: '#hero_table',
|
|
page: false,
|
|
data: data,
|
|
width: 1300,
|
|
height: 1100,
|
|
autoSort: true,
|
|
limit: limit,
|
|
cols: [[
|
|
{ field: 'uid', title: 'uid', sort: true, width: 120 },
|
|
{ field: 'owner', title: '拥有者', sort: true, width: 180 },
|
|
{ field: 'realm', title: '区服', sort: true, width: 180 },
|
|
{ field: 'dep', title: '部门', sort: true, width: 180 },
|
|
{ field: 'itemId', title: '礼包ID', sort: true, width: 100 },
|
|
{ field: 'name', title: '礼包名称', sort: true, width: 200 },
|
|
{ field: 'admin', title: '发货人', sort: true, width: 180 },
|
|
{
|
|
field: '*', title: '状态', width: 120, templet: function (d) {
|
|
return '已发送';
|
|
}
|
|
}
|
|
]]
|
|
});
|
|
|
|
}
|
|
|
|
function getLocalTime(nS) {
|
|
return new Date(parseInt(nS) * 1000).toLocaleString().replace(/:\d{1,2}$/, ' ');
|
|
}
|
|
function Select_data(page, limit, first) {
|
|
debugger
|
|
let targetUid=$("#target_uid").val();
|
|
let name=$("#name").val();
|
|
$.ajax({
|
|
type: "GET",
|
|
url: Page.SvrIp + "/api/select_payment_list",
|
|
data: {
|
|
token: cookie.get("token"),
|
|
page: page,
|
|
limit: limit,
|
|
target_uid:targetUid,
|
|
name:name,
|
|
},
|
|
dataType: "json",
|
|
beforeSend: function () {
|
|
layer.load(1, { shade: [0.8, '#393D49'] });
|
|
},
|
|
complete: function () {
|
|
layer.closeAll('loading');
|
|
},
|
|
success: function (d) {
|
|
console.dir(d);
|
|
debugger;
|
|
exchange_data =d.data; //JSON.parse(d.data);
|
|
inihero_table(exchange_data, limit);
|
|
if (first === 1) {
|
|
ini_page(d);
|
|
}
|
|
|
|
}
|
|
});
|
|
}
|
|
$(function () {
|
|
initPage('内部福利');
|
|
|
|
Select_data(1, 20, 1);
|
|
Load_ItemList();
|
|
});
|
|
|
|
|
|
var itemList;
|
|
function Load_ItemList() {
|
|
$.get(Page.SvrIp + "/api/select_itemlist",
|
|
{ token: cookie.get("token") }
|
|
, function (d) {
|
|
itemList = d.data;
|
|
});
|
|
}
|
|
|
|
</script>
|
|
<script src="../js/coupon.js"></script>
|
|
|
|
|
|
</body>
|
|
|
|
</html>
|
|
|