<!-- 任务通知列表页面 -->
<header class="bar bar-header bar-{{barTheme}}" ng-class="{searching:searching}">
 	<button class="button icon-left ion-ios-arrow-back button-clear sino-back-button" ng-click="goBack()">通知</button>
  	<h1 class="title"></h1>
	<i class="button button-icon icon ion-ios-reloading" ng-show="loading"></i>
	<h1 class="title">任务通知</h1>
	<button class="button button-icon icon ion-ios-plus-empty" ng-click="createTask()"></button>
	<!-- <button class="button button-icon icon ion-ios-gear" ng-click="taskSetting()"></button> -->
</header>

<ion-content class="message-list linker-cards has-header" delegate-handle="messageScroll" ng-class="{searching:searching}">
	<ion-refresher on-refresh="onRefresh()"></ion-refresher>
	
	<div class="message-page search-page" ng-class="{searching:searching}" on-end="onEndEvent">
		<div class="bar item-input-inset">
			<div class="item-input-wrapper">
				<i class="icon ion-ios-search placeholder-icon"></i>
				<div class="search-input-btn" ng-click="openSearch()">搜索</div>
			</div>
		</div>
		<div class="list">
			<a class="item item-avatar" ng-repeat="task in taskMessages.items | filter: searchText track by task.id" ng-click="toMessageDetail(task)">
				<img ng-src="{{parseImageSrc(task.sendPerson)}}">
				<span class="item-note" style="margin-left: 20px;">
					{{task.status === '0' || task.status === '3'?parseDateStr(task.createDate):task.latestMessage? parseDateStr(task.latestMessage.sendDate): parseDateStr(task.sendDate)}}
				</span>
				<h3>
					<i class="icon ion-alert-circled" ng-show="task.status === '3'"></i>
					{{task.title}}
				</h3>
				<span class="badge badge-assertive message" ng-show="task.noticeNum > 0">{{task.noticeNum}}</span>
				<p class="latest-discussion" style="padding-right: 45px;">
					<i class="icon ion-alert-circled" ng-show="task.latestMessage.status === '3' || task.latestMessage.status === '4' "></i>
					<span>
						{{getMessageSubTitle(task)}}
					</span>
				</p>
			</a>
		</div>
		<ion-infinite-scroll on-infinite="loadMore()" distance="0%">
		</ion-infinite-scroll>
	</div>
</ion-content>
<div class="sino-search-modal message-search-modal" ng-show="searchopen" ng-class="{open: searchopen}">
	<div class="bar item-input-inset" stop-event>
	  <label class="item-input-wrapper">
	    <i class="icon ion-ios-search placeholder-icon"></i>
	    <input type="search" placeholder="搜索" ng-model="search.text">
	  </label>
	  <button class="button button-clear cancel" ng-click="closeSearch()">
	    取消
	  </button>
	</div>
	<ion-content class="card has-search-header" ng-show="search.text !== ''" scroll="true" on-touch="closeKeyBoard()" delegate-handle="searchTaskScroll" ng-click="closeSearch()">
	  <div class="list" ng-show="searchItems.length > 0">
			<a class="item item-avatar" ng-repeat="task in searchItems track by task.id" ng-click="toMessageDetail(task)">
				<img ng-src="{{parseImageSrc(task.sendPerson)}}">
				<span class="item-note" style="margin-left: 20px;">
					{{task.status === '0' || task.status === '3'?parseDateStr(task.createDate):task.latestMessage? parseDateStr(task.latestMessage.sendDate): parseDateStr(task.sendDate)}}
				</span>
				<h3>
					<i class="icon ion-alert-circled" ng-show="task.status === '3'"></i>
					{{task.title}}
				</h3>
				<span class="badge badge-assertive message" ng-show="task.noticeNum > 0">{{task.noticeNum}}</span>
				<p class="latest-discussion" style="padding-right: 45px;">
					<i class="icon ion-alert-circled" ng-show="task.latestMessage.status === '3' || task.latestMessage.status === '4' "></i>
					<span>{{getMessageSubTitle(task)}}</span>
				</p>
			</a>
		</div>
		<div ng-show="searchItems.length === 0">
			<span class="search-none">无结果</span>
		</div>
	</ion-content>
</div>