171 lines
6.2 KiB
PHP
171 lines
6.2 KiB
PHP
@extends('merchant.layouts.base')
|
|
@section('add_css')
|
|
<style>
|
|
.layui-table-cell {
|
|
height: auto;
|
|
}
|
|
|
|
.layui-table-cell {
|
|
padding: 0 5px;
|
|
}
|
|
</style>
|
|
@endsection
|
|
@section('content')
|
|
|
|
<div class="layui-card">
|
|
|
|
<div class="layui-card-body">
|
|
<div style="padding-bottom: 10px;">
|
|
{{--<button class="layui-btn layuiadmin-btn-tophandel" data-type="batchdel">删除</button>--}}
|
|
<button class="layui-btn layuiadmin-btn-tophandel" data-type="add">添加</button>
|
|
</div>
|
|
<table id="LAY-list-table" lay-filter="LAY-list-table"></table>
|
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
@endsection
|
|
@section('add_js')
|
|
@include('merchant.layouts.layui_tpl')
|
|
@include('merchant.layouts.commonscript')
|
|
@verbatim
|
|
|
|
<script type="text/html" id="table-useradmin-admin2">
|
|
<a href="javascript:void(0)" lay-event="openLayer" data-w="100%" data-h="100%" data-url="{{ d.show_url }}"
|
|
data-title="查看详情" class="layui-btn layui-btn-default layui-btn-xs">
|
|
<i class="layui-icon layui-icon-file-b"></i>查看</a>
|
|
{{# if(d.check_status==2){ }}
|
|
<a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit"><i
|
|
class="layui-icon layui-icon-edit"></i>编辑</a>
|
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del"><i
|
|
class="layui-icon layui-icon-delete"></i>删除</a>
|
|
{{#} }}
|
|
|
|
</script>
|
|
<script type="text/html" id="true-false-table-switchTpl-tj">
|
|
{{# if(d.check_status==1){ }}
|
|
<input type="checkbox" name="sex" lay-skin="switch" lay-text="启用|禁用" lay-filter="test-table-checked"
|
|
value="{{ d.is_checked }}" data-field="is_checked" data-json="{{ encodeURIComponent(JSON.stringify(d)) }}" {{ d.is_checked == 1 ? 'checked' : '' }}>
|
|
{{#} }}
|
|
</script>
|
|
|
|
@endverbatim
|
|
<script>
|
|
listConfig.open_width = '800px';
|
|
|
|
layui.use(['index', 'table', 'listable'], function () {
|
|
var $ = layui.$
|
|
, form = layui.form
|
|
, listable = layui.listable
|
|
, table = layui.table;
|
|
var element = layui.element;
|
|
|
|
cols = [[
|
|
{type: 'checkbox', width: 60}
|
|
, {field: 'name', title: '名称', minWidth: 150}
|
|
, {field: 'level_name_label', width: 80, title: '身份'}
|
|
, {field: 'email', title: '邮箱', width: 150}
|
|
, {
|
|
field: 'ratio', title: '费率', style: 'color:#f60', width: 120, templet: function (d) {
|
|
return '<span class="text-red">' + ((d.ratio / 10)) + '%</span>'
|
|
}
|
|
},
|
|
{
|
|
field: 'next_ratio', title: '上级利润率', style: 'color:#1E9FFF', width: 120, templet: function (d) {
|
|
return '<span class="">' + (((d.ratio - d.next_ratio) / 10)) + '%</span>'
|
|
}
|
|
},
|
|
{field: 'money', title: '账号余额', minWidth: 150},
|
|
{
|
|
field: 'check_status_name2', title: '审核状态', width: 120, align: "center"
|
|
}
|
|
,
|
|
{
|
|
field: 'is_checked',
|
|
title: '通道状态',
|
|
align: "center",
|
|
templet: '#true-false-table-switchTpl-tj',
|
|
width: 150
|
|
}
|
|
, {
|
|
width: 250,
|
|
title: '操作',
|
|
align: 'center',
|
|
|
|
toolbar: '#table-useradmin-admin2'
|
|
}
|
|
]];
|
|
listable.list(listable_url, cols, {
|
|
where: {
|
|
from_id: "{{ merchant('id') }}",
|
|
is_all: "{{ request()->input('is_all',0) }}",
|
|
}
|
|
, parseData: function (res) { //res 即为原始返回的数据
|
|
console.log(res);
|
|
if (res.count == 0) {
|
|
if (res.level) {
|
|
res.msg = '暂无数据,<a class="layui-btn layui-btn-sm" id="noback" lay-event="soso" data-id="' + res.pid + '" data-level="' + res.level + '" data-pid="' + res.pid + '"><i class="layui-icon layui-icon-return"></i>返回</a>';
|
|
}
|
|
|
|
}
|
|
return {
|
|
"code": res.code, //解析接口状态
|
|
"msg": res.msg, //解析提示文本
|
|
"count": res.count, //解析数据长度
|
|
"data": res.data //解析数据列表
|
|
};
|
|
}
|
|
});
|
|
$(document).on('click', "#noback", function () {
|
|
var id = $(this).data('pid');
|
|
var level = $(this).data('level');
|
|
if (level == 3) {
|
|
level = 2;
|
|
}
|
|
if (id == 0) {
|
|
level = '';
|
|
}
|
|
|
|
//执行重载
|
|
table.reload('LAY-list-table', {
|
|
where: {
|
|
|
|
from_id: id,
|
|
level: level
|
|
|
|
}
|
|
});
|
|
});
|
|
extend_fun = function (obj, that) {
|
|
if (obj.event === 'soso') {
|
|
var level = that.data('level');
|
|
var id = that.data('id');
|
|
var pid = that.data('pid');
|
|
|
|
if (!level) {
|
|
id = '0';
|
|
}
|
|
if (id == 0) {
|
|
level = '';
|
|
}
|
|
//执行重载
|
|
table.reload('LAY-list-table', {
|
|
where: {
|
|
level: level,
|
|
from_id: id,
|
|
prev_id: pid
|
|
}
|
|
});
|
|
|
|
}
|
|
}
|
|
//监听表操作
|
|
listable.handle(extend_fun);
|
|
listable.top_handle()
|
|
|
|
|
|
});
|
|
</script>
|
|
@endsection |