Browse Source

autofill样式处理

yangc 8 years ago
parent
commit
4afddd24ef

+ 8 - 4
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -435,12 +435,16 @@
     .bg-fff8ee {
         background: #fff8ee;
     }
+    .bg-fff {
+        -webkit-box-shadow: 0 0 0px 1000px white inset!important;
+    }
     input:-webkit-autofill,
     input:-webkit-autofill:hover,
     input:-webkit-autofill:focus,
     input:-webkit-autofill:active {
         -webkit-transition-delay: 99999s;
         -webkit-transition: color 99999s ease-out, background-color 99999s ease-out;
+       /* -webkit-box-shadow: 0 0 0px 1000px white inset;*/
     }
 </style>
 <!--右侧主体部分-->
@@ -549,14 +553,14 @@
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>单位电话:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyPhone&&form.companyPhone.$error.required}" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true;initFlag.initCompanyPhone=false;" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyPhone&&form.companyPhone.$error.required, 'bg-fff':!form.companyPhone.$invalid}" ng-focus="form.companyPhone.$touched = false" ng-blur="form.companyPhone.$touched = true;initFlag.initCompanyPhone=false;" placeholder="区号和号码使用 '-' 隔开" name="companyPhone" ng-model="bill.companyPhone" ng-pattern="/^0\d{2,3}-[1-9]\d{6,7}$/" ng-maxlength="20" required="required">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.companyPhone.$touched&&form.companyPhone.$invalid" ng-bind="form.companyPhone.$error.required?'请填写单位电话':form.companyPhone.$error.maxlength?'请勿超过20个字符':'请填写正确的电话号码,用-隔开'"></div>
                     </div>
                     <div class="form-group"  ng-if="billType == 1205">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>税务登记号:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyTaxNum&&form.companyTaxNum.$error.required}" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true; initFlag.initCompanyTaxNum = false;" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initCompanyTaxNum&&form.companyTaxNum.$error.required, 'bg-fff':!form.companyTaxNum.$invalid}" ng-model="bill.companyTaxNumber" ng-focus="form.companyTaxNum.$touched = false" ng-blur="form.companyTaxNum.$touched = true; initFlag.initCompanyTaxNum = false;" name="companyTaxNum" required="true" ng-maxlength="20" ng-minlength="15" ng-pattern="/^[0-9a-zA-Z]+$/" placeholder="请输入税务登记号">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.companyTaxNum.$touched&&(form.companyTaxNum.$invalid)" ng-bind="form.companyTaxNum.$error.required?'请填写税务登记号':'请填写15-20位数字或字母'"></div>
                     </div>
@@ -596,8 +600,8 @@
                     <div class="form-group">
                         <label class="col-md-2 control-label"><b class="text-inverse">*</b>联系电话:</label>
                         <div class="form-input-line">
-                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
-                                   ng-pattern="/^[0-9]*$/" ng-maxlength="11" ng-minlength="8" required="required" placeholder="请输入联系电话">
+                            <input type="text" class="form-control" ng-class="{'bg-fff8ee':!initFlag.initTelephone&&form.billTel.$error.required, 'bg-fff':!form.billTel.$invalid||!form.billTel.$touched}" ng-model="bill.telephone" ng-focus="form.billTel.$touched = false" ng-blur="form.billTel.$touched = true; initFlag.initTelephone=false;" name="billTel"
+                                   ng-pattern="/^[0-9]*$/" ng-minlength="8" ng-maxlength="11" required="required" placeholder="请输入联系电话">
                         </div>
                         <div class="text-inverse error col-md-3" ng-show="form.billTel.$touched&&form.billTel.$invalid" ng-bind="form.billTel.$error.required?'请填写联系电话':'请输入8-11位数字'"></div>
                     </div>