|
@@ -4,7 +4,7 @@
|
|
|
*/
|
|
*/
|
|
|
define(['app/app', 'calendar'], function(app) {
|
|
define(['app/app', 'calendar'], function(app) {
|
|
|
'use strict';
|
|
'use strict';
|
|
|
- app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter','$modal', function($scope, toaster, VendorService, $rootScope, News, $filter,$modal) {
|
|
|
|
|
|
|
+ app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', '$modal', 'DistributionRule', '$q', function($scope, toaster, VendorService, $rootScope, News, $filter, $modal, DistributionRule, $q) {
|
|
|
$rootScope.active = 'index';
|
|
$rootScope.active = 'index';
|
|
|
$scope.userInfo = $rootScope.userInfo;
|
|
$scope.userInfo = $rootScope.userInfo;
|
|
|
//个人账户
|
|
//个人账户
|
|
@@ -41,37 +41,6 @@ define(['app/app', 'calendar'], function(app) {
|
|
|
//
|
|
//
|
|
|
// });
|
|
// });
|
|
|
|
|
|
|
|
- //安全设置提醒框
|
|
|
|
|
- $scope.openHomeCenterModel = function() {
|
|
|
|
|
- var modalInstance = $modal.open({
|
|
|
|
|
- animation: true,
|
|
|
|
|
- templateUrl: $rootScope.rootPath + '/static/view/usercenter/modal/homeCenter_modal.html',
|
|
|
|
|
- controller:'homeModalCtrl'
|
|
|
|
|
- });
|
|
|
|
|
- modalInstance.result.then(function(){
|
|
|
|
|
- }, function(){
|
|
|
|
|
- });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- //安全级别
|
|
|
|
|
- if(!($scope.userInfo.pwdEnable && $scope.userInfo.haveUserQuestion && ($scope.userInfo.userEmail==null?false:true))){
|
|
|
|
|
- $scope.openHomeCenterModel();
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- }]);
|
|
|
|
|
-
|
|
|
|
|
- app.register.controller('homeModalCtrl', ['$scope', '$modalInstance', 'toaster', '$http', 'ShippingAddress','$state', function($scope, $modalInstance, toaster, $http, ShippingAddress,$state){
|
|
|
|
|
- console.info($scope.userInfo);
|
|
|
|
|
- $scope.goLink = function(op){
|
|
|
|
|
- $state.go('vendor_account_management',{op:op});
|
|
|
|
|
- $modalInstance.dismiss('cancel');
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
- $scope.cancel = function (){
|
|
|
|
|
- $modalInstance.dismiss('cancel');
|
|
|
|
|
- }
|
|
|
|
|
- }]);
|
|
|
|
|
-
|
|
|
|
|
var initRuleCount = function () {
|
|
var initRuleCount = function () {
|
|
|
return DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
return DistributionRule.findCountOfActiveRule({},{},function (data) {
|
|
|
if (data.success){
|
|
if (data.success){
|
|
@@ -81,29 +50,55 @@ define(['app/app', 'calendar'], function(app) {
|
|
|
toaster.pop("error", error.data);
|
|
toaster.pop("error", error.data);
|
|
|
})
|
|
})
|
|
|
};
|
|
};
|
|
|
- initRuleCount();
|
|
|
|
|
|
|
|
|
|
- $q.all([initRuleCount().$promise]).then(function (data) {
|
|
|
|
|
- if (data){
|
|
|
|
|
- if ($scope.needShowTip){
|
|
|
|
|
- $modal.open({
|
|
|
|
|
- animation: true,
|
|
|
|
|
- templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
|
|
- controller: 'rule_tip_ctrl',
|
|
|
|
|
- resolve : {
|
|
|
|
|
- type : function() {
|
|
|
|
|
- return 'center';
|
|
|
|
|
- },
|
|
|
|
|
- tipModal : function() {
|
|
|
|
|
- return true;
|
|
|
|
|
|
|
+ //安全设置提醒框
|
|
|
|
|
+ $scope.openHomeCenterModel = function() {
|
|
|
|
|
+ var modalInstance = $modal.open({
|
|
|
|
|
+ animation: true,
|
|
|
|
|
+ templateUrl: $rootScope.rootPath + '/static/view/usercenter/modal/homeCenter_modal.html',
|
|
|
|
|
+ controller:'homeModalCtrl'
|
|
|
|
|
+ });
|
|
|
|
|
+ modalInstance.result.then(function(){
|
|
|
|
|
+ }, function(){
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ //安全级别
|
|
|
|
|
+ if(!($scope.userInfo.pwdEnable && $scope.userInfo.haveUserQuestion && ($scope.userInfo.userEmail==null?false:true))){
|
|
|
|
|
+ $scope.openHomeCenterModel();
|
|
|
|
|
+ } else {
|
|
|
|
|
+ $q.all([initRuleCount().$promise]).then(function (data) {
|
|
|
|
|
+ if (data){
|
|
|
|
|
+ if ($scope.needShowTip){
|
|
|
|
|
+ $modal.open({
|
|
|
|
|
+ animation: true,
|
|
|
|
|
+ templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
|
|
+ controller: 'rule_tip_ctrl',
|
|
|
|
|
+ resolve : {
|
|
|
|
|
+ type : function() {
|
|
|
|
|
+ return 'center';
|
|
|
|
|
+ },
|
|
|
|
|
+ tipModal : function() {
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
- }
|
|
|
|
|
- });
|
|
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+ app.register.controller('homeModalCtrl', ['$scope', '$modalInstance', 'toaster', '$http', 'ShippingAddress','$state', function($scope, $modalInstance, toaster, $http, ShippingAddress,$state){
|
|
|
|
|
+ console.info($scope.userInfo);
|
|
|
|
|
+ $scope.goLink = function(op) {
|
|
|
|
|
+ $state.go('vendor_account_management',{op:op});
|
|
|
|
|
+ $modalInstance.dismiss('cancel');
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
|
|
+ $scope.cancel = function () {
|
|
|
|
|
+ $modalInstance.dismiss('cancel');
|
|
|
|
|
+ }
|
|
|
|
|
+ }]);
|
|
|
});
|
|
});
|