<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0"/>
    <meta name="apple-mobile-web-app-capable" content="yes"/>
    <meta name="apple-mobile-web-app-status-bar-style" content="black"/>
    <meta name="format-detection" content="telephone=no"/>
    <title></title>
    <link rel="stylesheet" type="text/css" href="../../lib/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="./device.css">
    <style type="text/css">
        [v-cloak]{
            display: none;
        }
    </style>
    <script type="text/javascript" src="../../lib/js/start.js"></script>
    <script type="text/javascript" src="../../lib/js/p.js"></script>
    <script type="text/javascript" src="../../lib/js/UIOT.js"></script>
</head>
<body ontouchstart="">

    <div id="app" v-cloak>
        <div class="header">
            <v-touch tag="span" class="header-left icon" v-on:tap="onMyInfoTap">&#xe66f;</v-touch>
            <p>{{ $t('title.device') }}</p>
        </div>
        <div class="content"> 
            <div class="topCpnt">
            	<div v-show="lockId">
	            	<v-touch tag="div" class="doorbellBg" v-bind:class="{ active: doorbellRingingFlag }" v-on:tap="onStopDoorbellRing()">
	                    <div class="doorbellCircle">
	                        <div class="doorbell">
	                            <p></p>
	                        </div>
	                    </div>
	                    <div class="doorbellTip"><span>{{ ringingTime }}</span>{{ ringingTime ? $t('device.doorLockRinging'):'' }}</div>
	               	</v-touch>
	               	<p class="batteryState" :class="[{yellowWarning: batteryPercent<=20},{redWarning: batteryPercent<10}]"><span v-html="batteryState" ></span><span>{{ batteryPercent }}%</span></p>
	            </div>
               	<v-touch tag="div" v-show="!lockId" class="bindDoorlock" v-on:tap="onBindDoorlockTap">
                   	<p>{{ $t('device.bindDoorlock') }}</p>
               	</v-touch>
            </div>
            <div class="deviceHandle">
                <p class="title" v-if="lockId">{{ $t('device.newMsgDoorlock') }}</p>
                <u-marquee ref="umarquee" :active="activeFlag" :init-param="componentsConfig.marquee.initParam"></u-marquee>
                <div class="switchGroup">
                    <div class="guoupRow">
                        <!-- 开门记录 -->
                        <div class="col-xs-6 opendoorRecord" v-bind:class="{newMsg: opendoorRecordFlag}">
                            <u-switch :value="valueOpendoorRecord" :disabled="opendoorRecordDisabledFlag" :init-param="componentsConfig.opendoorRecordSwitch.initParam" v-on:u-switch-tap="onOpendoorRecordTap"></u-switch>
                        </div>
                        <!-- 安全报警 -->
                        <div class="col-xs-6 securityAlarm" v-bind:class="{newMsg: securityAlarmFlag}">
                            <u-switch :value="valueSecurityAlarm" :disabled="securityAlarmDisabledFlag" :init-param="componentsConfig.securityAlarmSwitch.initParam" v-on:u-switch-tap="onSecurityAlarmTap"></u-switch>
                        </div>
                    </div>
                    <div class="guoupRow">
                        <!-- 门锁用户 -->
                        <div class="col-xs-6 doorlockUser">
                            <u-switch :value="valueDoorlockUser" :disabled="doorlockUserDisabledFlag" :init-param="componentsConfig.doorlockUserSwitch.initParam" v-on:u-switch-tap="onDoorlockUserTap"></u-switch>
                        </div>
                        <!-- 劫持报警 -->
                        <div class="col-xs-6 hijackAlarm" v-bind:class="{newMsg: hijackAlarmFlag}">
                            <u-switch :value="valueHijackAlarm" :disabled="hijackAlarmDisabledFlag" :init-param="componentsConfig.hijackAlarmSwitch.initParam" v-on:u-switch-tap="onHijackAlarmTap"></u-switch>
                        </div>
                    </div>
                    <div class="guoupRow">                        
                        <!-- 远程开门 -->
                        <div class="col-xs-6 remoteOpendoor"  v-bind:class="{newMsg: remoteOpendoorFlag}">
                            <u-switch :value="valueRemoteOpendoor && !role" :disabled="remoteOpendoorDisabledFlag || role" :init-param="componentsConfig.remoteOpendoorSwitch.initParam" v-on:u-switch-tap="onRemoteOpendoorTap"></u-switch>
                        </div>
                        <!-- 门锁管理 -->
                        <div class="col-xs-6 doorlockManage" >
                            <u-switch :value="valueDoorlockManage" :disabled="doorlockManageDisabledFlag" :init-param="componentsConfig.doorlockManageSwitch.initParam" v-on:u-switch-tap="onDoorlockManageTap"></u-switch>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <transition name="fade">
            <div class="followServiceNumber-dialog" v-show="followShowFlag">
                <div class="followServiceNumber-dialog-box">
                    <ul class="">
                        <li>{{ $t('device.followTitle') }}</li>
                        <li v-html="$t('device.followCont1')"></li>
                        <li v-html="$t('device.followCont2')"></li>
                        <li>
                            <p></p>
                        </li>
                    </ul>
                    <u-button :init-param="componentsConfig.saveQRcodeButton.initParam" v-on:u-button-tap="onSaveQRcodeButtonTap"></u-button>
                    <p class="linkText"><v-touch tag="span" v-on:tap="onLaterFollowTap">{{ $t('device.laterFollow') }}</v-touch></p>
                </div>
            </div>
        </transition> 
        <transition name="fade">
        	<div class="remoteOpendoorPage" v-show="remoteOpendoorShowFlag">
	            <div class="header">
		            <v-touch tag="span" class="header-left icon" v-on:tap="onBackTap">&#xe611;</v-touch>   
		            <p>{{ $t('title.remoteOpendoor') }}</p>
		        </div>
		        <div class="content"> 
		            <div class="inputBox">
		                <u-text :init-param="componentsConfig.passwordInput.initParam" :text="textPassword"
		                v-on:u-text-change="onPasswordChange(arguments[0])"></u-text>
		                <p class="errorTip" v-if="textErrorTip">{{ textErrorTip }}</p>
		            </div>
		            <u-button :init-param="componentsConfig.confirmButton.initParam" v-on:u-button-tap="onConfirmButtonTap"></u-button>
		        </div>
		        <u-comm-loading ref="ucommloading" :init-param="componentsConfig.ucommloading.initParam" v-on:u-comm-loading-tap="onCommLoadingButtonTap()">
		            <p class="loader"></p>
            		<p class="icon"></p>
		        </u-comm-loading>
		    </div>
        </transition> 
        <u-dialog ref="udialog" :init-param="componentsConfig.dialog.initParam"></u-dialog>
        <u-loading ref="uloading" :init-param="componentsConfig.loading.initParam"></u-loading>
    </div>

    <script type="text/javascript" src="./index.js" defer async></script>
    
</body>
</html>