<!--{include file="<!--{$oapath}-->public/ins_page.tpl"}-->
   <link rel='stylesheet' type='text/css' href="<!--{$oapath}-->Ins/js/layui/css/layui.css">
 <script type='text/javascript' src='<!--{$urlpath}-->data/oaeditor/kindeditor.js'></script><block name="content">
<block name="content">
	
	<div class="operate panel panel-default">
		<div class="panel-body">
			<div class="pull-left">
				<a onclick="go_return_url();" class="btn btn-sm btn-primary">返回</a>
			</div>
			<div class="pull-right">
				<a onclick="save();"  class="btn btn-sm btn-primary">发送</a>
			</div>
		</div>
	</div>
	<form class="well form-horizontal" method='post' id="form_data" name="form_data" enctype="multipart/form-data">
		<input type="hidden" id="ajax" name="ajax" value="1">		
		<input type="hidden" id="receiver_id" name="receiver_id" value="<!--{$reply_id}-->"/>
		<input type="hidden" id="receiver_name" name="receiver_name" value="<!--{$reply_name}-->"/>
		<input type="text" style="display:none">
		<div class="form-group">
			<div class="col-xs-12">
				发送消息给 <!--{$reply_name}-->
			</div>
		</div>
		<div class="form-group">
			<div class="col-xs-12">
				<textarea  class="simple" id="content" name="content" class="col-xs-12" check="require" msg="请输入内容" style="width:100%;height:200px;"></textarea>
                                                                                                  <script>var editor;KindEditor.ready(function(K) {editor = K.create('#content',{afterCreate : function() {
    this.sync();
},
afterBlur:function(){
    this.sync();
} }); });</script>
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-2 control-label" for="name">附件：</label>
			<div class="col-sm-10">
				<div class="uploader" id="uploader_add_file" add_file_id="add_file">
                                    <a class="btn btn-sm btn-primary" id="testList">添加附件</a>
                                    
                                    <ul class="file_list" new_upload="" id="file_list"></ul>
                            </div>
			</div>
		</div>
	</form>
	<hr>
	<div>
		<div class="dialogs">
			 <!--{foreach $list as  $key=>$vo}-->
				<div class="row">
					<div class="col-xs-1">
						<div class="user">
							<img class="img-thumbnail" src="__ROOT__/{$vo.sender_id|get_emp_pic}" onerror="javascript:this.src='<!--{$oapath}-->Ins/img/no_avatar.jpg'"/>
						</div>
					</div>
					<div class="col-xs-11">
						<div>
							<!--{$vo.sender_name}-->：<span><!--{$vo.create_time|date_format:'%Y-%m-%d %H:%I:%S'}--></span>
						</div>
						<div>
							<!--{$vo.content}-->							
						</div>
                                                <!--{foreach $vo.files as  $v}-->
                                              <p class="form-control-static">
                                                   <a class="link down" target="_blank" href=" <!--{$v.path}-->" download=''> <!--{$v.name}--></a>
                                            </p>
                                          <!--{/foreach}-->
	
					</div>
				</div>
				<hr>
			 <!--{/foreach}-->  
		</div>
	</div>	
</block>

					
				</div>
			</div>
		</div>
		<!--<iframe src="{:U('push/client')}" class="push" id="push"></iframe>-->
		<!-- Mainly scripts -->
		<script src="<!--{$oapath}-->Ins/js/jquery-2.1.1.js"></script>
		<script src="<!--{$oapath}-->Ins/js/bootstrap.min.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/metisMenu/jquery.metisMenu.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
		<!-- Custom and plugin javascript -->
		<script src="<!--{$oapath}-->Ins/js/inspinia.js"></script>
		<script src="<!--{$oapath}-->Ins/js/common.js"></script>
		<script src="<!--{$oapath}-->Ins/js/plugins/pace/pace.min.js"></script>
                
		<script src="<!--{$oapath}-->Ins/js/plugins/toastr/toastr.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/gritter/jquery.gritter.min.js"></script>
                <script src="<!--{$oapath}-->Ins/js/plugins/bootbox/bootbox.min.js"></script>
                       <script type="text/javascript" src="<!--{$oapath}-->Ins/js/layui/layui.js"></script>
		<include file="Layout:ins_plugin_js"/>
<block name="js">
	<script type="text/javascript">
		

		function save() {
			sendForm("form_data", 'oa.php?c=Message&a=reply' ,"oa.php?c=Message");
		}
		  $(document).on("click", "#del_li", function() {
                                                $(this).parent().parent().parent().remove();		
                                });
	</script>
          <script>
layui.use('upload', function(){
  var $ = layui.jquery
  ,upload = layui.upload;
  
  //普通图片上传
  var uploadInst = upload.render({
    elem: '#testList'
    ,url: 'oa.php?c=Popup&a=upload'
    ,accept: 'file'
    ,before: function(obj){
      //预读本地文件示例，不支持ie8
      obj.preview(function(index, file, result){
        $('#demo1').attr('src', result); //图片链接（base64）
      });
    }
    ,done: function(res){
      //如果上传失败
      if(res.code > 0){
        return layer.msg('上传失败');
      }else{
          var html="<li class='tbody'><input type='hidden' name='upload_file[]' value='"+res.name1+"'/><div class='loading' style='width: 100%;'></div><div class='data'><span class='del text-center'><a class='link del' id='del_li' style='display: inline;'>删除</a></span>";
          html+="<span class='size text-right'>"+res.size+"</span>";
          html+="<span class='auto autocut'>"+res.name2+"</span></div></li>";
          var demoText = $('#file_list');
          demoText.append(html);
      }
      //上传成功
    }
    ,error: function(){
      //演示失败状态，并实现重传
      var demoText = $('#demoText');
      demoText.html('<span style="color: #FF5722;">上传失败</span> <a class="layui-btn layui-btn-xs demo-reload">重试</a>');
      demoText.find('.demo-reload').on('click', function(){
        uploadInst.upload();
      });
    }
  });
  

  
  //绑定原始文件域
  upload.render({
    elem: '#test20'
    ,url: '/upload/'
    ,done: function(res){
      console.log(res)
    }
  });
  
});
</script>
</block>
	</body>
</html>
