|
|
@ -258,12 +258,26 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', function ($scope, $http, $state, $stateParams, commonDialog) {
|
|
|
|
app.controller('cmsAddArticleCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', function ($scope, $http, $state, $stateParams, commonDialog) {
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.article.reference = $scope.reference;
|
|
|
|
$scope.article.reference = $scope.reference;
|
|
|
|
|
|
|
|
$scope.article.royalpay_industry = $scope.royalpay_industry;
|
|
|
|
$http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) {
|
|
|
|
$http.post('/app/cms/categories/' + $stateParams.catId + '/articles', $scope.article).then(function (resp) {
|
|
|
|
$state.go('^.article_view', {articleId: resp.data.article_id});
|
|
|
|
$state.go('^.article_view', {articleId: resp.data.article_id});
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message})
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.loadRoyalpayindustry = function () {
|
|
|
|
|
|
|
|
$http.get('/static/data/rp_industry_apply.json').then(function (resp) {
|
|
|
|
|
|
|
|
$scope.royalpayindustry = resp.data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.loadRoyalpayindustry();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.onRoyalPayIndustrySelect = function (selectedItem) {
|
|
|
|
|
|
|
|
$scope.royalpay_label = selectedItem.label;
|
|
|
|
|
|
|
|
$scope.royalpay_industry = selectedItem.mccCode;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) {
|
|
|
|
app.controller('cmsArticleEditCtrl', ['$scope', '$http', '$state', '$stateParams', 'commonDialog', 'article', function ($scope, $http, $state, $stateParams, commonDialog, article) {
|
|
|
@ -274,14 +288,32 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
$scope.reference = {};
|
|
|
|
$scope.reference = {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if($scope.article.royalpay_industry){
|
|
|
|
|
|
|
|
$scope.royalpay_industry = $scope.article.royalpay_industry;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.article.reference = $scope.reference;
|
|
|
|
$scope.article.reference = $scope.reference;
|
|
|
|
|
|
|
|
$scope.article.royalpay_industry = $scope.royalpay_industry;
|
|
|
|
$http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) {
|
|
|
|
$http.put('/app/cms/categories/' + $stateParams.catId + '/articles/' + $stateParams.articleId, $scope.article).then(function (resp) {
|
|
|
|
$state.go('^.article_view', {articleId: $stateParams.articleId});
|
|
|
|
$state.go('^.article_view', {articleId: $stateParams.articleId});
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message})
|
|
|
|
commonDialog.alert({type: 'error', title: 'Error', content: resp.data.message})
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.loadRoyalpayindustry = function () {
|
|
|
|
|
|
|
|
$http.get('/static/data/rp_industry_apply.json').then(function (resp) {
|
|
|
|
|
|
|
|
$scope.royalpayindustry = resp.data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
$scope.loadRoyalpayindustry();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.onRoyalPayIndustrySelect = function (selectedItem) {
|
|
|
|
|
|
|
|
$scope.royalpay_label = selectedItem.label;
|
|
|
|
|
|
|
|
$scope.royalpay_industry = selectedItem.mccCode;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('cmsArticlePreviewCtrl', ['$scope', 'article', function ($scope, article) {
|
|
|
|
app.controller('cmsArticlePreviewCtrl', ['$scope', 'article', function ($scope, article) {
|
|
|
|