<!DOCTYPE html>
<html>
<head>
  <meta charset="utf-8">
  <title>我的消息 - {aspbbs:guestConfig.SiteName} </title>
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
{aspbbs:template src=common/link}
 <link href="{aspbbs:sitetplpath}/res/barrager/css/barrager.css" rel="stylesheet" />
</head>
<body>

{aspbbs:template src=common/header_user}

<div class="layui-container fly-marginTop fly-user-main">
	{aspbbs:template src=common/user-nav}
  
  
  <div class="fly-panel fly-panel-user" pad20>
	  <div class="layui-tab layui-tab-brief" lay-filter="user" id="LAY_msg" style="margin-top: 15px;">
		{if: $RecordCount <> 0 }
		<button class="layui-btn layui-btn-danger" id="LAY_delallmsg">清空全部消息</button>
		{end if}
		
	    <div  id="LAY_minemsg" style="margin-top: 10px;">
		{if: $RecordCount = 0 }
        <div class="fly-none">您暂时没有最新消息</div>
		{else}
        <ul class="mine-msg">
			{aspbbs:looprs data=message page=0}
          <li data-id="[looprs:MessageID]">
            <blockquote class="layui-elem-quote">
             <a class="fly-nav-avatar" href="[looprs:UserID func=getUserULink(@me)]" title='昵称:[looprs:Nickname]'><img src='[looprs:Avatar]' /></a> [looprs:LoginName]: [looprs:Message func=htmlcut(@me,30)]
            </blockquote>
            <p><span title="[looprs:AddTime]">[looprs:AddTime func=POP_MVC.datestr(@me)]</span><a href="javascript:;" class="layui-btn layui-btn-small layui-btn-danger fly-delete">删除</a></p>
          </li>
		    {/aspbbs:looprs}
        </ul>
		{end if}
      </div>
	  </div>
	</div>

</div>


{aspbbs:template src=self/footer}

<script type="text/javascript" src="{aspbbs:sitetplpath}/res/barrager/js/jquery.barrager.js"></script>

<script>
	function startbarrager() {
		//每条弹幕发送间隔
		var data = {aspbbs:func:js_encode($barrager)}
		var looper_time=3*1000;
		var items=data;
		//弹幕总数
		var total=data.length;
		if ( total < 1 ) {
			return false;
		}
		//是否首次执行
		var run_once=true;
		//弹幕索引
		var index=0;
		//先执行一次
		barrager();
		function  barrager(){
		  if(run_once){
			  //如果是首次执行,则设置一个定时器,并且把首次执行置为false
			  looper=setInterval(barrager,looper_time);                
			  run_once=false;
		  }
		  //发布一个弹幕
		  $('body').barrager(items[index]);
		  //索引自增
		  index++;
		  //所有弹幕发布完毕，清除计时器。
		  if(index == total){
		 
			  clearInterval(looper);
			  return false;
		  }
		}
	}
	startbarrager();
</script>
</body>
</html>