zhenquery_mult.html 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124
  1. <div style='max-height:500px;overflow:auto;min-width:850px;'>
  2. <div class="input-group layui-row" style="margin:10px;">
  3. <input type="text" placeholder="请输入昵称进行搜索" id="select-url-kw" value="" class="form-control">
  4. <span class="input-group-addon btn btn-default select-btn" data-type="url">搜索</span>
  5. </div>
  6. <table class="table supplyquery table-hover supplyquery" style="min-width:850px;">
  7. <tbody>
  8. <?php foreach($ds as $row){ ?>
  9. <tr>
  10. <td><img src='{$row['avatar']}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' /> {$row['nickname']}</td>
  11. <td>{$row['mobile']}</td>
  12. <td style="width:80px;"><a href="javascript:;" class="choose_dan_link" data-json='{:json_encode($row);}'>选择</a></td>
  13. </tr>
  14. <?php } ?>
  15. <?php if( count($ds)<=0 ){ ?>
  16. <tr>
  17. <td colspan='4' align='center'>未找到会员</td>
  18. </tr>
  19. <?php } ?>
  20. </tbody>
  21. <?php if( count($ds) > 0 ){ ?>
  22. <tfoot>
  23. <tr>
  24. <td colspan='4' align='center' id="pager_ajax">{$pager}</td>
  25. </tr>
  26. </tfoot>
  27. <?php } ?>
  28. </table>
  29. </div>
  30. <script>
  31. var query_kwd = '{$kwd}';
  32. <?php if( !empty($url) ){ ?>
  33. var query_url = "{:U($url, array('is_not_hexiao' => $is_not_hexiao))}";
  34. <?php }else{ ?>
  35. var query_url = "{:U('user/zhenquery_many', array('is_not_hexiao' => $is_not_hexiao))}";
  36. <?php } ?>
  37. var can_next = true;
  38. $(document).delegate(".choose_dan_link","click",function(){
  39. //data-json
  40. var json_obj = JSON.parse($(this).attr('data-json'));
  41. var p_html = '';
  42. p_html+= '<div class="input-group mult_choose_member_id" data-member-id="'+json_obj.member_id+'" style="border-radius: 0;float: left;margin: 10px;margin-left:0px;width: 22%;">';
  43. p_html+= ' <div class="layadmin-text-center choose_user">';
  44. p_html+= ' <img style="" src="'+json_obj.avatar+'">';
  45. p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.username+'</div>';
  46. p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)"><i class="layui-icon">&#xe640;</i></button>';
  47. p_html+= ' </div>';
  48. p_html+= '</div>';
  49. var can_tr = true;
  50. $(cur_open_div).parent().siblings().each(function(){
  51. if( $(this).attr('data-member-id') == json_obj.member_id )
  52. {
  53. can_tr = false;
  54. }
  55. })
  56. if( can_tr )
  57. {
  58. $(cur_open_div).parent().after(p_html);
  59. }
  60. });
  61. $(".select-btn").click(function(){
  62. query_kwd = $.trim($("#select-url-kw").val());
  63. var s_page = $(this).attr('page');
  64. if(!can_next)
  65. {
  66. return false;
  67. }
  68. can_next = false;
  69. $.ajax({
  70. url:query_url,
  71. type:'post',
  72. dataType:'json',
  73. data:{keyword:query_kwd, page:1,is_ajax:1},
  74. success:function(ret){
  75. if(ret.code == 0)
  76. {
  77. $('.supplyquery tbody').html(ret.html);
  78. }
  79. can_next = true;
  80. }
  81. })
  82. });
  83. $("body").delegate(".pagination a","click",function(){
  84. var s_page = $(this).attr('page');
  85. if(!can_next)
  86. {
  87. return false;
  88. }
  89. can_next = false;
  90. $.ajax({
  91. url:query_url,
  92. type:'post',
  93. dataType:'json',
  94. data:{keyword:query_kwd, page:s_page,is_ajax:1},
  95. success:function(ret){
  96. if(ret.code == 0)
  97. {
  98. $('.supplyquery tbody').html(ret.html);
  99. $('#pager_ajax').html(ret.pager);
  100. }
  101. can_next = true;
  102. }
  103. })
  104. })
  105. </script>