feat: 项目基础框架+配置+Kernel
This commit is contained in:
@@ -0,0 +1,179 @@
|
||||
|
||||
|
||||
<title>代理商</title>
|
||||
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
<a lay-href="">主页</a>
|
||||
<a><cite>代理商</cite></a>
|
||||
<a><cite>代理商用户</cite></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-userfront-formlist">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">下级用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
|
||||
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
|
||||
<script type="text/html" id="table-useradmin-webuser">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="info">查看关联订单</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/html" id="lockTpl">
|
||||
{{# if(d.type == 1){ }}
|
||||
<span class="layui-badge layui-bg-red">寸头收益</span>
|
||||
{{# } else { }}
|
||||
<span class="layui-badge layui-bg-blue">手续费收益</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="addsonTpl">
|
||||
{{# if(d.status == 0){ }}
|
||||
<i class="layui-icon layui-icon-loading"style="font-size: 16px; color: #1E9FFF;">交易中</i>
|
||||
{{# } else if(d.status == 1) { }}
|
||||
<i class="layui-icon layui-icon-find-fill"style="font-size: 16px; color: #009688;">平仓中</i>
|
||||
{{# } else if(d.status == 2) { }}
|
||||
|
||||
<i class="layui-icon layui-icon-ok"style="font-size: 16px; color: red;">已平仓</i>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['admin', 'useradmin', 'table' , 'layer'], function(){
|
||||
var $ = layui.$
|
||||
,admin = layui.admin
|
||||
,view = layui.view
|
||||
,table = layui.table
|
||||
,form = layui.form;
|
||||
|
||||
|
||||
//用户管理
|
||||
table.render({
|
||||
elem: '#LAY-user-manage'
|
||||
,method : 'post'
|
||||
,url: '/agent/jie/list'
|
||||
,cols: [[
|
||||
{type: 'checkbox', fixed: 'left'}
|
||||
,{field: 'id', width: 60, title: 'ID', sort: true }
|
||||
,{field: 'user_name', title: '下级用户名', minWidth: 150}
|
||||
,{field: 'agent_level', title: '下级用户等级', width: 150}
|
||||
,{field: 'type', title: '结算类型', width: 90, templet: '#lockTpl'}
|
||||
,{field: 'before', title: '初始账户金额',sort: true, width: 170,style:"color: #fff;background-color: #01AAED;"}
|
||||
,{field: 'change', title: '贡献收益', sort: true, width: 170,style:"color: #fff;background-color: #FF5722;"}
|
||||
,{field: 'after', title: '最终账户金额', sort: true, width: 170,style:"color: #fff;background-color: #01AAED;"}
|
||||
,{field: 'memo', title: '变动备注', width: 200}
|
||||
,{title: '操作', width: 120, align:'center', fixed: 'right', toolbar: '#table-useradmin-webuser'}
|
||||
]]
|
||||
,page: true
|
||||
,limit: 30
|
||||
,height: 'full-320'
|
||||
,text: '对不起,加载出现异常!'
|
||||
,headers: { //通过 request 头传递
|
||||
access_token: layui.data('layuiAdmin').access_token
|
||||
}
|
||||
,where: { //通过参数传递
|
||||
access_token: layui.data('layuiAdmin').access_token
|
||||
}
|
||||
,done: function(res){ //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
if (res !== 0 ){
|
||||
if (res.code === 1001) {
|
||||
//清空本地记录的 token,并跳转到登入页
|
||||
admin.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
form.render(null, 'layadmin-userfront-formlist');
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(LAY-user-front-search)', function(data){
|
||||
var field = data.field;
|
||||
|
||||
//执行重载
|
||||
table.reload('LAY-user-manage', {
|
||||
where: field
|
||||
,page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
,done: function(res){ //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
|
||||
if (res.code === 1001) {
|
||||
//清空本地记录的 token,并跳转到登入页
|
||||
admin.exit();
|
||||
}
|
||||
|
||||
if (res.code === 1){
|
||||
layer.msg(res.msg ,{icon : 5});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(LAY-user-manage)', function(obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'info') {
|
||||
admin.req( {
|
||||
type : "POST",
|
||||
url : 'agent/order/info',
|
||||
dataType : "json",
|
||||
data : {order_id : data.relate_id},
|
||||
done : function(returnData) { //返回数据根据结果进行相应的处理
|
||||
if (returnData.code == 0){
|
||||
admin.popup({
|
||||
title: '订单详情'
|
||||
, area: ['90%', '90%']
|
||||
, id: 'LAY-popup-user-add'
|
||||
, success: function () {
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: 'agent/order/info',
|
||||
dataType: "json",
|
||||
data: {order_id: data.relate_id},
|
||||
done: function (returnData) { //返回数据根据结果进行相应的处理
|
||||
view('LAY-popup-user-add').render('order/order/info', returnData.data.info).done(function () {
|
||||
form.render(null, 'layuiadmin-order-info'); //渲染表单
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
|
||||
|
||||
@@ -0,0 +1,263 @@
|
||||
|
||||
<div>
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-row layui-col-space15">
|
||||
<div class="layui-col-sm12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-header">订单编号 :20181209989979HGIF84354</div>
|
||||
<div class="layui-card-header">订单状态 :<span class="layui-badge">交易中</span></div>
|
||||
<div class="layui-card-header">最新进度 :<span class="layui-badge-rim">2018-12-09 12:36:09</span><span class="layui-badge layui-bg-blue">平仓</span></div>
|
||||
<br>
|
||||
<br>
|
||||
<!--<div class="layui-card-body">-->
|
||||
<!--<div class="layui-progress layui-progress-big">-->
|
||||
<!--<div class="layui-progress-bar" lay-percent="1/6"><span class="layui-progress-text">2 / 6</span></div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--<div class="layui-row">-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon layui-icon-face-smile" style="font-size: 20px; color: #009688;"></i> <span class="layui-badge layui-bg-green">订单创建成功</span></h3>-->
|
||||
<!--<span>4月28日 00:00</span>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon layui-icon-loading" style="font-size: 20px; color: #ff3331;"></i> <span class="layui-badge">交易中</span></h3>-->
|
||||
<!--<span>4月28日 00:00</span>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon" style="font-size: 20px; color: #ff3331;"></i> <span class="layui-badge-rim">平仓中</span></h3>-->
|
||||
<!--<span>-/-</span>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon" style="font-size: 20px; color: #ff3331;"></i> <span class="layui-badge-rim">已平仓</span></h3>-->
|
||||
<!--<span>-/-</span>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon" style="font-size: 20px; color: #ff3331;"></i> <span class="layui-badge-rim">未结算</span></h3>-->
|
||||
<!--<span>-/-</span>-->
|
||||
<!--</div>-->
|
||||
<!--<div class="layui-col-sm2" style="text-align: center">-->
|
||||
<!--<h3><i class="layui-icon" style="font-size: 20px; color: #ff3331;"></i> <span class="layui-badge-rim">已结算</span></h3>-->
|
||||
<!--<span>-/-</span>-->
|
||||
<!--</div>-->
|
||||
<!--</div>-->
|
||||
|
||||
<!--</div>-->
|
||||
<br>
|
||||
<br>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="layui-col-sm12">
|
||||
<div class="layui-card">
|
||||
<div class="layui-card-body" >
|
||||
<div class="layui-row">
|
||||
<div class="layui-col-sm4">
|
||||
<div class="layui-card-header">交易信息</div>
|
||||
<ul class="layui-timeline">
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
买卖类型 : {{ d.params.type }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
用户 : {{ d.params.user_id }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
交易货币 : {{ d.params.currency }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
法币货币 : {{ d.params.legal }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
手数 : {{ d.params.share }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
倍数 : {{ d.params.multiple }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-col-sm4">
|
||||
<div class="layui-card-header">资金信息</div>
|
||||
<ul class="layui-timeline">
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
初始保证金 : {{ d.params.origin_caution_money }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
当前可用保证金 : {{ d.params.caution_money }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
最终盈亏 : {{ d.params.fact_profits }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
交易手续费 : {{ d.params.trade_fee }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
隔夜费率 : {{ d.params.overnight }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-col-sm4">
|
||||
<div class="layui-card-header">状态及时间</div>
|
||||
<ul class="layui-timeline">
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
交易状态 : {{ d.params.status }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
结算状态 : {{ d.params.settled }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
创建时间 : {{ d.params.create_time }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
价格刷新时间 : {{ d.params.update_time }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
平仓时间 : {{ d.params.handle_time }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
|
||||
<script type="text/html" template>
|
||||
<li class="layui-timeline-item">
|
||||
<i class="layui-icon layui-timeline-axis"></i>
|
||||
<div class="layui-timeline-content layui-text">
|
||||
<div class="layui-timeline-title">
|
||||
完成时间 : {{ d.params.complete_time }}
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
</script>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
layui.use('sample', layui.factory('sample'));
|
||||
</script>
|
||||
@@ -0,0 +1,493 @@
|
||||
<title>代理商</title>
|
||||
|
||||
<div class="layui-card layadmin-header">
|
||||
<div class="layui-breadcrumb" lay-filter="breadcrumb">
|
||||
<a lay-href="">主页</a>
|
||||
<a><cite>代理商</cite></a>
|
||||
<a><cite>代理商用户</cite></a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-fluid">
|
||||
<div class="layui-card">
|
||||
<div class="layui-form layui-card-header layuiadmin-card-header-auto" lay-filter="layadmin-userfront-formlist">
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">ID</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="id" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="username" placeholder="请输入" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">代理用户名</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="agentusername" placeholder="请输入上级代理商" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-form-item">
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">开始日期</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="start" id="datestart" placeholder="yyyy-MM-dd" autocomplete="off"
|
||||
class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">结束日期</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" name="end" id="dateend" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">订单状态</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="status">
|
||||
<option value="10">不限</option>
|
||||
<option value="0">挂单中</option>
|
||||
<option value="1">交易中</option>
|
||||
<option value="2">平仓中</option>
|
||||
<option value="3">已平仓</option>
|
||||
<option value="4">已撤单</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">交易类型</label>
|
||||
<div class="layui-input-block">
|
||||
<select name="type">
|
||||
<option value="0">不限</option>
|
||||
<option value="1">买入</option>
|
||||
<option value="2">卖出</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="layui-inline">
|
||||
<button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="LAY-user-front-search">
|
||||
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<button class="layui-btn layui-btn-normal dao" lay-event="excel">导出表格</button>
|
||||
<!--<button class="layui-btn layui-btn-normal dao" lay-event="excel" onclick="javascrtpt:window.location.href='{{url('/admin/agent/order/order_excel')}}'">导出表格</button>-->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<div class="layui-carousel layadmin-backlog" style="background-color: #fff">
|
||||
<ul class="layui-row layui-col-space10 layui-this">
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('团队总收益 = 头寸收益 + 手续费收益', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>总收益:</h3>
|
||||
<p><cite style="color:#fff" id="all">0.0000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('头寸总收益', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>头寸收益:</h3>
|
||||
<p><cite style="color:#fff" id="toucun">0.00000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('手续费总收益', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>手续费收益:</h3>
|
||||
<p><cite style="color:#fff" id="shouxu">0.00000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('订单总量', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>订单总量</h3>
|
||||
<p><cite style="color:#fff" id="num">0</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="layui-carousel layadmin-backlog" style="background-color: #fff">
|
||||
<ul class="layui-row layui-col-space10 layui-this">
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('出金总额', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>出金总额:</h3>
|
||||
<p><cite style="color:#fff" id="chujin">0.0000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('入金总额', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>入金总额:</h3>
|
||||
<p><cite style="color:#fff" id="rujin">0.00000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('锁定保证金', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>锁定保证金:</h3>
|
||||
<p><cite style="color:#fff" id="lock">0.00000000</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
<li class="layui-col-xs3">
|
||||
<a href="javascript:;" onclick="layer.tips('客户法币锁定余额', this, {tips: 3});" class="layadmin-backlog-body"
|
||||
style="color: #fff;background-color: #01AAED;">
|
||||
<h3>客户法币锁定余额</h3>
|
||||
<p><cite style="color:#fff" id="locklage">0</cite></p>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="layui-card-body">
|
||||
<table id="LAY-user-manage" lay-filter="LAY-user-manage"></table>
|
||||
<script type="text/html" id="table-useradmin-webuser">
|
||||
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event=""><i class="layui-icon layui-icon-edit"></i>查看详情</a>
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
// function excel()
|
||||
// {
|
||||
// $.ajax({
|
||||
// url:'/agent/order/order_excel'
|
||||
// type:'get',
|
||||
// header:{
|
||||
// access_token: layui.data('layuiAdmin').access_token
|
||||
// }
|
||||
//
|
||||
// })
|
||||
// window.location.href='/agent/order/order_excel'
|
||||
// }
|
||||
</script>
|
||||
|
||||
<script type="text/html" id="lockTpl">
|
||||
{{# if(d.type == 1){ }}
|
||||
<span class="layui-badge layui-bg-red">买入</span>
|
||||
{{# } else { }}
|
||||
<span class="layui-badge layui-bg-blue">卖出</span>
|
||||
{{# } }}
|
||||
</script>
|
||||
<script type="text/html" id="addsonTpl">
|
||||
{{# if(d.status == 0){ }}
|
||||
<i class="layui-icon layui-icon-rate"style="font-size: 16px; color: #1E9FFF;">挂单中</i>
|
||||
{{# } else if(d.status == 1) { }}
|
||||
<i class="layui-icon layui-icon-rate-half"style="font-size: 16px; color: #FFB800;">交易中</i>
|
||||
{{# } else if(d.status == 2) { }}
|
||||
|
||||
<i class="layui-icon layui-icon-refresh-3"style="font-size: 16px; color: red;">平仓中</i>
|
||||
{{# } else if(d.status == 3) { }}
|
||||
|
||||
<i class="layui-icon layui-icon-rate-solid"style="font-size: 16px; color: #009688;">已平仓</i>
|
||||
{{# } else if(d.status == 4) { }}
|
||||
|
||||
<i class="layui-icon layui-icon-close-fill"style="font-size: 16px; color: #FF5722;">已撤单</i>
|
||||
{{# } }}
|
||||
</script>
|
||||
|
||||
<script>
|
||||
layui.use(['admin', 'useradmin', 'table', 'layer', 'laydate'], function () {
|
||||
var $ = layui.$
|
||||
, admin = layui.admin
|
||||
, view = layui.view
|
||||
, table = layui.table
|
||||
, laydate = layui.laydate
|
||||
, form = layui.form;
|
||||
|
||||
|
||||
//日期
|
||||
laydate.render({
|
||||
elem: '#datestart'
|
||||
});
|
||||
laydate.render({
|
||||
elem: '#dateend'
|
||||
});
|
||||
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: '/agent/get_order_account',
|
||||
dataType: "json",
|
||||
data: { all: 1 },
|
||||
done: function (result) { //返回数据根据结果进行相应的处理
|
||||
$("#all").html(result.data._all);
|
||||
$("#toucun").html(result.data._toucun);
|
||||
$("#shouxu").html(result.data._shouxu);
|
||||
$("#num").html(result.data._num);
|
||||
|
||||
$("#chujin").html(result.data.chujin);
|
||||
$("#rujin").html(result.data.rujin);
|
||||
$("#lock").html(result.data.lock);
|
||||
$("#locklage").html(result.data.locklage);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//用户管理
|
||||
table.render({
|
||||
elem: '#LAY-user-manage'
|
||||
, method: 'post'
|
||||
, url: '/agent/order/list'
|
||||
, cols: [[
|
||||
{ type: 'checkbox', fixed: 'left' }
|
||||
, { field: 'id', width: 60, title: 'ID', sort: true }
|
||||
, { field: 'user_name', title: '用户名', minWidth: 150, event: "getsons", style: "color: #fff;background-color: #5FB878;" }
|
||||
, { field: 'parent_agent_name', title: '上级代理商', width: 120 }
|
||||
, { field: 'agent_level', title: '等级', width: 100 }
|
||||
, { field: 'type', title: '交易类型', width: 90, templet: '#lockTpl' }
|
||||
, { field: 'status', title: '当前状态', sort: true, width: 170, templet: '#addsonTpl' }
|
||||
, { field: 'origin_price', title: '原始价格', width: 120 }
|
||||
, { field: 'price', title: '开仓价格', width: 120 }
|
||||
, { field: 'update_price', title: '当前价格', width: 120 }
|
||||
, { field: 'fact_profits', title: '最终盈亏', width: 120 }
|
||||
, { field: 'share', title: '手数', sort: true, width: 90 }
|
||||
, { field: 'multiple', title: '倍数', sort: true, width: 90 }
|
||||
, { field: 'origin_caution_money', title: '初始保证金', width: 120 }
|
||||
, { field: 'caution_money', title: '当前可用保证金', sort: true, width: 170 }
|
||||
, { field: 'create_time', title: '创建时间', width: 170 }
|
||||
, { field: 'update_time', title: '价格刷新时间', sort: true, width: 170 }
|
||||
, { field: 'handle_time', title: '平仓时间', sort: true, width: 170 }
|
||||
, { field: 'complete_time', title: '完成时间', width: 170 }
|
||||
]]
|
||||
, page: true
|
||||
, limit: 30
|
||||
, height: 'full-320'
|
||||
, text: '对不起,加载出现异常!'
|
||||
, headers: { //通过 request 头传递
|
||||
access_token: layui.data('layuiAdmin').access_token
|
||||
}
|
||||
, where: { //通过参数传递
|
||||
access_token: layui.data('layuiAdmin').access_token
|
||||
}
|
||||
, done: function (res) { //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
if (res !== 0) {
|
||||
if (res.code === 1001) {
|
||||
//清空本地记录的 token,并跳转到登入页
|
||||
admin.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//导出表格
|
||||
|
||||
// table.on('tool(userlist)', function (obj) { //注:tool是工具条事件名,test是table原始容器的属性 lay-filter="对应的值"
|
||||
//// var data = obj.data;
|
||||
// var layEvent = obj.event;
|
||||
// var tr = obj.tr;
|
||||
// if (layEvent === 'excel')
|
||||
// {
|
||||
// layer_show('编辑会员','{{url('agent/order/order_excel')}}');
|
||||
// }
|
||||
//
|
||||
// });
|
||||
|
||||
|
||||
//监听工具条
|
||||
table.on('tool(LAY-user-manage)', function (obj) {
|
||||
var data = obj.data;
|
||||
if (obj.event === 'getsons') {
|
||||
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: '/agent/get_order_account',
|
||||
dataType: "json",
|
||||
data: { username: data.phone },
|
||||
done: function (result) { //返回数据根据结果进行相应的处理
|
||||
$("#all").html(result.data._all);
|
||||
$("#toucun").html(result.data._toucun);
|
||||
$("#shouxu").html(result.data._shouxu);
|
||||
$("#num").html(result.data._num);
|
||||
|
||||
$("#chujin").html(result.data.chujin);
|
||||
$("#rujin").html(result.data.rujin);
|
||||
$("#lock").html(result.data.lock);
|
||||
$("#locklage").html(result.data.locklage);
|
||||
}
|
||||
});
|
||||
|
||||
//执行重载
|
||||
table.reload('LAY-user-manage', {
|
||||
where: {
|
||||
username: data.phone
|
||||
}
|
||||
, page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
, done: function (res) { //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
if (res !== 0) {
|
||||
if (res.code === 1001) {
|
||||
//清空本地记录的 token,并跳转到登入页
|
||||
admin.exit();
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
form.render(null, 'layadmin-userfront-formlist');
|
||||
|
||||
//监听搜索
|
||||
form.on('submit(LAY-user-front-search)', function (data) {
|
||||
var field = data.field;
|
||||
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: '/agent/get_order_account',
|
||||
dataType: "json",
|
||||
data: field,
|
||||
done: function (result) { //返回数据根据结果进行相应的处理
|
||||
$("#all").html(result.data._all);
|
||||
$("#toucun").html(result.data._toucun);
|
||||
$("#shouxu").html(result.data._shouxu);
|
||||
$("#num").html(result.data._num);
|
||||
|
||||
$("#chujin").html(result.data.chujin);
|
||||
$("#rujin").html(result.data.rujin);
|
||||
$("#lock").html(result.data.lock);
|
||||
$("#locklage").html(result.data.locklage);
|
||||
}
|
||||
});
|
||||
|
||||
//执行重载
|
||||
table.reload('LAY-user-manage', {
|
||||
where: field
|
||||
, page: {
|
||||
curr: 1 //重新从第 1 页开始
|
||||
}
|
||||
, done: function (res) { //这里要说明一下:done 是只有 response 的 code 正常才会执行。而 succese 则是只要 http 为 200 就会执行
|
||||
|
||||
if (res.code === 1001) {
|
||||
//清空本地记录的 token,并跳转到登入页
|
||||
admin.exit();
|
||||
}
|
||||
|
||||
if (res.code === 1) {
|
||||
layer.msg(res.msg, { icon: 5 });
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
//事件
|
||||
var active = {
|
||||
batchdel: function () {
|
||||
var checkStatus = table.checkStatus('LAY-user-manage')
|
||||
, checkData = checkStatus.data; //得到选中的数据
|
||||
|
||||
if (checkData.length === 0) {
|
||||
return layer.msg('请选择数据');
|
||||
}
|
||||
|
||||
layer.prompt({
|
||||
formType: 1
|
||||
, title: '敏感操作,请验证口令'
|
||||
}, function (value, index) {
|
||||
layer.close(index);
|
||||
|
||||
layer.confirm('确定删除吗?', function (index) {
|
||||
|
||||
//执行 Ajax 后重载
|
||||
/*
|
||||
admin.req({
|
||||
url: 'xxx'
|
||||
//,……
|
||||
});
|
||||
*/
|
||||
table.reload('LAY-user-manage');
|
||||
layer.msg('已删除');
|
||||
});
|
||||
});
|
||||
}
|
||||
, add: function () {
|
||||
layer.prompt({ title: '请输入下级代理商帐号', formType: 0, btn: ['查询该用户', '取消'] }, function (value, index) {
|
||||
layer.close(index);
|
||||
if (value.length == 0) {
|
||||
layer.msg('用户名不能位空', { icon: 5 });
|
||||
} else {
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: '/agent/searchuser',
|
||||
dataType: "json",
|
||||
data: { username: value },
|
||||
done: function (result) { //返回数据根据结果进行相应的处理
|
||||
admin.popup({
|
||||
title: '添加代理商'
|
||||
, area: ['800px', '650px']
|
||||
, id: 'LAY-popup-user-add'
|
||||
, success: function (layer, index) {
|
||||
view(this.id).render('user/user/userform', result.data).done(function () {
|
||||
form.render(null, 'layuiadmin-form-useradmin'); //渲染表单
|
||||
//监听提交
|
||||
form.on('submit(LAY-user-front-submit)', function (data) {
|
||||
var field = data.field; //获取提交的字段
|
||||
admin.req({
|
||||
type: "POST",
|
||||
url: '/agent/addagent',
|
||||
dataType: "json",
|
||||
data: field,
|
||||
done: function (result) { //返回数据根据结果进行相应的处理
|
||||
console.log(result);
|
||||
layui.layer.msg(result.msg, { icon: 6 });
|
||||
//提交 Ajax 成功后,关闭当前弹层并重载表格
|
||||
layui.table.reload('LAY-user-manage'); //重载表格
|
||||
layui.layer.close(index); //执行关闭
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
$('.layui-btn.layuiadmin-btn-useradmin').on('click', function () {
|
||||
var type = $(this).data('type');
|
||||
active[type] ? active[type].call(this) : '';
|
||||
});
|
||||
$('.dao').click(function () {
|
||||
let token = localStorage.getItem('layuiAdmin');
|
||||
token = JSON.parse(token);
|
||||
let tokens = token.access_token;
|
||||
console.log(window.location)
|
||||
window.location.href = "/order/order_excel?access_token" + tokens;
|
||||
|
||||
// $.ajax({
|
||||
// url:'/order/order_excel',
|
||||
// type:'get',
|
||||
// data:{
|
||||
// access_token:tokens
|
||||
// },
|
||||
// headers:{"access_token": tokens},
|
||||
// success: function (res) {
|
||||
// alert(55);
|
||||
// window.location.href="/order/order_excel"
|
||||
// }
|
||||
//
|
||||
// })
|
||||
})
|
||||
|
||||
});
|
||||
//function excel() {
|
||||
//
|
||||
//
|
||||
//}
|
||||
</script>
|
||||
Reference in New Issue
Block a user