query_commission.html 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  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_commission', 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 " style="margin: 0;">';
  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. $(cur_open_div).parent().siblings().remove();
  50. $(cur_open_div).parent().after(p_html);
  51. $(cur_open_div).val( json_obj.member_id );
  52. layer.close(layer.index);
  53. });
  54. $(".select-btn").click(function(){
  55. query_kwd = $.trim($("#select-url-kw").val());
  56. var s_page = $(this).attr('page');
  57. if(!can_next)
  58. {
  59. return false;
  60. }
  61. can_next = false;
  62. $.ajax({
  63. url:query_url,
  64. type:'post',
  65. dataType:'json',
  66. data:{keyword:query_kwd, page:1,is_ajax:1},
  67. success:function(ret){
  68. if(ret.code == 0)
  69. {
  70. $('.supplyquery tbody').html(ret.html);
  71. }
  72. can_next = true;
  73. }
  74. })
  75. });
  76. $("body").delegate(".pagination a","click",function(){
  77. var s_page = $(this).attr('page');
  78. if(!can_next)
  79. {
  80. return false;
  81. }
  82. can_next = false;
  83. $.ajax({
  84. url:query_url,
  85. type:'post',
  86. dataType:'json',
  87. data:{keyword:query_kwd, page:s_page,is_ajax:1},
  88. success:function(ret){
  89. if(ret.code == 0)
  90. {
  91. $('.supplyquery tbody').html(ret.html);
  92. $('#pager_ajax').html(ret.pager);
  93. }
  94. can_next = true;
  95. }
  96. })
  97. })
  98. </script>