Browse Source

表单输入框样式调整,表单提交验证提示。

yangc 8 years ago
parent
commit
a7310a2448

+ 5 - 3
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_invoice_ctrl.js

@@ -50,16 +50,18 @@ define(['app/app'], function(app) {
 
             //保存发票信息
             $scope.saveBill = function(flag) {
-                console.log(flag);
-                if (!flag) {
+                var dataValidFlag = $scope.checkValidFrom();
+                if (!flag && dataValidFlag && $scope.bill.is_agree) {
                     $scope.bill.kind = $scope.billType
                     if (!$scope.isAdd) { //修改
                         doSave('修改发票信息');
                     } else { // 新增
                         doSave('添加发票');
                     }
-                } else {
+                } else if (flag || !dataValidFlag) {
                     toaster.pop('error', '请填写正确的发票信息');
+                } else {
+                    toaster.pop('error', '请勾选并阅读《发票须知》');
                 }
             };
             var doSave = function (message) {

+ 10 - 2
src/main/webapp/resources/view/usercenter/forstore/buyer_invoice.html

@@ -424,6 +424,14 @@
     #bill-info .address .form-input-line:first-child {
         margin-left: 15px;
     }
+    #bill-info .control-label{
+        position: relative;
+        top: 7px;
+    }
+    #bill-info .normal-control-label {
+        position: relative;
+        top: 5px;
+    }
 </style>
 <!--右侧主体部分-->
 <div class="user_right fr u_c_invoice">
@@ -620,7 +628,7 @@
                     <div class="form-bottom">
                         <div class="form-group">
                                 <label class="check-active checkbox-inline text-inverse">
-                                    <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" required="required" id="check-mzy">
+                                    <input checked="true" type="checkbox" ng-model="bill.is_agree" name="is_agree" id="check-mzy">
                                     <label for="check-mzy" style="position: relative;bottom: 2px;"></label>
                                     <span style="color: #333;">我已阅读并同意</span>
                                 </label>
@@ -629,7 +637,7 @@
                         <div class="form-btn">
                             <input type="button" value="取消" class="btn" ng-click="setChangeBillStatusFlag(false)">
                             <input type="submit" value="保存" class="btn"
-                                   ng-click="saveBill(form.$invalid||(!bill.is_agree)||(!checkValidFrom()))">
+                                   ng-click="saveBill(form.$invalid)">
                         </div>
                     </div>
                 </form>