| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322 |
- <include file="public@header"/>
- </head>
- <style>
- .form-inline .form-control {
- margin: 10px 0;
- vertical-align: middle;
- }
- .form-inline span {
- margin-left: 5px;
- vertical-align: middle;
- }
- .margin-left-10 {
- margin-left: 10px;
- }
- .profile em {
- font-style: normal;
- color: #0b6cbc;
- }
- .profile em.red {
- color: red;
- }
- span.sort {
- color: red;
- display: inline-block;
- margin-left: 2px;
- vertical-align: middle;
- }
- td img.avatar, td img.sex {
- width: 24px;
- height: 24px;
- vertical-align: middle;
- border-radius: 100%;
- }
- .form .form-control {
- margin-bottom: 20px;
- }
- .form .control-label {
- text-align: center;
- }
- .table-actions span {
- margin-right: 10px;
- font-weight: bold;
- }
- .table-actions span em {
- font-style: normal;
- color: red;
- }
- .layui-layer-page .layui-layer-content {
- overflow: hidden !important;
- }
- </style>
- <body>
- <div class="wrap js-check-wrap">
- <ul class="nav nav-tabs">
- <li class="active"><a>已定制服务用户列表</a>
- </li>
- </ul>
- <form id="search" class="well form-inline margin-top-20" method="post" action="{:url('admin/pools/customized')}">
- <span>会员ID:</span>
- <input class="form-control" type="text" name="uid" style="width: 150px;" value="{:input('request.uid')}"
- placeholder="会员ID">
- <span>用户昵称:</span>
- <input class="form-control" type="text" name="user_nickname" style="width: 200px;"
- value="{:input('request.user_nickname')}" placeholder="用户昵称"><br>
- <span>用户姓名:</span>
- <input class="form-control" type="text" name="real_name" style="width: 200px;"
- value="{:input('request.real_name')}" placeholder="用户姓名">
- <span>手机号:</span>
- <input class="form-control" type="text" name="mobile" style="width: 200px;" value="{:input('request.mobile')}"
- placeholder="手机号">
- <input id="sort" type="hidden" name="sort" value="{$params.sort?$params.sort: 1}">
- <input id="sortType" type="hidden" name="sort_type" value="{$params.sort_type?$params.sort_type: 'desc'}">
- <input type="submit" class="btn btn-primary margin-left-10 " value="搜索"/>
- <a class="btn btn-default margin-left-10" href="{:url('admin/pools/customized')}">清空</a>
- <if condition="$is_admin eq 1">
- <a class="btn btn-warning margin-left-10" href="{:url('admin/pools/export',['type'=>5])}">导出</a>
- </if>
- </form>
- <form class="form-horizontal js-ajax-form margin-top-20" role="form">
- <div class="table-actions">
- <span>共计<em>{$total}</em>个资源</span>
- <a class="btn btn-primary btn-sm" onclick="doDistribute()">分配用户</a>
- <a class="btn btn-danger btn-sm" onclick="doDelete()">批量移除</a>
- </div>
- <table class="table table-hover table-bordered">
- <thead>
- <tr>
- <th width="60"><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
- <th>ID</th>
- <th width="120">用户名</th>
- <th>基本资料</th>
- <th>姓名</th>
- <th>手机号</th>
- <th width="100">VIP会员</th>
- <th width="100">充值过</th>
- <th width="100">消费过</th>
- <th width="180">注册时间 <span class="row sort join-time" data-status="{$params.sort == 1? $params.sort_type : 'desc'}" onclick="sort(this,1)"><if condition="$params.sort eq 1 && $params.sort_type eq 'asc'">↓<else>↑</if></span></th>
- <th width="150">最后登录<span class="row sort last-time" data-status="{$params.sort == 2? $params.sort_type : 'desc'}" onclick="sort(this,2)"><if condition="$params.sort eq 2 && $params.sort_type eq 'asc'">↓<else>↑</if></span></th>
- </tr>
- </thead>
- <tbody>
- <foreach name="list" item="vo">
- <tr>
- <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
- value="{$vo.id}" data-id="{$vo.user_id}" title="ID:{$vo.id}"></td>
- <td>{$vo.user_id}</td>
- <td>
- <a href="{:url('admin/pools/info',['id'=> $vo.user_id])}"><img class="avatar" src="{$vo.avatar}"> <if condition="$vo['sex'] eq 1"><img class="sex" src="/static/images/male.png" alt=""><else><img class="sex" src="/static/images/fmale.png" alt=""></if> <span>{$vo['user_nickname']}</span></a>
- </td>
- <td>
- <p class="profile">{$vo.profile_text}</p>
- </td>
- <td>{$vo['real_name']}</td>
- <td>{$vo['mobile']? $vo['mobile']:'无'}</td>
- <td>
- <if condition="$vo['is_vip'] eq 1">
- <span style="color: green;">是</span>
- <else>
- <span style="color: red;">否</span>
- </if>
- </td>
- <td>
- <if condition="$vo['is_recharge'] eq 1">
- <span style="color: green;">是</span>
- <else>
- <span style="color: red;">否</span>
- </if>
- </td>
- <td>
- <if condition="$vo['is_cost'] eq 1">
- <span style="color: green;">是</span>
- <else>
- <span style="color: red;">否</span>
- </if>
- </td>
- <td>{$vo['create_time']}</td>
- <td>{$vo['last_login_time']}</td>
- </foreach>
- </tbody>
- </table>
- <div class="pagination">{$page}</div>
- <div id="distribute" style="display: none; margin-top: 20px;">
- <div class="form">
- <form method="post" class="form-horizontal js-ajax-form margin-top-20" >
- <div class="form-group">
- <label class="col-sm-3 control-label"><span class="form-required">*</span>分配给销售</label>
- <div class="col-sm-6">
- <select class="form-control" id="sale" onchange="selectSale(this)">
- <option value="0">请选择</option>
- <foreach name="sales" item="vo">
- <option value="{$vo.id}">{$vo.user_login}<if condition="$vo.real_name">[{$vo.real_name}]</if></option>
- </foreach>
- </select>
- </div>
- </div>
- <div class="form-group">
- <label class="col-sm-3 control-label"><span class="form-required"></span>到期时间(天)</label>
- <div class="col-sm-8">
- <input type="text" class="form-control" id="expire_at" name="expire_at" placeholder="默认取平台设置">
- </div>
- </div>
- </form>
- </div>
- </div>
- </form>
- </div>
- <script src="__STATIC__/js/admin.js"></script>
- <script src="__STATIC__/js/clipboard.min.js"></script>
- <script src="__STATIC__/js/layer/layer.js"></script>
- <script src="__STATIC__/js/position/position1.js" type="text/javascript"></script>
- <script src="__STATIC__/js/height/height.js" type="text/javascript"></script>
- <script>
- var saleUid = 0;
- /**
- * 排序
- * @param type
- */
- function sort(ele,type){
- $("#sort").val(type);
- var status = $(ele).attr('data-status');
- $("#sortType").val(status=='desc'? 'asc': 'desc');
- $(ele).html(status == 'desc'? '↓' : '↑');
- $(ele).attr('data-status', status=='desc'? 'asc': 'desc');
- $("#search").submit();
- }
- /**
- * 选择销售用户
- * @param ele
- */
- function selectSale(ele){
- saleUid = $(ele).val();
- }
- /**
- * 分配资源
- * @returns {boolean}
- */
- function doDistribute(){
- var ids = [];
- $(".js-check:checked").each(function () {
- var id = $(this).attr('data-id');
- if (id > 0) {
- ids.push(id);
- }
- });
- if (ids.length <= 0) {
- layer.msg('请先选择操作项');
- return false;
- }
- layer.open({
- type: 1, //1:页面层,2:iframe层,3:加载层,4:tips层。
- title: '分配'+(ids.length)+'个资源给销售',
- shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
- shade: 0.8, //遮罩
- offset: 'auto',
- area: ['480px', '260px'],
- content: $("#distribute"),
- btn: ['确定分配','取消'],
- btnAlign: 'c',
- yes: function(){
- if(saleUid<=0){
- layer.msg('请选择分配的销售用户')
- return false;
- }
- var expire_at = $("#expire_at").val();
- if (confirm('确定批量分配选择项?不可恢复')) {
- $.post('/admin/pools/distribute', {ids: ids, sale_uid: saleUid, expire_at: expire_at, type: 2}, function (res) {
- if (res.code == 1) {
- layer.msg(res.msg)
- setTimeout(function () {
- location.reload();
- }, 2000)
- } else {
- layer.msg(res.msg);
- }
- }, "json")
- }
- },
- cancel: function(){
- }
- });
- return false;
- }
- /**
- * 批量移动
- */
- function doMove(type){
- var ids = [];
- $(".js-check:checked").each(function () {
- var id = $(this).val();
- if (id > 0) {
- ids.push(id);
- }
- });
- if (ids.length <= 0) {
- layer.msg('请选择操作的资源选项')
- return false;
- }
- if (confirm('确定批量移动选择的资源?不可恢复')) {
- $.post('/admin/pools/move', {ids: ids, type: type}, function (res) {
- if (res.code == 1) {
- layer.msg(res.msg)
- setTimeout(function () {
- location.reload();
- }, 800)
- } else {
- layer.msg(res.msg)
- }
- }, "json")
- }
- }
- /**
- * 清除
- * @returns {boolean}
- */
- function doDelete() {
- var ids = [];
- $(".js-check:checked").each(function () {
- var id = $(this).val();
- if (id > 0) {
- ids.push(id);
- }
- });
- if (ids.length <= 0) {
- layer.msg('请先选择操作项');
- return false;
- }
- if (confirm('确定批量移除选择项到资源公海?不可恢复')) {
- $.post('/admin/pools/clear', {ids: ids, type: 5}, function (res) {
- if (res.code == 1) {
- layer.msg(res.msg)
- setTimeout(function () {
- location.reload();
- }, 1200)
- } else {
- layer.msg(res.msg)
- }
- }, "json")
- }
- }
- </script>
- </body>
- </html>
|