From 67d08d28c45a0e8f746a6432350be82196a9e7aa Mon Sep 17 00:00:00 2001 From: liuxinxin Date: Wed, 30 Oct 2019 11:07:30 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90R=E3=80=91=E5=B9=BF=E5=91=8A=E4=BD=8D?= =?UTF-8?q?=E5=B1=8F=E8=94=BD=E5=90=8C=E8=A1=8C=E4=B8=9A=E5=95=86=E6=88=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/ui/static/cms/cms.js | 34 ++++++++++++++++++- .../static/cms/templates/article_editor.html | 20 ++++++++++- 2 files changed, 52 insertions(+), 2 deletions(-) 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 +