
<style>
span.unit {
	color: #333;
	font-size: 13px;
	margin: 0 5px 0 2px;
	vertical-align: middle;
}
ul.line label.desG.tip{
	margin-left: 76px;
	font-size: 12px;
	line-height: 20px;
}
</style>
<div class="detailCon">
	<ul class="line">
		<!-- 雨刷模式 -->
		<li class="line lineE">
			<label class="des desA">{%label.wiperMode%}</label>
			<span class="selCon">
				<span id="wiperModeSel" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
		<li class="line">
			<label class="des desG tip" id="wiperModeTip">{%label.wiperAutoTip%}</label>
		</li>
		<!-- 持续时间 -->
		<li class="line lineE subLine modeTiming">
			<label class="des desA">{%label.wiperDuration%}</label>
			<input id="durationHour" class="text textA4" maxLength="2" type="text" /><span class="unit">{%label.lHour%}</span>
			<input id="durationMin" class="text textA4" maxLength="2" type="text" /><span class="unit">{%label.minuteT%}</span>
			<span class="tip">{%label.wiperDurationTip%}</span>
		</li>
		<!-- 工作频率 -->
		<li class="line lineE subLine modeTiming">
			<label class="des desA">{%label.wiperFreq%}</label>
			<span class="selCon">
				<span id="wiperFreqSel" class="select">
					<span class="value hsValueA"></span>
					<i class="arrow"></i>
				</span>
			</span>
		</li>
	</ul>
	<!-- 功能按钮 -->
	<div class="funcBtnCon">
		<input id="save" type="button" value="{%btn.save%}" class="subBtn btnA" />
	</div>
</div><script type="text/javascript">function init(){function l(b){var a="";closeNoteAll();switch(b){case ENONE:return!0;case ESYSTEM:a=errStr.systemErr;break;case EINVARG:a=errorStr.invalidArg;break;case WIPER_DURARION_ERR:a=errStr.wiperDurationErr;break;default:a=errStr.unknown+b}closeToast();showAlert(a);return!1}function u(){var b=0,a={};a[d]={};a[d][NAME]=[e.status];$.queryP(a,function(a){!0==l(a[ERR_CODE])&&(b=parseInt(a[d][e.status][f.remainingTime]))},!1);return b}function w(){var b=function(a){var b={};b[d]={};b[d][e.workConfig]=
{};b[d][e.workConfig][f.mode]=m.value;if(a){a=parseInt(h.value);var c=parseInt(k.value);b[d][e.workConfig][f.duration]=(60*a+c).toString();b[d][e.workConfig][f.speed]=q.value}showToast();$.modify(b,function(a){!0==l(a[ERR_CODE])&&showToast("success")})},a=m.value==c.cycle?!0:!1,v=a?n():!0,x=a?u():0;v&&(a&&0<x?showConfirm(label.wiperSaveTip,function(c){c&&b(a)}):b(a))}function r(b){var a=label.wiperAutoTip;b==c.cycle?(a=label.wiperTimingTip+"<br/>"+label.wiperBrushTip,$(".modeTiming").show()):(a=b==
c.single?label.wiperManualTip+"<br/>"+label.wiperBrushTip:label.wiperAutoTip,$(".modeTiming").hide());id("wiperModeTip").innerHTML=a}function y(b){}function n(){res=!1;var b=parseInt(h.value),a=parseInt(k.value);isNaN(b)||0>b?showNote("durationHour",errStr.inputNumErr):isNaN(a)||60<=a||0>a?showNote("durationMin",errStr.inputNumErr):0==b&&0==a?showNote("durationMin",errStr.wiperDurationMinErr):24<b||24==b&&0<a?showNote("durationMin",errStr.wiperDurationMaxErr):res=!0;return res}var d=uciWiper.fileName,
e=uciWiper.secName,f=uciWiper.optName,c=uciWiper.optValue,m=id("wiperModeSel"),q=id("wiperFreqSel"),h=id("durationHour"),k=id("durationMin"),g=[{str:label.wiperAuto,value:c.auto},{str:label.wiperTiming,value:c.cycle},{str:label.wiperManual,value:c.single}],s=[{str:label.high,value:c.high},{str:label.medium,value:c.normal},{str:label.low,value:c.low}],p=[],t=!1;(function(){p=$.wiperCapability[uciWiperCapability.optName.modeList];for(var b=[],a=0;a<g.length;a++)0<=$.inArray(g[a].value,p)&&b.push(g[a]);
g=b;selectInit("wiperModeSel",g,g[0].value,r);0<=$.inArray(c.cycle,p)?(t=!0,selectInit("wiperFreqSel",s,s[0].value,y),h.onchange=n,k.onchange=n):$(".modeTiming").hide();id("save").onclick=w;b={};b[d]={};b[d][NAME]=[e.workConfig];$.query(b,function(a){if(!0==l(a[ERR_CODE])){a=a[d][e.workConfig];var b=a[f.mode];m.resetSel(b);r(b);if(t){var b=parseInt(a[f.duration]),c=Math.round(b/60);h.value=c.toString();k.value=(b-60*c).toString();q.resetSel(a[f.speed])}showDetailCon()}})})()}init();
</script>