diff --git a/src/main/ui/static/cms/cms.js b/src/main/ui/static/cms/cms.js index 693ca0581..59c8b043a 100644 --- a/src/main/ui/static/cms/cms.js +++ b/src/main/ui/static/cms/cms.js @@ -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 } } }); -}); \ No newline at end of file +}); diff --git a/src/main/ui/static/cms/templates/article_editor.html b/src/main/ui/static/cms/templates/article_editor.html index 8cac23c8d..3130a961d 100644 --- a/src/main/ui/static/cms/templates/article_editor.html +++ b/src/main/ui/static/cms/templates/article_editor.html @@ -75,6 +75,24 @@

(广告页面内添加的文字)

+ +
+ +
+ +
+

Required + Field

+
+
+
+
@@ -94,4 +112,4 @@
- \ No newline at end of file +