|
|
|
@ -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) {
|
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
|
$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) {
|
|
|
|
|
$state.go('^.article_view', {articleId: resp.data.article_id});
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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) {
|
|
|
|
@ -274,14 +288,32 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
|
$scope.reference = {};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if($scope.article.royalpay_industry){
|
|
|
|
|
$scope.royalpay_industry = $scope.article.royalpay_industry;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
|
$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) {
|
|
|
|
|
$state.go('^.article_view', {articleId: $stateParams.articleId});
|
|
|
|
|
}, function (resp) {
|
|
|
|
|
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) {
|
|
|
|
@ -464,4 +496,4 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|