Procházet zdrojové kódy

店铺管理列表页面显示店铺的标签

huxz před 8 roky
rodič
revize
cc41625bb9

+ 77 - 0
src/main/webapp/resources/js/admin/controllers/StoreInfoListCtrl.js

@@ -44,6 +44,83 @@ define([ 'app/app' ], function(app) {
 			}
 		});
 
+		$scope.newStoreMap = {};
+
+		/**
+		 * 获取新开原厂店铺
+		 */
+		StoreInfo.findNewStore({ types : 'ORIGINAL_FACTORY' }, {}, function (page) {
+			if (page && page.content && page.content.length > 0) {
+				angular.forEach(page.content, function (store) {
+					$scope.newStoreMap[store.uuid] = true;
+				});
+			}
+		}, function (resp) {
+		});
+
+		/**
+		 * 获取新入驻经销代理店铺信息
+		 */
+		StoreInfo.findNewStore({ types : 'AGENCY-DISTRIBUTION' }, {}, function (page) {
+			if (page && page.content && page.content.length > 0) {
+				angular.forEach(page.content, function (store) {
+					$scope.newStoreMap[store.uuid] = true;
+				});
+			}
+		}, function (resp) {
+		});
+
+		$scope.hotSalesMap = {};
+
+		/**
+		 * 获取原厂销售排行信息
+		 */
+		StoreInfo.findTopStoreBySales({ isOriginal: true }, {}, function (stores) {
+			if (stores && stores.length > 0) {
+				angular.forEach(stores, function (store) {
+					$scope.hotSalesMap[store.uuid] = true;
+				});
+			}
+		}, function (resp) {
+		});
+
+		/**
+		 * 获取经销代理销售排行信息
+		 */
+		StoreInfo.findTopStoreBySales({ isOriginal: false }, {}, function (stores) {
+			if (stores && stores.length > 0) {
+				angular.forEach(stores, function (store) {
+					$scope.hotSalesMap[store.uuid] = true;
+				});
+			}
+		}, function (resp) {
+		});
+
+		$scope.excellentSupplierMap = {};
+
+		/**
+		 * 获取原厂推荐信息
+		 */
+		StoreInfo.fiveStoresByTypes({	num : 5, types : 'ORIGINAL_FACTORY' }, {}, function (data) {
+			if (data && data.length > 0) {
+				angular.forEach(data, function (store) {
+					$scope.excellentSupplierMap[store.uuid] = true;
+				});
+			}
+		}, function () {
+		});
+
+		/**
+		 * 获取经销代理优秀供应商信息
+		 */
+		StoreCms.getStoreCmsByUseForAndCmsType({ num:5, types:'AGENCY-DISTRIBUTION' }, function (exStoreCms) {
+			if (exStoreCms && exStoreCms.length > 0) {
+				angular.forEach(exStoreCms, function (store) {
+					$scope.excellentSupplierMap[store.uuid] = true;
+				});
+			}
+		});
+
 		/**
 		 * 添加到店铺相关内容管理系统
 		 *

+ 3 - 3
src/main/webapp/resources/view/admin/store_info_list.html

@@ -244,13 +244,13 @@
 				<td><span ng-bind="store.createTime | date : 'yyyy-MM-dd HH:mm:ss'"></span></td>
 				<td><span ng-bind="store.updateTime | date : 'yyyy-MM-dd HH:mm:ss'"></span></td>
 				<td class="hot-icon">
-					<div>
+					<div ng-if="newStoreMap[store.uuid]">
 						<i class="hot"></i><span>热销</span>
 					</div>
-					<div>
+					<div ng-if="hotSalesMap[store.uuid]">
 						<i class="new"></i><span>新入驻</span>
 					</div>
-					<div>
+					<div ng-if="excellentSupplierMap[store.uuid]">
 						<i class="new-apply"></i><span>优秀供应商</span>
 					</div>
 				</td>