house_users.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <script>
  2. var pageNo=1;
  3. $(function(){
  4. $("aside>ul>li").eq(9).find("a").css({"background":"#00C1DE"})
  5. $("aside>ul>li").eq(9).siblings('li').find("a").css({"background":"#42485B"})
  6. var mainHeight = $(window).height()-320+"px";
  7. $(".scrollTable").css({"max-height":mainHeight});
  8. loadPages();
  9. })
  10. /*获取页数*/
  11. function loadPages() {
  12. $.post("getUserList.do",{"mobile":$("#mobile").val()},function(resp) {
  13. $('.page').empty();
  14. var totalCnt = resp.data.totalCnt;
  15. var GG = {
  16. "kk":function(dd){
  17. pageNo = dd;
  18. loadData();
  19. $(".page").prepend("<span class=\"page_all\">共&nbsp;"+resp.data.totalCnt+"&nbsp;条</span>");
  20. }
  21. }
  22. $("#page").initPage(totalCnt,1,GG.kk);
  23. });
  24. }
  25. /*获取数据*/
  26. function loadData() {
  27. $.post("getUserList.do",{"page":pageNo,"mobile":$("#mobile").val()}, function(resp){
  28. $("#bodyData").empty();
  29. var listArray = resp.data.list;
  30. for (var i=0;i<listArray.length;i++) {
  31. var item = listArray[i];
  32. var line = "<tr><td>"+((item.nickname == null)?"":item.nickname)+"</td>"
  33. +"<td>"+((item.nickname == null)?"":item.nickname)+"</td>"
  34. +"<td>"+((item.mobile == null)?"":item.mobile)+"</td>"
  35. +"<td>"
  36. +"<a href=\"javascript:lookAmtDetail("+item.id+")\">余额详情</a>"
  37. +"<a href=\"javascript:lookHistoryOrder("+item.id+")\">历史订单</a>"
  38. +"</td>"
  39. +"</tr>";
  40. $("#bodyData").append(line);
  41. }
  42. });
  43. }
  44. /*余额详情*/
  45. function lookAmtDetail(userId){
  46. location.href="#/amtDetail:&userId="+userId;
  47. }
  48. /*活跃*/
  49. function lookActive(userId){
  50. location.href="#/active&userId="+userId;
  51. }
  52. /*历史订单*/
  53. function lookHistoryOrder(userId){
  54. location.href="#/historyOrder:&userId="+userId;
  55. }
  56. </script>
  57. <div class="section">
  58. <div class="section_top">
  59. <p>
  60. <a>用户管理</a>
  61. </p>
  62. </div>
  63. <div class="add_item">
  64. <button onclick="loadData()" class="pull-right btn btn-default blackborder btn_search">搜索</button>
  65. <input id="mobile" class="pull-right inputKeyword" placeholder="请输入手机号搜索" type="text"/>
  66. </div>
  67. <div class="information">
  68. <div class="scrollTable">
  69. <table class="table table-striped table-bordered table-hover">
  70. <thead>
  71. <tr style="background:#ededed;">
  72. <th>用户名</th>
  73. <th>昵称</th>
  74. <th>手机号</th>
  75. <th>操作</th>
  76. </tr>
  77. </thead>
  78. <tbody id="bodyData" class="td_btn">
  79. </tbody>
  80. </table>
  81. </div>
  82. <ul class="page" maxshowpageitem="5" pagelistcount="15" id="page"></ul>
  83. </div>
  84. </div>
  85. <script>
  86. var mainHeight = $(window).height()-320+"px";
  87. $(".scrollTable").css({"max-height":mainHeight});
  88. </script>