reserve.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324
  1. <include file="public@header"/>
  2. </head>
  3. <style>
  4. .form-inline .form-control {
  5. margin: 10px 0;
  6. vertical-align: middle;
  7. }
  8. .form-inline span {
  9. margin-left: 5px;
  10. vertical-align: middle;
  11. }
  12. .margin-left-10 {
  13. margin-left: 10px;
  14. }
  15. .profile em {
  16. font-style: normal;
  17. color: #0b6cbc;
  18. }
  19. .profile em.red {
  20. color: red;
  21. }
  22. span.sort {
  23. color: red;
  24. display: inline-block;
  25. margin-left: 2px;
  26. vertical-align: middle;
  27. }
  28. td img.avatar, td img.sex {
  29. width: 24px;
  30. height: 24px;
  31. vertical-align: middle;
  32. border-radius: 100%;
  33. }
  34. .form .form-control {
  35. margin-bottom: 20px;
  36. }
  37. .form .control-label {
  38. text-align: center;
  39. }
  40. .table-actions span {
  41. margin-right: 10px;
  42. font-weight: bold;
  43. }
  44. .table-actions span em {
  45. font-style: normal;
  46. color: red;
  47. }
  48. .layui-layer-page .layui-layer-content {
  49. overflow: hidden !important;
  50. }
  51. </style>
  52. <body>
  53. <div class="wrap js-check-wrap">
  54. <ul class="nav nav-tabs">
  55. <li class="active"><a>储备用户列表</a>
  56. </li>
  57. </ul>
  58. <form id="search" class="well form-inline margin-top-20" method="post" action="{:url('admin/pools/reserve')}">
  59. <span>会员ID:</span>
  60. <input class="form-control" type="text" name="uid" style="width: 150px;" value="{:input('request.uid')}"
  61. placeholder="会员ID">
  62. <span>用户昵称:</span>
  63. <input class="form-control" type="text" name="user_nickname" style="width: 200px;"
  64. value="{:input('request.user_nickname')}" placeholder="用户昵称"><br>
  65. <span>用户姓名:</span>
  66. <input class="form-control" type="text" name="real_name" style="width: 200px;"
  67. value="{:input('request.real_name')}" placeholder="用户姓名">
  68. <span>手机号:</span>
  69. <input class="form-control" type="text" name="mobile" style="width: 200px;" value="{:input('request.mobile')}"
  70. placeholder="手机号">
  71. <input id="sort" type="hidden" name="sort" value="{$params.sort?$params.sort: 1}">
  72. <input id="sortType" type="hidden" name="sort_type" value="{$params.sort_type?$params.sort_type: 'desc'}">
  73. <input type="submit" class="btn btn-primary margin-left-10 " value="搜索"/>
  74. <a class="btn btn-default margin-left-10" href="{:url('admin/pools/reserve')}">清空</a>
  75. <if condition="$is_admin eq 1">
  76. <a class="btn btn-warning margin-left-10" href="{:url('admin/pools/export',['type'=>3])}">导出</a>
  77. </if>
  78. </form>
  79. <form class="form-horizontal js-ajax-form margin-top-20" role="form">
  80. <div class="table-actions">
  81. <span>共计<em>{$total}</em>个资源</span>
  82. <a class="btn btn-primary btn-sm" onclick="doDistribute()">分配用户</a>
  83. <a class="btn btn-primary btn-sm" onclick="doMove(2)">移到资源公海</a>
  84. <a class="btn btn-primary btn-sm" onclick="doMove(5)">移到已开启服务</a>
  85. <a class="btn btn-danger btn-sm" onclick="doDelete()">批量移除</a>
  86. </div>
  87. <table class="table table-hover table-bordered">
  88. <thead>
  89. <tr>
  90. <th width="60"><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  91. <th>ID</th>
  92. <th width="120">用户名</th>
  93. <th>基本资料</th>
  94. <th>姓名</th>
  95. <th>手机号</th>
  96. <th width="100">VIP会员</th>
  97. <th width="100">充值过</th>
  98. <th width="100">消费过</th>
  99. <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'">&#8595;<else>&#8593;</if></span></th>
  100. <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'">&#8595;<else>&#8593;</if></span></th>
  101. </tr>
  102. </thead>
  103. <tbody>
  104. <foreach name="list" item="vo">
  105. <tr>
  106. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  107. value="{$vo.id}" data-id="{$vo.user_id}" title="ID:{$vo.id}"></td>
  108. <td>{$vo.user_id}</td>
  109. <td>
  110. <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>
  111. </td>
  112. <td>
  113. <p class="profile">{$vo.profile_text}</p>
  114. </td>
  115. <td>{$vo['real_name']}</td>
  116. <td>{$vo['mobile']? $vo['mobile']:'无'}</td>
  117. <td>
  118. <if condition="$vo['is_vip'] eq 1">
  119. <span style="color: green;">是</span>
  120. <else>
  121. <span style="color: red;">否</span>
  122. </if>
  123. </td>
  124. <td>
  125. <if condition="$vo['is_recharge'] eq 1">
  126. <span style="color: green;">是</span>
  127. <else>
  128. <span style="color: red;">否</span>
  129. </if>
  130. </td>
  131. <td>
  132. <if condition="$vo['is_cost'] eq 1">
  133. <span style="color: green;">是</span>
  134. <else>
  135. <span style="color: red;">否</span>
  136. </if>
  137. </td>
  138. <td>{$vo['create_time']}</td>
  139. <td>{$vo['last_login_time']}</td>
  140. </foreach>
  141. </tbody>
  142. </table>
  143. <div class="pagination">{$page}</div>
  144. <div id="distribute" style="display: none; margin-top: 20px;">
  145. <div class="form">
  146. <form method="post" class="form-horizontal js-ajax-form margin-top-20" >
  147. <div class="form-group">
  148. <label class="col-sm-3 control-label"><span class="form-required">*</span>分配给销售</label>
  149. <div class="col-sm-6">
  150. <select class="form-control" id="sale" onchange="selectSale(this)">
  151. <option value="0">请选择</option>
  152. <foreach name="sales" item="vo">
  153. <option value="{$vo.id}">{$vo.user_login}<if condition="$vo.real_name">[{$vo.real_name}]</if></option>
  154. </foreach>
  155. </select>
  156. </div>
  157. </div>
  158. <div class="form-group">
  159. <label class="col-sm-3 control-label"><span class="form-required"></span>到期时间(天)</label>
  160. <div class="col-sm-8">
  161. <input type="text" class="form-control" id="expire_at" name="expire_at" placeholder="默认取平台设置">
  162. </div>
  163. </div>
  164. </form>
  165. </div>
  166. </div>
  167. </form>
  168. </div>
  169. <script src="__STATIC__/js/admin.js"></script>
  170. <script src="__STATIC__/js/clipboard.min.js"></script>
  171. <script src="__STATIC__/js/layer/layer.js"></script>
  172. <script src="__STATIC__/js/position/position1.js" type="text/javascript"></script>
  173. <script src="__STATIC__/js/height/height.js" type="text/javascript"></script>
  174. <script>
  175. var saleUid = 0;
  176. /**
  177. * 排序
  178. * @param type
  179. */
  180. function sort(ele,type){
  181. $("#sort").val(type);
  182. var status = $(ele).attr('data-status');
  183. $("#sortType").val(status=='desc'? 'asc': 'desc');
  184. $(ele).html(status == 'desc'? '&#8595;' : '&#8593;');
  185. $(ele).attr('data-status', status=='desc'? 'asc': 'desc');
  186. $("#search").submit();
  187. }
  188. /**
  189. * 选择销售用户
  190. * @param ele
  191. */
  192. function selectSale(ele){
  193. saleUid = $(ele).val();
  194. }
  195. /**
  196. * 分配资源
  197. * @returns {boolean}
  198. */
  199. function doDistribute(){
  200. var ids = [];
  201. $(".js-check:checked").each(function () {
  202. var id = $(this).attr('data-id');
  203. if (id > 0) {
  204. ids.push(id);
  205. }
  206. });
  207. if (ids.length <= 0) {
  208. layer.msg('请先选择操作项');
  209. return false;
  210. }
  211. layer.open({
  212. type: 1, //1:页面层,2:iframe层,3:加载层,4:tips层。
  213. title: '分配'+(ids.length)+'个资源给销售',
  214. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  215. shade: 0.8, //遮罩
  216. offset: 'auto',
  217. area: ['480px', '260px'],
  218. content: $("#distribute"),
  219. btn: ['确定分配','取消'],
  220. btnAlign: 'c',
  221. yes: function(){
  222. if(saleUid<=0){
  223. layer.msg('请选择分配的销售用户')
  224. return false;
  225. }
  226. var expire_at = $("#expire_at").val();
  227. if (confirm('确定批量分配选择项?不可恢复')) {
  228. $.post('/admin/pools/distribute', {ids: ids, sale_uid: saleUid, expire_at: expire_at, type: 3}, function (res) {
  229. if (res.code == 1) {
  230. layer.msg(res.msg)
  231. setTimeout(function () {
  232. location.reload();
  233. }, 2000)
  234. } else {
  235. layer.msg(res.msg);
  236. }
  237. }, "json")
  238. }
  239. },
  240. cancel: function(){
  241. }
  242. });
  243. return false;
  244. }
  245. /**
  246. * 批量移动
  247. */
  248. function doMove(type){
  249. var ids = [];
  250. $(".js-check:checked").each(function () {
  251. var id = $(this).val();
  252. if (id > 0) {
  253. ids.push(id);
  254. }
  255. });
  256. if (ids.length <= 0) {
  257. layer.msg('请选择操作的资源选项')
  258. return false;
  259. }
  260. if (confirm('确定批量移动选择的资源?不可恢复')) {
  261. $.post('/admin/pools/move', {ids: ids, type: type}, function (res) {
  262. if (res.code == 1) {
  263. layer.msg(res.msg)
  264. setTimeout(function () {
  265. location.reload();
  266. }, 800)
  267. } else {
  268. layer.msg(res.msg)
  269. }
  270. }, "json")
  271. }
  272. }
  273. /**
  274. * 清除
  275. * @returns {boolean}
  276. */
  277. function doDelete() {
  278. var ids = [];
  279. $(".js-check:checked").each(function () {
  280. var id = $(this).val();
  281. if (id > 0) {
  282. ids.push(id);
  283. }
  284. });
  285. if (ids.length <= 0) {
  286. layer.msg('请先选择操作项');
  287. return false;
  288. }
  289. if (confirm('确定批量移除选择项到售前公海?不可恢复')) {
  290. $.post('/admin/pools/clear', {ids: ids, type: 3}, function (res) {
  291. if (res.code == 1) {
  292. layer.msg(res.msg)
  293. setTimeout(function () {
  294. location.reload();
  295. }, 1200)
  296. } else {
  297. layer.msg(res.msg)
  298. }
  299. }, "json")
  300. }
  301. }
  302. </script>
  303. </body>
  304. </html>