Merge remote-tracking branch 'origin/master'

master
luoyang 5 years ago
commit 43d25157a5

@ -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) {

@ -75,6 +75,24 @@
<p class="small text-warning">(广告页面内添加的文字)</p>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"
for="royalpayindustry">*RoyalPay Industry</label>
<div class="col-sm-8">
<input class="form-control" id="royalpayindustry" required
name="royalpayindustry" readonly
ng-model="royalpay_industry|partner_royalpay_industry"
multi-level-select-popup="royalpayindustry"
on-select="onRoyalPayIndustrySelect($selected)">
<div ng-messages="partnerForm.royalpay_label.$error"
ng-if="partnerForm.royalpay_label.$dirty">
<p class="small text-danger" ng-message="required">Required
Field</p>
</div>
</div>
</div>
</form>
<div class="form-group">
<label class="control-label">Content</label>

Loading…
Cancel
Save