customized.html 11 KB

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