<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->

<!--{if $a == "run"}-->
<div class="layui-fluid oe_fluid">

  <form class="layui-form" id="mysearch" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">会员管理</a><span lay-separator="">/</span>
      <a><cite>相册管理</cite></a>
    </div>
  </div>
  <!--//Top End -->
  
  <div class="oe_searchbar layui-form">
    <div class="more_search_open"></div>
    
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">所在地区：</div>
        <div class="layui-input-inline input-120">
          <!--//9.10.12 -->
          <!--{assign var="distlist" value=vo_list("mod={area0} where={v.parentid='0'} orderby={v.orders ASC}")}-->
          <select name="sdist1" id="sdist1" lay-filter="area" data-depth="1" data-name="sdist" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sdist1 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
        </div>
        <div class="layui-input-inline input-120" id="json_sdist2">
          <!--{if $sdist1 > 0}-->
          <!--{assign var="distlist2" value=vo_list("mod={area} where={v.parentid='<!--{$sdist1}-->'}")}-->
          <select name="sdist2" id="sdist2" lay-filter="area" data-depth="2" data-name="sdist" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist2 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sdist2 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sdist2" id="sdist2" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
        <div class="layui-input-inline input-120" id="json_sdist3">
          <!--{if $sdist2 > 0}-->
          <!--{assign var="distlist3" value=vo_list("mod={area} where={v.parentid='<!--{$sdist2}-->'}")}-->
          <select name="sdist3" id="sdist3" lay-filter="area" data-depth="3" data-name="sdist" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist3 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sdist3 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sdist3" id="sdist3" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
        <div class="layui-input-inline input-120" id="json_sdist4">
          <!--{if $sdist3 > 0}-->
          <!--{assign var="distlist4" value=vo_list("mod={area} where={v.parentid='<!--{$sdist3}-->'}")}-->
          <select name="sdist4" id="sdist4" lay-filter="area" data-depth="4" data-name="sdist" data-text="=请选择=">
            <option value="">=请选择=</option>
            <!--{foreach $distlist4 as $val}-->
            <option value="<!--{$val.areaid}-->"<!--{if $sdist4 == $val.areaid}--> selected<!--{/if}-->><!--{$val.areaname}--></option>
            <!--{/foreach}-->
          </select>
          <!--{else}-->
          <select name="sdist4" id="sdist4" lay-filter="area">
            <option value="">=请选择=</option>
          </select>
          <!--{/if}-->
        </div>
      </div>
      
      <div class="layui-inline">
        <div class="layui-form-label">性别：</div>
        <div class="layui-input-inline input-100">
          <!--{hook mod="var" item="gender" name="sgender" type="select" text="不限" value=$sgender}-->
        </div>
      </div>    
    </div>
    
    <div class="layui-form-item">
      <div class="layui-inline">
        <div class="layui-form-label">会&nbsp;员UID：</div>
        <div class="layui-input-inline input-120">
          <input type="text" name="suserid" id="suserid" class="layui-input" value="<!--{if $suserid>0}--><!--{$suserid}--><!--{/if}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">&nbsp;用&nbsp;户&nbsp;名：</div>
        <div class="layui-input-inline input-120">
          <input type="text" name="susername" id="susername" class="layui-input" value="<!--{$susername}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">姓名：</div>
        <div class="layui-input-inline input-120">
          <input type="text" name="struename" id="struename" class="layui-input" value="<!--{$struename}-->" />
        </div>
      </div>
      <div class="layui-inline">
        <div class="layui-form-label">手机：</div>
        <div class="layui-input-inline input-120">
          <input type="text" name="smobile" id="smobile" class="layui-input" value="<!--{$smobile}-->" />
        </div>
      </div>
      
      <div class="layui-inline">
        <button class="layui-btn layui-btn-sm search" id="but_submit_search2" lay-submit lay-filter="searchform2">
          <i class="layui-icon layui-icon-search"></i>
          搜索
          <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
        </button>
      </div>
    </div>
    <div class="layui-form-item">
      <div class="layui-form-label">相册状态：</div>
      <div class="label_box">
        <input type="hidden" name="sflag" id="sflag" value="<!--{$sflag}-->" />        
        <span f="but_search_cat" data-val="0" data-input="sflag"<!--{if $sflag == '0'}--> class="current"<!--{/if}-->>全部</span>
        <span f="but_search_cat" data-val="1" data-input="sflag"<!--{if $sflag == '1'}--> class="current"<!--{/if}-->>通过</span>
        <span f="but_search_cat" data-val="2" data-input="sflag"<!--{if $sflag == '2'}--> class="current"<!--{/if}-->>未通过</span>
        <span f="but_search_cat" data-val="3" data-input="sflag"<!--{if $sflag == '3'}--> class="current"<!--{/if}-->>待审核</span>
      </div>
    </div>

  </div>
  <!--//search End -->
  </form>

  <div class="oe_table_wrap layui-form">
  
    <div class="oe_tbl_tool clearfix">
      <div class="oe_gnbar clearfix">
        <div class="select btn fl">
          <input type="checkbox" name="allid[]" lay-skin="primary" title="全选" lay-filter="selectAll">
        </div>
        <div class="btn del fl" f="handle-array" data-form="myform" data-a="del" data-text="确定要删除吗？">
          <i class="layui-icon layui-icon-star-delete"></i>
          <span>删除选定</span>
        </div>
        <div class="btn del fl" f="handle-array" data-form="myform" data-a="pass">
          <i class="iconfont icon-tongguo"></i>
          <span>批量通过</span>
        </div>
        <div class="btn del fl del_line" f="handle-array" data-form="myform" data-a="fail">
          <i class=" iconfont icon-butongguo"></i>
          <span>批量不通过</span>
        </div>
      </div>
    </div>
    
    <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post">
    <input type="hidden" name="a" id="a" value="del" />
    <div class="layui-row oe_nphoto_list">
      <div class="bd">
        <!--{if empty($photo)}-->
        <p class="oe_nno_data">
          没有符合条件的信息
        </p>
        <!--{else}-->
        <!--{foreach $photo as $volist}-->
        <div class=" layui-col-space15">
          <dl class="nLi">
            <dt>
              <div>
                <img id="photo_<!--{$volist.photoid}-->" src="<!--{$urlpath}-->tpl/static/images/loading_img.png" data-src="<!--{$volist.thumbimg}-->" data-img="<!--{$volist.drawimg}-->" f="viewimg" preload="0" />
              </div>
            </dt>
            <dd class="state">
              <!--{if $volist.flag == "1"}-->
              <font color="green">已通过</font>
              <!--{elseif $volist.flag == "2"}-->
              <font color="red">审核未通过</font>
              <!--{else}-->
              待审核
              <!--{/if}-->
            </dd>
            <dd class="sub" style="display:none;">
              <p>
                <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.photoid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-normal">编辑</a>
                <a href="javascript:;" f="handle-one" data-url="<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.photoid}-->&<!--{$comeurl}-->" class="layui-btn layui-btn-xs layui-btn-danger">删除</a>
                
                <a href="javascript:;" class="layui-btn layui-btn-xs layui-btn-warm" f="but_flip_image" data-id="<!--{$volist.photoid}-->">旋转</a>
                
              </p>
               <p class="p_1">
                 <!--{$volist.username}-->&#12288;<!--{$volist.addtime|date_format:"%m-%d %H:%M:%S"}-->
               </p>
            </dd>
            <div class="check">
              <input type="checkbox" name="id[]" lay-skin="primary" value="<!--{$volist.photoid}-->" />
              <!--{$volist.photoid}-->
            </div>
          </dl>
        </div>
        <!--{/foreach}-->
        <!--{/if}-->
      </div>
      <div class="clear"></div>
    </div>
    </form>
    
    <script type="text/javascript">
    jQuery(".oe_nphoto_list").slide({
        type:"menu", titCell:".nLi", targetCell:".sub", effect:"slideDown",
        delayTime:300, triggerTime:0, returnDefault:true
    });
    
    $(function(){
      
      //旋转图片 9.10.10
      $(document).on("click", "[f='but_flip_image']", function(){
          
          $id = $(this).attr("data-id");
          $.ajax({
            type: "POST",
            url: _OECPFILE+"&c=photo",
            cache: false,
            data: {
                a:"flip", id:$id, r:get_rndnum(8)
            },
            dataType: "json",
            success: function(data) {
              $json = eval(data);
              $response = $json.response;
              $result = $json.result;
              if ($response == '1') {
                  
                  $thumbimg = $result.thumbimg;
                  $drawimg = $result.drawimg;
                  
                  $("#photo_"+$id).attr("src", $thumbimg+"?r="+get_rndnum(6));
                  $("#photo_"+$id).attr("data-img", $drawimg+"?r="+get_rndnum(6));
                  
              }
            },
            error: function() {
              layer.msg("系统繁忙，请稍后再试！");
            }
          });
      });
      
      //预载图片 9.10.12
      preload_img();
    
    });
    </script>
    <div class="oe_page_box"><!--{$showpage}--></div>

  </div>
</div>
<!--{/if}-->


<!--{if $a == "edit"}-->
<div class="layui-fluid oe_fluid">

  <div class="oe_breadcrumb_box clearfix">
    <div class="layui-breadcrumb fl" lay-filter="breadcrumb" style="visibility: visible;">
      <a href="javascript:;">会员管理</a><span lay-separator="">/</span>
      <a href="javascript:;">相册管理</a><span lay-separator="">/</span>
      <a><cite>编辑相册</cite></a>
    </div>
    <div class="oe_tool_bar ft">
      <button class="layui-btn layui-btn-sm layui-btn-radius" id="but_submit_post2" lay-submit lay-filter="editform">
        编辑保存
        <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
      </button>
      <span class="layui-btn layui-btn-sm layui-btn-primary layui-btn-radius"><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">返回列表</a></span>
    </div> 
  </div>
  
  <form class="layui-form" id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post">
  <input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
  <div class="layui-card">
    <div class="layui-card-header">编辑相册</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="15%"><font color="red"></font>所属会员：</th>
          <td width="85%">
            <!--{if $photo.userid > 0}-->
            <!--{$photo.username}-->/<!--{$photo.userid}-->
            <!--{else}-->
            --
            <!--{/if}-->
          </td>
        </tr>
        <tr>
          <th><font color="red"></font>图片标题：</th>
          <td>
            <input type="text" name="title" id="title" class="layui-input input-300" value="<!--{$photo.title}-->" />
          </td>
        </tr>
        <tr>
          <th><font color="red">*</font>相册/照片：</th>
          <td>
            <div class="layui-btn">
              <i class="layui-icon layui-icon-upload"></i>
              点击上传
              <input type="file" name="img" id="img" f="but_upload_image" data-thumb="1" data-mod="photo" />
            </div>
            <div class="upload_loading" id="img_loading" style="display:none;"></div>
            <input type="hidden" id="img_thumb" name="thumbimg" value="<!--{$photo.thumbimg}-->" />
            <input type="hidden" id="img_url" name="drawimg" value="<!--{$photo.drawimg}-->" />
        
            <div class="tblform_tips normal">&nbsp;&nbsp;&nbsp;预览：</div>
            <div class="upload_pic upload_pic_md" style="width:30px;height:30px;">
              <img src="<!--{$urlpath}--><!--{if !empty($photo.thumbimg)}--><!--{$photo.thumbimg}--><!--{else}-->tpl/static/images/nopic.jpg<!--{/if}-->" id="img_preview" f="viewimg" />
            </div>
          </td>
        </tr>
        <tr>
          <th>状&#12288;&#12288;态：</th>
          <td>
            <div class="input-100">
            <select name="flag" id="flag">
              <option value="">请选择</option>
              <option value="1"<!--{if $photo.flag == '1'}--> selected<!--{/if}-->>通过</option>
              <option value="2"<!--{if $photo.flag == '2'}--> selected<!--{/if}-->>未通过</option>
              <option value="0"<!--{if $photo.flag == '0'}--> selected<!--{/if}-->>待审核</option>
            </select>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>
  </form>
  
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="editform">
      编辑保存
      <span class="oe_btn_loading layui-anim layui-icon layui-anim-rotate layui-anim-loop" style="display:none;">&#xe63d;</span>
    </button>
  </div>
  
</div>
<script type="text/javascript">
$(function(){

    layui.use('form', function(){
        $form = layui.form;
        //保存...
        $form.on('submit(editform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {

                if ($("#img_url").val().length  == 0) {
                    layer.msg("请上传相册/照片");
                    return false;
                }
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                $("#myform").submit();
            }
        });   
    });
    
});
</script>
<!--{/if}-->
</body>
</html>