Authored by xuqi

init with eyes close

@@ -25,12 +25,19 @@ var phoneRegx = { @@ -25,12 +25,19 @@ var phoneRegx = {
25 '+61': /^[0-9]{11}$/ 25 '+61': /^[0-9]{11}$/
26 }; 26 };
27 27
28 -//密码显示隐藏  
29 -function bindEyesEvt() { 28 +/**
  29 + * 密码显示隐藏
  30 + * @params opt 初始化参数
  31 + */
  32 +function bindEyesEvt(opt) {
30 var $hasEye = $('.has-eye'), 33 var $hasEye = $('.has-eye'),
31 $eye; 34 $eye;
32 35
  36 + if (opt && opt.status === 'open') {
  37 + $hasEye.append('<div class="eye"></div>');
  38 + } else {
33 $hasEye.append('<div class="eye close"></div>'); 39 $hasEye.append('<div class="eye close"></div>');
  40 + }
34 $eye = $hasEye.children('.eye'); 41 $eye = $hasEye.children('.eye');
35 42
36 $eye.on('tap', function(e) { 43 $eye.on('tap', function(e) {
@@ -14,7 +14,9 @@ var tip = require('../../plugin/tip'); @@ -14,7 +14,9 @@ var tip = require('../../plugin/tip');
14 var trim = $.trim; 14 var trim = $.trim;
15 var showErrTip = tip.show; 15 var showErrTip = tip.show;
16 16
17 -api.bindEyesEvt(); 17 +api.bindEyesEvt({
  18 + status: 'open' //默认眼睛打开
  19 +});
18 20
19 $pwd.bind('input', function() { 21 $pwd.bind('input', function() {
20 if (trim($pwd.val()) === '') { 22 if (trim($pwd.val()) === '') {