Просмотр исходного кода

Merge remote-tracking branch 'origin/dev-mysql' into feature-vendorRecommend-dongbw-180425

dongbw 7 лет назад
Родитель
Сommit
a84eb6ebb7

+ 14 - 3
src/main/webapp/resources/js/vendor/app.js

@@ -639,10 +639,9 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 		}
 	});
 
-	app.run(['$rootScope', '$state', '$q', 'BaseService', 'StoreInfo', '$location', function($rootScope, $state, $q, BaseService, StoreInfo, $location) {
+	app.run(['$rootScope', '$state', '$q', 'BaseService', 'StoreInfo', '$location', 'AuthenticationService', 'toaster', function($rootScope, $state, $q, BaseService, StoreInfo, $location, AuthenticationService, toaster) {
 		$rootScope.rootPath = BaseService.getRootPath();
 		$rootScope.page = 'vendor';// 导航栏状态,'个人中心'状态激活
-
 		var getToStateName = function () {
 			if ($rootScope.store && (!$rootScope.store.status || $rootScope.store.status === 'OPENED')) {
 				return 'vendor_store_maintain';
@@ -690,7 +689,19 @@ define([ 'angularAMD', 'ngLocal', 'common/services', 'common/directives', 'commo
 			}
 
 			if ($rootScope.applyStatus === 'NONE' && $location.$$path === '/index') {
-				$state.go('vendor_store_apply');
+                AuthenticationService.getAuthentication().success(function (data) {
+                    angular.forEach(data.enterprises, function (item) {
+                        if (item.current) {
+                            data.enterprise = item;
+                        }
+                    });
+                    $rootScope.userInfo = data;
+                    if (!(!data.pwdEnable || !data.haveUserQuestion||!data.emailValidCode || data.emailValidCode != 2)) {
+                        $state.go('vendor_store_apply');
+                    }
+                }).error(function (error) {
+                    toaster.pop('error', '获取登录信息失败');
+                })
 			}
 
 			$rootScope.$on('$stateChangeStart', function (event, toState) {

+ 43 - 33
src/main/webapp/resources/js/vendor/controllers/forstore/vendor_store_apply_ctrl.js

@@ -50,41 +50,51 @@ define(['app/app', 'jquery-uploadify'], function (app) {
 		 */
 		function activate() {
 			// 获取企业信息
-			var enterprise = $rootScope.userInfo.enterprise;
-			Enterprise.getEnterpriseInfo({ enuu : enterprise.uu}, {}, function (enterprise) {
-				$scope.enterprise = enterprise || {};
-
-				StoreInfo.findLastUnPassApplyByEnuu({}, {}, function (result) {
-					console.log('UN_PASS_APPLY', result);
-					if (result) {
-						switchTab(result.type);
-						if (result.qualifications) {
-							angular.forEach(result.qualifications, function (qualification) {
-								$scope.qualifications[qualification.type] = qualification;
-							});
-						}else {
-							Enterprise.getEnterpriseDetailInfo({ enuu : enterprise.uu},{},function (enterpriseDetail) {
-								$scope.enBuinesssCode = enterpriseDetail.businessCodeImage;
-                                $scope.qualifications[$scope.qType.businessLicense] = generateQualification($scope.enBuinesssCode, $scope.qType.businessLicense);;
-                            });
-						}
-						if (result.brands) {
-							$scope.brands = [];
-							angular.forEach(result.brands, function (brand) {
-								var newBrand = {};
-								newBrand.name = brand.name;
-								newBrand.url = brand.url;
-								$scope.brands.push(newBrand);
-							});
-						}
-						$scope.reason = result.reason;
+			AuthenticationService.getAuthentication().success(function (data) {
+				angular.forEach(data.enterprises, function (item) {
+					if (item.current) {
+						data.enterprise = item;
 					}
-				}, function (error) {
-					console.log('INITIAL_ERROR', error);
 				});
-			}, function () {
-				toaster.pop('error', '获取企业信息失败');
-			});
+				$rootScope.userInfo = data;
+				var enterprise = $rootScope.userInfo.enterprise;
+				Enterprise.getEnterpriseInfo({ enuu : enterprise.uu}, {}, function (enterprise) {
+					$scope.enterprise = enterprise || {};
+
+					StoreInfo.findLastUnPassApplyByEnuu({}, {}, function (result) {
+						console.log('UN_PASS_APPLY', result);
+						if (result) {
+							switchTab(result.type);
+							if (result.qualifications) {
+								angular.forEach(result.qualifications, function (qualification) {
+									$scope.qualifications[qualification.type] = qualification;
+								});
+							}else {
+								Enterprise.getEnterpriseDetailInfo({ enuu : enterprise.uu},{},function (enterpriseDetail) {
+									$scope.enBuinesssCode = enterpriseDetail.businessCodeImage;
+									$scope.qualifications[$scope.qType.businessLicense] = generateQualification($scope.enBuinesssCode, $scope.qType.businessLicense);;
+								});
+							}
+							if (result.brands) {
+								$scope.brands = [];
+								angular.forEach(result.brands, function (brand) {
+									var newBrand = {};
+									newBrand.name = brand.name;
+									newBrand.url = brand.url;
+									$scope.brands.push(newBrand);
+								});
+							}
+							$scope.reason = result.reason;
+						}
+					}, function (error) {
+						console.log('INITIAL_ERROR', error);
+					});
+				}, function () {
+					toaster.pop('error', '获取企业信息失败');
+				});
+			}).error(function (error) {
+				toaster.pop('error', '获取登录信息失败');
+			})
 		}
 		// 获取已登录的用户信息
 		var getAuthentication = function() {

+ 2 - 2
src/main/webapp/resources/view/vendor/left_nav.html

@@ -60,7 +60,7 @@
 				<!-- 我的店铺申述 store -->
 				<span  ui-sref="vendor_store_maintain" ng-if="store && store.status && store.status !== 'OPENED'">我的店铺</span>
 			</li>
-			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><a  ui-sref="vendorSeekPurchase">求购询价</a></li>
+			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ui-sref="vendorSeekPurchase">求购询价</span></li>
 		<li ng-class="{'active' : active == 'vendor_logistics'}">
 			<span  ui-sref="vendor_logistics" ng-hide="store && (!store.status || store.status === 'OPENED')">物流管理</span>
 			<span  ui-sref="vendor_deliveryRule" ng-if="store && (!store.status || store.status === 'OPENED')">物流管理</span>
@@ -96,7 +96,7 @@
 				<!-- 我的店铺申述 store -->
 				<span ng-click="promptUpdate()" class="disabled"  ng-if="store && store.status && store.status !== 'OPENED'">店铺管理</span>
 			</li>
-			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><a ng-click="promptUpdate()" class="disabled">求购询价</a></li>
+			<li ng-class="{'active' : active == 'vendor_seek_purchase'}"><span ng-click="promptUpdate()" class="disabled">求购询价</span></li>
 			<li ng-class="{'active' : active == 'vendor_logistics'}"><span ng-click="promptUpdate()" class="disabled">物流管理</span></li>
 			<li ng-class="{'active' : active == 'vendor_invoice'}"><span ng-click="promptUpdate()" class="disabled" >发票管理</span></li>
 			<!--	<li ng-class="{'active' : active == 'vendor_logistics'}"><span  ui-sref="vendor_logistics">物流管理</span></li>-->