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

<div class="layui-fluid oe_fluid" style="padding-top:10px;">

  <div class="layui-card">
    <div class="layui-card-header">修改[<!--{$user.username}-->]状态</div>
    <div class="layui-card-body">
      <table class="oe_tbl_form layui-form">
        <tr>
          <th width="20%"><font color="red"></font>会员UID：</th>
          <td width="80%">
            <input type="hidden" name="id" id="id" class="layui-input input-200" value="<!--{$user.userid}-->" />
            <!--{$user.userid}-->
          </td>
        </tr>
        <tr>
          <th>状态：</th>
          <td>
            <div class="layui-input-inline input-200">
            <select name="flag" id="flag">
              <option value="">请选择</option>
              <option value="1"<!--{if $user.flag == '1'}--> selected<!--{/if}-->>审核通过</option>
              <option value="2"<!--{if $user.flag == '2'}--> selected<!--{/if}-->>审核未通过</option>
              <option value="3"<!--{if $user.flag == '3'}--> selected<!--{/if}-->>黑名单</option>
              <option value="4"<!--{if $user.flag == '4'}--> selected<!--{/if}-->>找到意中人</option>
              <option value="5"<!--{if $user.flag == '5'}--> selected<!--{/if}-->>隐藏资料</option>
              <option value="0"<!--{if $user.flag == '0'}--> selected<!--{/if}-->>待审核</option>
            </select>
            </div>
          </td>
        </tr>
      </table>
    </div>
  </div>

  
  <div class="oe_tbl_form_btn">
    <button class="layui-btn" id="but_submit_post" lay-submit lay-filter="submitform">
      完成
      <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(submitform)', function(data){
            $obj_id = data.elem.getAttribute("id");
            if (!$("#"+$obj_id).hasClass("forbid_submit")) {
            
            
                $id = $("#id").val();
                if ($id.length == 0) {
                    layer.msg("请输入用户UID");
                    return false;
                }
                $flag = $("#flag").val();
                
                
                $("#"+$obj_id).addClass("forbid_submit");
                if ($("#"+$obj_id).find("span").length > 0) {
                    $("#"+$obj_id).find("span").show();
                }
                $.ajax({
                    type: "POST",
                    url: "<!--{$oefile}-->&c=<!--{$c}-->",
                    cache: false,
                    data: {
                        a:"savestatus", id:$id, flag:$flag, datatype:"ajax", r:get_rndnum(8)
                    },
                    dataType: "json",
                    success: function(data) {
                        $json = eval(data);
                        $response = $json.response;
                        $result = $json.result;
                        if ($response == '1') {
                            layer.msg("操作成功");
                            setTimeout(function(){
                                window.parent.location.reload();
                            }, 800);
                        }
                        else {
                            if ($result.length > 0) {
                                layer.msg($result);
                            }
                            else {
                                layer.msg("操作失败");
                            }
                            $("#"+$obj_id).removeClass("forbid_submit");
                            if ($("#"+$obj_id).find("span").length > 0) {
                                $("#"+$obj_id).find("span").hide();
                            }
                        }
                        
                    },
                    error: function() {
                        layer.msg("系统繁忙，请稍后再试！");
                        $("#"+$obj_id).removeClass("forbid_submit");
                        if ($("#"+$obj_id).find("span").length > 0) {
                            $("#"+$obj_id).find("span").hide();
                        }
                    }
                });
                
                
            }
        });   
        
        
    });
    
});
</script>

</body>
</html>