<!-- 设备管理页面 -->
<ion-view cache-view="false">
	<ion-nav-title>
		<h1 class="title"></h1>
	</ion-nav-title>
	<ion-nav-buttons side="left">
		<button class="button icon-left ion-ios-arrow-back button-clear" sino-nav-direction="back" sino-go-back-button>返回</button>
	</ion-nav-buttons>

	<ion-content class="device-revise-content" ng-init="getUserLoginRecordsOnDevice()">
		<div class="account-protect">
			<div class="account-top">
				<img class="account-picture" src="images/accountProtect/deviceManager.png">
				<span class="account-font">保护账户安全</span>
			</div>
		</div>
		<ion-list>
			<ion-item class="item item-icon-left">
				<i class="icon ion-iphone"></i>
				<span class="show device-manager" ng-if="device">{{device.model}}</span>
				<span style="color:#33cd5f;" class="item-right">正在使用</span>
			</ion-item>

			<ion-item class="item-divider" ng-if="loginDeviceRecords.length > 0">其他设备</ion-item>

			<ion-item ng-repeat="item in loginDeviceRecords" ng-if="item.devSn !== device.uuid"
			item="item" class="item-remove-animate item item-icon-left">
				<i class="icon ion-iphone"></i>
				<h2>
					{{item.devName}}
				</h2>
				<p>最近登录时间：{{item.latelyLoginTime}}</p>

				<div class="item-right">
					<span class="lock" ng-if="item.lockStatus === 'LOCK'">已锁定</span>
					<span style="color:#0c63ee;" ng-if="item.bindingStatus === '1'">等待绑定</span>
          <span style="color:#0c63ee;" ng-if="item.bindingStatus === '3'">绑定审批未通过</span>
				</div>
				<ion-option-button class="button-balanced" stop-event ng-click="applyBind(item)" ng-if="item.bindingStatus === '1' || item.bindingStatus === '3'">绑定</ion-option-button>
				<ion-option-button class="button-assertive" stop-event ng-click="rejectBind(item)" ng-if="item.bindingStatus === '1'">取消绑定申请</ion-option-button>
				<ion-option-button class="button-royal" stop-event ng-click="unBind(item)" ng-if="item.bindingStatus === '2'">解除绑定</ion-option-button>
				<ion-option-button class="button-assertive" stop-event
				ng-click="lock(item)" ng-if="item.lockStatus === 'UNLOCK'">
				锁定
				</ion-option-button>
				<ion-option-button class="button-calm" stop-event
				ng-click="unlock(item)" ng-if="item.lockStatus !== 'UNLOCK'">
				解锁
				</ion-option-button>
			</ion-item>
		</ion-list>
		<div style="text-align: center;" ng-if="refreshState.begin && !refreshState.done">
			<ion-spinner></ion-spinner>
		</div>

	</ion-content>
</ion-view>
