customized.html 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322
  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/customized')}">
  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/customized')}">清空</a>
  75. <if condition="$is_admin eq 1">
  76. <a class="btn btn-warning margin-left-10" href="{:url('admin/pools/export',['type'=>5])}">导出</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-danger btn-sm" onclick="doDelete()">批量移除</a>
  84. </div>
  85. <table class="table table-hover table-bordered">
  86. <thead>
  87. <tr>
  88. <th width="60"><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x">全选</th>
  89. <th>ID</th>
  90. <th width="120">用户名</th>
  91. <th>基本资料</th>
  92. <th>姓名</th>
  93. <th>手机号</th>
  94. <th width="100">VIP会员</th>
  95. <th width="100">充值过</th>
  96. <th width="100">消费过</th>
  97. <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>
  98. <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>
  99. </tr>
  100. </thead>
  101. <tbody>
  102. <foreach name="list" item="vo">
  103. <tr>
  104. <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]"
  105. value="{$vo.id}" data-id="{$vo.user_id}" title="ID:{$vo.id}"></td>
  106. <td>{$vo.user_id}</td>
  107. <td>
  108. <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>
  109. </td>
  110. <td>
  111. <p class="profile">{$vo.profile_text}</p>
  112. </td>
  113. <td>{$vo['real_name']}</td>
  114. <td>{$vo['mobile']? $vo['mobile']:'无'}</td>
  115. <td>
  116. <if condition="$vo['is_vip'] eq 1">
  117. <span style="color: green;">是</span>
  118. <else>
  119. <span style="color: red;">否</span>
  120. </if>
  121. </td>
  122. <td>
  123. <if condition="$vo['is_recharge'] eq 1">
  124. <span style="color: green;">是</span>
  125. <else>
  126. <span style="color: red;">否</span>
  127. </if>
  128. </td>
  129. <td>
  130. <if condition="$vo['is_cost'] eq 1">
  131. <span style="color: green;">是</span>
  132. <else>
  133. <span style="color: red;">否</span>
  134. </if>
  135. </td>
  136. <td>{$vo['create_time']}</td>
  137. <td>{$vo['last_login_time']}</td>
  138. </foreach>
  139. </tbody>
  140. </table>
  141. <div class="pagination">{$page}</div>
  142. <div id="distribute" style="display: none; margin-top: 20px;">
  143. <div class="form">
  144. <form method="post" class="form-horizontal js-ajax-form margin-top-20" >
  145. <div class="form-group">
  146. <label class="col-sm-3 control-label"><span class="form-required">*</span>分配给销售</label>
  147. <div class="col-sm-6">
  148. <select class="form-control" id="sale" onchange="selectSale(this)">
  149. <option value="0">请选择</option>
  150. <foreach name="sales" item="vo">
  151. <option value="{$vo.id}">{$vo.user_login}<if condition="$vo.real_name">[{$vo.real_name}]</if></option>
  152. </foreach>
  153. </select>
  154. </div>
  155. </div>
  156. <div class="form-group">
  157. <label class="col-sm-3 control-label"><span class="form-required"></span>到期时间(天)</label>
  158. <div class="col-sm-8">
  159. <input type="text" class="form-control" id="expire_at" name="expire_at" placeholder="默认取平台设置">
  160. </div>
  161. </div>
  162. </form>
  163. </div>
  164. </div>
  165. </form>
  166. </div>
  167. <script src="__STATIC__/js/admin.js"></script>
  168. <script src="__STATIC__/js/clipboard.min.js"></script>
  169. <script src="__STATIC__/js/layer/layer.js"></script>
  170. <script src="__STATIC__/js/position/position1.js" type="text/javascript"></script>
  171. <script src="__STATIC__/js/height/height.js" type="text/javascript"></script>
  172. <script>
  173. var saleUid = 0;
  174. /**
  175. * 排序
  176. * @param type
  177. */
  178. function sort(ele,type){
  179. $("#sort").val(type);
  180. var status = $(ele).attr('data-status');
  181. $("#sortType").val(status=='desc'? 'asc': 'desc');
  182. $(ele).html(status == 'desc'? '&#8595;' : '&#8593;');
  183. $(ele).attr('data-status', status=='desc'? 'asc': 'desc');
  184. $("#search").submit();
  185. }
  186. /**
  187. * 选择销售用户
  188. * @param ele
  189. */
  190. function selectSale(ele){
  191. saleUid = $(ele).val();
  192. }
  193. /**
  194. * 分配资源
  195. * @returns {boolean}
  196. */
  197. function doDistribute(){
  198. var ids = [];
  199. $(".js-check:checked").each(function () {
  200. var id = $(this).attr('data-id');
  201. if (id > 0) {
  202. ids.push(id);
  203. }
  204. });
  205. if (ids.length <= 0) {
  206. layer.msg('请先选择操作项');
  207. return false;
  208. }
  209. layer.open({
  210. type: 1, //1:页面层,2:iframe层,3:加载层,4:tips层。
  211. title: '分配'+(ids.length)+'个资源给销售',
  212. shadeClose: false, //不开启遮罩关闭,也就是说,点击弹出层其它地方不会关闭弹出框
  213. shade: 0.8, //遮罩
  214. offset: 'auto',
  215. area: ['480px', '260px'],
  216. content: $("#distribute"),
  217. btn: ['确定分配','取消'],
  218. btnAlign: 'c',
  219. yes: function(){
  220. if(saleUid<=0){
  221. layer.msg('请选择分配的销售用户')
  222. return false;
  223. }
  224. var expire_at = $("#expire_at").val();
  225. if (confirm('确定批量分配选择项?不可恢复')) {
  226. $.post('/admin/pools/distribute', {ids: ids, sale_uid: saleUid, expire_at: expire_at, type: 2}, function (res) {
  227. if (res.code == 1) {
  228. layer.msg(res.msg)
  229. setTimeout(function () {
  230. location.reload();
  231. }, 2000)
  232. } else {
  233. layer.msg(res.msg);
  234. }
  235. }, "json")
  236. }
  237. },
  238. cancel: function(){
  239. }
  240. });
  241. return false;
  242. }
  243. /**
  244. * 批量移动
  245. */
  246. function doMove(type){
  247. var ids = [];
  248. $(".js-check:checked").each(function () {
  249. var id = $(this).val();
  250. if (id > 0) {
  251. ids.push(id);
  252. }
  253. });
  254. if (ids.length <= 0) {
  255. layer.msg('请选择操作的资源选项')
  256. return false;
  257. }
  258. if (confirm('确定批量移动选择的资源?不可恢复')) {
  259. $.post('/admin/pools/move', {ids: ids, type: type}, function (res) {
  260. if (res.code == 1) {
  261. layer.msg(res.msg)
  262. setTimeout(function () {
  263. location.reload();
  264. }, 800)
  265. } else {
  266. layer.msg(res.msg)
  267. }
  268. }, "json")
  269. }
  270. }
  271. /**
  272. * 清除
  273. * @returns {boolean}
  274. */
  275. function doDelete() {
  276. var ids = [];
  277. $(".js-check:checked").each(function () {
  278. var id = $(this).val();
  279. if (id > 0) {
  280. ids.push(id);
  281. }
  282. });
  283. if (ids.length <= 0) {
  284. layer.msg('请先选择操作项');
  285. return false;
  286. }
  287. if (confirm('确定批量移除选择项到资源公海?不可恢复')) {
  288. $.post('/admin/pools/clear', {ids: ids, type: 5}, function (res) {
  289. if (res.code == 1) {
  290. layer.msg(res.msg)
  291. setTimeout(function () {
  292. location.reload();
  293. }, 1200)
  294. } else {
  295. layer.msg(res.msg)
  296. }
  297. }, "json")
  298. }
  299. }
  300. </script>
  301. </body>
  302. </html>