123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899 |
- <div style='max-height:500px;overflow:auto;min-width:850px;'>
- <table class="table supplyquery table-hover" style="min-width:850px;">
- <div class="input-group layui-row" style="margin:10px;">
- <input type="text" placeholder="请输入昵称进行搜索" id="select-url-kw" value="" class="form-control">
- <span class="input-group-addon btn btn-default select-btn" data-type="url" id="sarchBtn">搜索</span>
- </div>
- <tbody>
- <?php foreach( $ds as $row ){ ?>
- <tr>
- <td><img src='{$row['avatar']}' style='width:30px;height:30px;padding1px;border:1px solid #ccc' /> {$row['nickname']}</td>
-
- <td>{$row['mobile']}</td>
- <td style="width:80px;"><a href="javascript:;" class="choose_dan_link" data-json='{:json_encode($row);}'>选择</a></td>
- </tr>
- <?php } ?>
- <?php if( count($ds)<=0){ ?>
- <tr>
- <td colspan='4' align='center'>未找到团长</td>
- </tr>
- <?php } ?>
- </tbody>
- <?php if( count($ds) > 0){ ?>
- <tfoot>
- <tr>
- <td colspan='4' align='center' id="pager_ajax">{$pager}</td>
- </tr>
- </tfoot>
- <?php } ?>
- </table>
- </div>
- <script>
- var query_kwd = '{$kwd}';
- var query_url = "{:U('communityhead/query_head_user')}";
- var can_next = true;
- $(document).delegate(".choose_dan_link","click",function(){
-
- //data-json
- var json_obj = JSON.parse($(this).attr('data-json'));
- var p_html = '';
- p_html+= '<div class="input-group " style="margin: 0;">';
- p_html+= ' <div class="layadmin-text-center choose_user">';
- p_html+= ' <img style="" src="'+json_obj.avatar+'">';
- p_html+= ' <div class="layadmin-maillist-img" style="">'+json_obj.username+'</div>';
- p_html+= ' <button type="button" class="layui-btn layui-btn-sm" onclick="cancle_bind(this)"><i class="layui-icon"></i></button>';
- p_html+= ' </div>';
- p_html+= '</div>';
-
- $(cur_open_div).parent().siblings().remove();
- $(cur_open_div).parent().after(p_html);
-
- $(cur_open_div).val( json_obj.member_id );
- layer.close(layer.index);
- });
- $("body").delegate(".pagination a","click",function(){
- var s_page = $(this).attr('page');
- if(!can_next)
- {
- return false;
- }
- can_next = false;
- $.ajax({
- url:query_url,
- type:'post',
- dataType:'json',
- data:{keyword:query_kwd, page:s_page,is_ajax:1},
- success:function(ret){
- if(ret.code == 0)
- {
- $('.supplyquery tbody').html(ret.html);
- $('#pager_ajax').html(ret.pager);
-
- }
- can_next = true;
- }
- })
- })
- $("body").delegate("#sarchBtn","click",function(){
- var keyword = $('#select-url-kw').val();
- $.ajax({
- url:query_url,
- type:'post',
- dataType:'json',
- data:{keyword:keyword,page:1,is_ajax:1},
- success:function(ret){
- if(ret.code == 0)
- {
- $('.supplyquery tbody').html(ret.html);
- $('#pager_ajax').html(ret.pager);
-
- }
- }
- })
- })
- </script>
|