huangb 7 лет назад
Родитель
Сommit
e070edf7e9

+ 12 - 1
src/main/webapp/resources/js/usercenter/app.js

@@ -13,7 +13,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 	// 		$templateCache.removeAll();
 	// 	});
 	// });
-
+    app.directive('onFinishRenderFilters', function ($timeout) {
+        return {
+            restrict: 'A',
+            link: function(scope, element, attr) {
+                if (scope.$last === true) {
+                    $timeout(function() {
+                        scope.$emit('ngRepeatFinished');
+                    });
+                }
+            }
+        };
+    });
 
 	if (!Array.prototype.last){
 		Array.prototype.last = function(){

+ 10 - 4
src/main/webapp/resources/js/usercenter/controllers/forstore/buyer_no_invoice_ctrl.js

@@ -129,9 +129,9 @@ define([ 'app/app' ], function(app) {
       // 内层DIV的滚动加载
       var window = angular.element($window);
       var docu = angular.element($document);
-      if (docu.scrollTop() + window.height() > docu.height() - 330) {
-        angular.element('#applyBtn').slideUp(0)
-      }
+      // if (docu.scrollTop() + window.height() > docu.height() - 330) {
+      //   angular.element('#applyBtn').slideUp(0)
+      // }
       window.on('scroll', function () {
         var scrollTop = docu.scrollTop();
         if (scrollTop + window.height() > docu.height() - 330) {
@@ -140,7 +140,12 @@ define([ 'app/app' ], function(app) {
           angular.element('#applyBtn').slideDown(300)
         }
       });
-
+    $scope.$on('ngRepeatFinished', function (ngRepeatFinishedEvent) {
+        // console.log(1)
+        if (docu.scrollTop() + window.height() > docu.height() - 330) {
+          angular.element('#applyBtn').slideUp(0)
+        }
+    });
 
     }]);
     app.register.controller('NoInvoiceSubmitCtrl', ['$scope','$rootScope','$modal', 'Order', 'toaster', 'submitInvoice', '$modalInstance','invoiceData','BillSubmit','$state', function ($scope, $rootScope, $modal, Order, toaster, submitInvoice, $modalInstance, invoiceData, BillSubmit, $state) {
@@ -231,4 +236,5 @@ define([ 'app/app' ], function(app) {
         }
 
     }]);
+
 });

+ 9 - 3
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_invoice_ctrl.js

@@ -203,9 +203,9 @@ define([ 'app/app' ], function(app) {
       // 内层DIV的滚动加载
       var window = angular.element($window);
       var docu = angular.element($document);
-      if (docu.scrollTop() + window.height() > docu.height() - 330) {
-        angular.element('#applyBtn').slideUp(0)
-      }
+      // if (docu.scrollTop() + window.height() > docu.height() - 330) {
+      //   angular.element('#applyBtn').slideUp(0)
+      // }
       window.on('scroll', function () {
         var scrollTop = docu.scrollTop();
         if (scrollTop + window.height() > docu.height() - 330) {
@@ -214,6 +214,12 @@ define([ 'app/app' ], function(app) {
           angular.element('#applyBtn').slideDown(300)
         }
       });
+        $scope.$on('ngRepeatFinished', function (ngRepeatFinishedEvent) {
+            // console.log(1)
+            if (docu.scrollTop() + window.height() > docu.height() - 330) {
+                angular.element('#applyBtn').slideUp(0)
+            }
+        });
 
     }]);
 });

+ 1 - 1
src/main/webapp/resources/view/usercenter/forstore/buyer_no_invoice.html

@@ -276,7 +276,7 @@ body div.ng-table-pager a.page-a {
                         </tr>
                     </thead>
                     <tbody>
-                        <tr ng-repeat="item in orderData track by $index">
+                        <tr ng-repeat="item in orderData track by $index" on-finish-render-filters>
                             <td>
                                 <lable class="check-act">
                                     <input type="checkbox" id={{$index+1}} ng-checked="item.checked" ng-click="checkInvoice(item)" />

+ 1 - 1
src/main/webapp/resources/view/vendor/forstore/vendor-invoice.html

@@ -425,7 +425,7 @@
                 </tr>
                 </thead>
                 <tbody>
-                    <tr ng-repeat="item in billData track by $index">
+                    <tr ng-repeat="item in billData track by $index" on-finish-render>
                         <td  style="width: 60px;">
                             <lable class="check-act">
                                 <input type="checkbox" id={{$index+1}} ng-checked="item.checked" ng-click="checkInvoice(item)" />