|
|
@@ -4,7 +4,7 @@
|
|
|
*/
|
|
|
define(['app/app', 'calendar'], function(app) {
|
|
|
'use strict';
|
|
|
- app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', 'DistributionRule', '$q', function($scope, toaster, VendorService, $rootScope, News, $filter, DistributionRule, $q) {
|
|
|
+ app.register.controller('vendorIndexCtrl', ['$scope', 'toaster', 'VendorService', '$rootScope', 'News', '$filter', 'DistributionRule', '$q', '$modal', function($scope, toaster, VendorService, $rootScope, News, $filter, DistributionRule, $q, $modal) {
|
|
|
document.title = '卖家中心-优软商城';
|
|
|
$rootScope.active = 'index';
|
|
|
VendorService.getVendorInfo(null, function(data){
|
|
|
@@ -51,16 +51,47 @@ define(['app/app', 'calendar'], function(app) {
|
|
|
$q.all([initRuleCount().$promise]).then(function (data) {
|
|
|
if (data){
|
|
|
if ($scope.needShowTip){
|
|
|
- $scope.showNoRuleTip = true;
|
|
|
- }else {
|
|
|
- $scope.showNoRuleTip = false;
|
|
|
+ $modal.open({
|
|
|
+ animation: true,
|
|
|
+ templateUrl: 'static/view/common/modal/delivery_rule_modal.html',
|
|
|
+ controller: 'delete_ctrl'
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ }]);
|
|
|
+
|
|
|
+ app.register.controller('delete_ctrl', ['$scope', 'toaster', '$modalInstance', function ($scope, toaster, $modalInstance) {
|
|
|
+ $scope.tipModal = true;
|
|
|
+
|
|
|
$scope.cancelDelete = function () {
|
|
|
- $scope.showNoRuleTip = false;
|
|
|
- }
|
|
|
-
|
|
|
+ $scope.tipModal = false;
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ };
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 监听点击的事件
|
|
|
+ */
|
|
|
+ document.onclick = function (event) {
|
|
|
+ if($scope.tipModal) {
|
|
|
+ if(event) {
|
|
|
+ var tag = event.target;
|
|
|
+ if(tag) {
|
|
|
+ var attribute = tag.getAttribute("name");
|
|
|
+ while(tag.nodeName != 'BODY') {
|
|
|
+ if(attribute == 'rule_model' ||
|
|
|
+ attribute == 'rule_cancel' || attribute == 'rule_href') {
|
|
|
+ return ;
|
|
|
+ }
|
|
|
+ tag = tag.parentElement;
|
|
|
+ attribute = tag.getAttribute("name");
|
|
|
+ }
|
|
|
+ $scope.tipModal = false;
|
|
|
+ $modalInstance.dismiss();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ };
|
|
|
}]);
|
|
|
});
|