<div>
  <ion-content class="linker-cards has-header" ng-class="{'has-footer': canCheck}" scrollbar-y="!canCheck">
    <ion-refresher on-refresh="onRefresh()"></ion-refresher>
     <div class="search-page" ng-class="{searching:searching}" on-end="onEndEvent">
      <div class="segmented-control">
        <a class="control-item favorite-linkers-card" ng-class="{active: showCard === 'favorite'}" ng-click="changeCard('favorite')">
          常用联系人
        </a>
        <a class="control-item localdept-linkers-card" ng-class="{active: showCard === 'local'}" ng-click="changeCard('local')">
          本部门联系人
        </a>
        <a class="control-item all-linkers-card" ng-class="{active: showCard === 'entire'}" ng-click="changeCard('entire')">
          全部联系人
        </a>
      </div>
      <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" ng-show="showCard === 'favorite'">
        <div class="item" ng-class="{'item-checkbox': canCheck}" ng-repeat="linker in linkerList.items track by linker.userId" ng-click="!canCheck && toLinkerDetail(linker)" ng-if="linker.note === '1'">
          <label class="checkbox" ng-show="canCheck" ng-init="_linker = linkerSelectorList.get(linker.userId)">
            <input type="checkbox" name="commonUsers[]" ng-model="_linker.selected" ng-change="onItemValueChange(linker, $event)">
          </label>
           {{linker.userName}}
           <p>{{transferDeptName(linker.deptName)}}</p>
        </div>
      </div>
      <div class="list" ng-show="showCard === 'local'">
        <div class="item" ng-class="{'item-checkbox': canCheck}" ng-repeat="linker in userListOfSameDept.items track by linker.userId" ng-click="!canCheck && toLinkerDetail(linker)" ng-if="linker.note === '1'">
          <label class="checkbox" ng-show="canCheck"  ng-init="_linker = linkerSelectorList.get(linker.userId)">
            <input type="checkbox" name="localUsers[]" ng-model="_linker.selected" ng-change="onItemValueChange(linker)">
          </label>
           {{linker.userName}}
           <p>{{transferDeptName(linker.deptName)}}</p>
        </div>
      </div>
      <div class="list" ng-show="showCard === 'entire'">
        <div class="item collection-item"
          ng-class="{'item-checkbox': canCheck}"
          ng-click="!canCheck && toLinkerDetail(linker)"
          collection-repeat="linker in userList.allItems track by linker.userId"
          collection-item-width="'100%'"
          collection-item-height="getItemHeight(linker, $index)"
          ng-style="{height: getItemHeight(linker, $index)}" >
          <label class="checkbox" ng-show="canCheck">
            <input type="checkbox" name="entireUsers[]" ng-model="_linker.selected" ng-change="onItemValueChange(linker)">
          </label>
           {{linker.userName}}
           <p>{{transferDeptName(linker.deptName)}}</p>
        </div>

      </div>
      <ion-infinite-scroll on-infinite="loadMore()" distance="0%"></ion-infinite-scroll>
    </div>
  </ion-content>

  <div class="sino-search-modal" ng-show="searchopen" ng-class="{open: searchopen}">
    <div class="bar item-input-inset">
      <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="searchLinkerScroll" ng-click="closeSearch()">
      <ul class="list" ng-show="searchItems.length > 0">
        <li class="item" ng-class="{'item-checkbox': canCheck}" ng-repeat="item in searchItems track by item.userId" ng-click="!canCheck && toLinkerDetail(item)" ng-init="_linker = linkerSelectorList.get(item.userId)">
          <label class="checkbox" ng-show="canCheck">
              <input type="checkbox" ng-model="_linker.selected" ng-change="onItemValueChange(item)">
          </label>
          {{item.userName}}
        </li>
      </ul>
      <div ng-show="searchItems.length === 0 && search.text !== ''">
        <span class="search-none">无结果</span>
      </div>
    </ion-content>
  </div>
  <div class="bar bar-footer" style="height: auto;max-height: 100px;" ng-show="canCheck">
    <ion-scroll delegate-handle="checkedLinkersDelegateScroll" direction="y" scrollbar-y="false">
       <span class="checked-linker stable-bg assertive" ng-click="clearCheckLiners()">
        清空
      </span>
      <span class="checked-linker stable-bg stable-border" ng-repeat="linker in sendLinkers track by linker.userId" ng-click="removeFromLinkers(linker)" on-touch="deleting = true">
        {{linker.userName}}
      </span>

    </ion-scroll>
  </div>
</div>


