Forráskód Böngészése

修复产品收藏,关注,浏览历史的bug问题

hulh 8 éve
szülő
commit
2d3441e113

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

@@ -560,7 +560,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 					 size : 'sm',
 					 resolve : {
 						haveAdd : function(){
-							if (data == "success"){
+							if (data.data == "success"){
 								return true;
 							} else{
 								return false;

+ 5 - 0
src/main/webapp/resources/js/usercenter/controllers/ComponentStoreCtrl.js

@@ -18,7 +18,11 @@ define(['app/app'], function(app) {
 			params.page = $scope.pageInfo.page;
 			params.count = $scope.pageInfo.count;
 			collectionService.getStoreByUUAndComponent.call(null, params,function(data) {
+				$scope.isChooseAll = false;
 				$scope.collectInfo = data.content;
+				if ($scope.collectInfo.length==0){
+					$scope.isBatch = false;
+				}
 				$scope.totalElements = data.totalElements;
 				$scope.totalPages = data.totalPages;
 				$scope.number = data.number;
@@ -161,6 +165,7 @@ define(['app/app'], function(app) {
 				}
 				$scope.isBatchDelete = false;
 				$scope.deleteDiv = false;
+				$scope.isChooseAll = false;
 			} else {
 				collectionService.deleteStoreById({id: $scope.deleteID}, null, function(data) {
 					var store = [];

+ 4 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/browsing_history.js

@@ -12,6 +12,7 @@ define(['app/app'], function(app) {
 
         var loadData = function(){
             GoodsBrowsingHistory.getAllHistoryPage($scope.param, function(data){
+                $scope.isChooseAll = false;
                 $scope.initHistory = data.content;
                 $scope.param.currentPage = data.number;
                 $scope.totalPages = data.totalPages;
@@ -34,6 +35,9 @@ define(['app/app'], function(app) {
                     newhistory.dateList = $scope.midhistory[uniqueArr[i]];
                     $scope.history.push(newhistory);
                 };
+                if ($scope.history.length == 0){
+                    $scope.isBatch = false;
+                }
             },function () {
                 toaster.pop("error", "获取浏览历史记录失败");
             })

+ 4 - 0
src/main/webapp/resources/js/usercenter/controllers/forstore/store_focus_ctrl.js

@@ -16,7 +16,11 @@ define(['app/app'], function(app) {
 		
 		var loadData = function(){
 			StoreFocusService.getStoreFocusPage($scope.param, {}, function(data){
+                $scope.isChooseAll = false;
 				$scope.store = data.content;
+                if ($scope.store.length == 0){
+                    $scope.isBatch = false;
+                }
                 $scope.totalElements = data.totalElements;
                 $scope.param.currentPage = data.number;
                 $scope.totalPages = data.totalPages;

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

@@ -239,7 +239,7 @@ td {
 <div class="user_right fr">
 	<div class="rt_menu">
 		<span style="color:#5078cb">产品收藏({{totalElements}})</span>
-		<span ng-click="doBatch()" style="margin-left:840px" ng-hide="isBatch"><a>批量操作</a></span>
+		<span ng-click="doBatch()" style="margin-left:840px" ng-hide="isBatch || collectInfo.length == 0 || !collectInfo"><a>批量操作</a></span>
 		<div ng-show="isBatch" class="collect-batch">
 			<span ng-click="cancleBatch()"><a>取消</a></span>
 			<span ng-click="deleteByselected()"><a>移除</a></span>

+ 3 - 3
src/main/webapp/resources/view/usercenter/forstore/browsing_history.html

@@ -389,9 +389,9 @@
             </select>-->
         </div>
         <div class="fr">
-            <span ng-hide="isBatch"ng-click="doBatch()">批量操作</span>
-            <span ng-show="isBatch"ng-click="cancleBatch()">取消</span>
-            <span ng-show="isBatch"ng-click="deleteByIds()">删除</span>
+            <span ng-hide="isBatch || history.length == 0" ng-click="doBatch()">批量操作</span>
+            <span ng-show="isBatch" ng-click="cancleBatch()">取消</span>
+            <span ng-show="isBatch" ng-click="deleteByIds()">删除</span>
             <span ng-show="isBatch">
                 <label class="check-active">
                     <input type="checkbox" id="isChooseAll" ng-checked="isChooseAll" ng-click="chooseAllHistory()">

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

@@ -277,7 +277,7 @@
 	<div class="store-whole">
 		<div class="store-header">
 			<span>全部店铺({{totalElements}})</span>
-			<span style="margin-left:850px;cursor:pointer;" ng-click="doBatch()" ng-hide="isBatch">批量操作</span>
+			<span style="margin-left:850px;cursor:pointer;" ng-click="doBatch()" ng-hide="isBatch || store.length == 0">批量操作</span>
 			<div ng-show="isBatch" class="store-isBatch">
 				<span ng-click="cancelBatch()">取消</span>
 				<span ng-click="deleteByIds()">取消关注</span>