|
|
@ -3,95 +3,95 @@
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angular) {
|
|
|
|
define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angular) {
|
|
|
|
'use strict';
|
|
|
|
'use strict';
|
|
|
|
var app = angular.module('cms', ['ui.router','ng.uditor']);
|
|
|
|
var app = angular.module('cms', ['ui.router', 'ng.uditor']);
|
|
|
|
var style = [
|
|
|
|
var style = [
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"settlement",
|
|
|
|
"style_key": "settlement",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"home_select",
|
|
|
|
"style_key": "home_select",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"activity_gray",
|
|
|
|
"style_key": "activity_gray",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"activity_select",
|
|
|
|
"style_key": "activity_select",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"mess_gray",
|
|
|
|
"style_key": "mess_gray",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"mess_select",
|
|
|
|
"style_key": "mess_select",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"my_select",
|
|
|
|
"style_key": "my_select",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"my_gray",
|
|
|
|
"style_key": "my_gray",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"transaction",
|
|
|
|
"style_key": "transaction",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//customers report
|
|
|
|
//customers report
|
|
|
|
"style_key":"statistics",
|
|
|
|
"style_key": "statistics",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Account
|
|
|
|
//Account
|
|
|
|
"style_key":"marketing_account",
|
|
|
|
"style_key": "marketing_account",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Customer outline
|
|
|
|
//Customer outline
|
|
|
|
"style_key":"usergroup",
|
|
|
|
"style_key": "usergroup",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Compliance check
|
|
|
|
//Compliance check
|
|
|
|
"style_key":"coupon",
|
|
|
|
"style_key": "coupon",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"rpbill",
|
|
|
|
"style_key": "rpbill",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"invoice_assistant",
|
|
|
|
"style_key": "invoice_assistant",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"home_gray",
|
|
|
|
"style_key": "home_gray",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"balance",
|
|
|
|
"style_key": "balance",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"pro_collection",
|
|
|
|
"style_key": "pro_collection",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"pro_tralogs",
|
|
|
|
"style_key": "pro_tralogs",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"pro_qrcode",
|
|
|
|
"style_key": "pro_qrcode",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
{
|
|
|
|
"style_key":"pro_coupon",
|
|
|
|
"style_key": "pro_coupon",
|
|
|
|
"style_value":""
|
|
|
|
"style_value": ""
|
|
|
|
}];
|
|
|
|
}];
|
|
|
|
app.config(['$stateProvider', function ($stateProvider) {
|
|
|
|
app.config(['$stateProvider', function ($stateProvider) {
|
|
|
|
$stateProvider.state('cms', {
|
|
|
|
$stateProvider.state('cms', {
|
|
|
@ -128,11 +128,11 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
url: '/phone_top_up',
|
|
|
|
url: '/phone_top_up',
|
|
|
|
controller: 'CmsPhonetopupCtrl',
|
|
|
|
controller: 'CmsPhonetopupCtrl',
|
|
|
|
templateUrl: '/static/cms/templates/phone_top_up.html',
|
|
|
|
templateUrl: '/static/cms/templates/phone_top_up.html',
|
|
|
|
}).state('cms.app_style',{
|
|
|
|
}).state('cms.app_style', {
|
|
|
|
url: '/app_style',
|
|
|
|
url: '/app_style',
|
|
|
|
controller: 'cmsAppStyleListCtrl',
|
|
|
|
controller: 'cmsAppStyleListCtrl',
|
|
|
|
templateUrl: '/static/cms/templates/app_style.html',
|
|
|
|
templateUrl: '/static/cms/templates/app_style.html',
|
|
|
|
}).state('cms.app_style.app_style_preview',{
|
|
|
|
}).state('cms.app_style.app_style_preview', {
|
|
|
|
url: '/{style_id}/preview',
|
|
|
|
url: '/{style_id}/preview',
|
|
|
|
controller: 'cmsAppStylePreviewCtrl',
|
|
|
|
controller: 'cmsAppStylePreviewCtrl',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_preview.html',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_preview.html',
|
|
|
@ -141,7 +141,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
return $http.get('/app/cms/app_style/style_group/' + $stateParams.style_id);
|
|
|
|
return $http.get('/app/cms/app_style/style_group/' + $stateParams.style_id);
|
|
|
|
}]
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).state('cms.app_style.app_style_save',{
|
|
|
|
}).state('cms.app_style.app_style_save', {
|
|
|
|
url: '/save',
|
|
|
|
url: '/save',
|
|
|
|
controller: 'cmsAppStyleSaveCtrl',
|
|
|
|
controller: 'cmsAppStyleSaveCtrl',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_config.html',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_config.html',
|
|
|
@ -150,7 +150,7 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
return angular.copy(style);
|
|
|
|
return angular.copy(style);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}).state('cms.app_style.app_style_edit',{
|
|
|
|
}).state('cms.app_style.app_style_edit', {
|
|
|
|
url: '/{style_id}/edit',
|
|
|
|
url: '/{style_id}/edit',
|
|
|
|
controller: 'cmsAppStyleEditCtrl',
|
|
|
|
controller: 'cmsAppStyleEditCtrl',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_config.html',
|
|
|
|
templateUrl: '/static/cms/templates/app_style_config.html',
|
|
|
@ -162,8 +162,33 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
return angular.copy(style);
|
|
|
|
return angular.copy(style);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}).state('cms.statistics_of_clicks', {
|
|
|
|
|
|
|
|
url: '/statistics/clicks',
|
|
|
|
|
|
|
|
controller:'cmsStatisticsClickCtrl',
|
|
|
|
|
|
|
|
templateUrl:'/static/cms/templates/statistics_of_clicks.html',
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
app.controller('cmsStatisticsClickCtrl', ['$scope', '$http','$filter', function ($scope,$http,$filter) {
|
|
|
|
|
|
|
|
$scope.params = {status: 'PAID', channel :'ALL' ,textType: 'all', datefrom: new Date(), dateto: new Date()};
|
|
|
|
|
|
|
|
$scope.count = 0;
|
|
|
|
|
|
|
|
$scope.loadTradeLogs = function () {
|
|
|
|
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
|
|
|
|
if (params.datefrom) {
|
|
|
|
|
|
|
|
params.datefrom = $filter('date')(params.datefrom, 'yyyyMMdd');
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
$http.get('/statistics/click/paySuccess_count/' + $scope.params.datefrom).then(function (resp) {
|
|
|
|
|
|
|
|
$scope.count = resp.data;
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$scope.viewAdvertisements = function () {
|
|
|
|
|
|
|
|
$scope.posters = {};
|
|
|
|
|
|
|
|
$http.get('/app/poster/getPosters').then(function (resp) {
|
|
|
|
|
|
|
|
$scope.posters = resp.data.posters
|
|
|
|
|
|
|
|
})
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return app;
|
|
|
|
|
|
|
|
}]);
|
|
|
|
app.controller('cmsRootCtrl', ['$scope', function ($scope) {
|
|
|
|
app.controller('cmsRootCtrl', ['$scope', function ($scope) {
|
|
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
@ -172,10 +197,10 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
$scope.pagination = {};
|
|
|
|
$scope.pagination = {};
|
|
|
|
$scope.topUp = function () {
|
|
|
|
$scope.topUp = function () {
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
var params = angular.copy($scope.params);
|
|
|
|
if(params.type==null || params.type==''||params.amount==null||params.amount==''||params.customerNumber==''||params.customerNumber==null ){
|
|
|
|
if (params.type == null || params.type == '' || params.amount == null || params.amount == '' || params.customerNumber == '' || params.customerNumber == null) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$http.get('/top_up/recharge',{params: params}).then(function (resp) {
|
|
|
|
$http.get('/top_up/recharge', {params: params}).then(function (resp) {
|
|
|
|
alert('ok');
|
|
|
|
alert('ok');
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|
alert(resp.data.message);
|
|
|
|
alert(resp.data.message);
|
|
|
@ -183,21 +208,21 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.listTopUpOrders = function (page) {
|
|
|
|
$scope.listTopUpOrders = function (page) {
|
|
|
|
var params = angular.copy($scope.queryParams);
|
|
|
|
var params = angular.copy($scope.queryParams);
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
params.page = page || $scope.pagination.page || 1;
|
|
|
|
if(params.amount==''|| params.amount==null){
|
|
|
|
if (params.amount == '' || params.amount == null) {
|
|
|
|
delete params.amount;
|
|
|
|
delete params.amount;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(params.phone==''|| params.phone==null){
|
|
|
|
if (params.phone == '' || params.phone == null) {
|
|
|
|
delete params.phone;
|
|
|
|
delete params.phone;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(params.status==''|| params.status==null){
|
|
|
|
if (params.status == '' || params.status == null) {
|
|
|
|
delete params.status;
|
|
|
|
delete params.status;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(params.type==''|| params.type==null){
|
|
|
|
if (params.type == '' || params.type == null) {
|
|
|
|
delete params.type;
|
|
|
|
delete params.type;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$http.get('/top_up/list',{params: params}).then(function (resp) {
|
|
|
|
$http.get('/top_up/list', {params: params}).then(function (resp) {
|
|
|
|
$scope.orders = resp.data.data;
|
|
|
|
$scope.orders = resp.data.data;
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
$scope.pagination = resp.data.pagination;
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -232,7 +257,7 @@ 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;
|
|
|
|
$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) {
|
|
|
@ -245,12 +270,12 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
$scope.article = article.data;
|
|
|
|
$scope.article = article.data;
|
|
|
|
if ($scope.article.reference) {
|
|
|
|
if ($scope.article.reference) {
|
|
|
|
$scope.reference = JSON.parse($scope.article.reference);
|
|
|
|
$scope.reference = JSON.parse($scope.article.reference);
|
|
|
|
}else {
|
|
|
|
} else {
|
|
|
|
$scope.reference = {};
|
|
|
|
$scope.reference = {};
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.saveArticle = function () {
|
|
|
|
$scope.article.reference =$scope.reference;
|
|
|
|
$scope.article.reference = $scope.reference;
|
|
|
|
$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) {
|
|
|
@ -280,68 +305,68 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
$scope.appStyles = appStyles.data.data;
|
|
|
|
$scope.appStyles = appStyles.data.data;
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
|
|
app.controller('cmsAppStyleEditCtrl', ['$scope', '$http', '$state','commonDialog', 'appStyles', 'style', function ($scope, $http, $state, commonDialog, appStyles, style) {
|
|
|
|
app.controller('cmsAppStyleEditCtrl', ['$scope', '$http', '$state', 'commonDialog', 'appStyles', 'style', function ($scope, $http, $state, commonDialog, appStyles, style) {
|
|
|
|
$scope.ctrl = {sending: false, flag: false, originStyleId: angular.copy(appStyles.data.data[0].style_id)};
|
|
|
|
$scope.ctrl = {sending: false, flag: false, originStyleId: angular.copy(appStyles.data.data[0].style_id)};
|
|
|
|
$scope.entity={};
|
|
|
|
$scope.entity = {};
|
|
|
|
$scope.style = angular.copy(style);
|
|
|
|
$scope.style = angular.copy(style);
|
|
|
|
$scope.entity.appStyle = angular.copy(appStyles.data.data);
|
|
|
|
$scope.entity.appStyle = angular.copy(appStyles.data.data);
|
|
|
|
$scope.params = {style_id: angular.copy(appStyles.data.data[0].style_id)};
|
|
|
|
$scope.params = {style_id: angular.copy(appStyles.data.data[0].style_id)};
|
|
|
|
$scope.appStyleList = function() {
|
|
|
|
$scope.appStyleList = function () {
|
|
|
|
var styleKeyStr = "";
|
|
|
|
var styleKeyStr = "";
|
|
|
|
$scope.entity.appStyle.forEach(function(item){
|
|
|
|
$scope.entity.appStyle.forEach(function (item) {
|
|
|
|
styleKeyStr += item.style_key + ",";
|
|
|
|
styleKeyStr += item.style_key + ",";
|
|
|
|
});
|
|
|
|
});
|
|
|
|
$scope.style.forEach(function(item){
|
|
|
|
$scope.style.forEach(function (item) {
|
|
|
|
if (styleKeyStr.indexOf(item.style_key) < 0) {
|
|
|
|
if (styleKeyStr.indexOf(item.style_key) < 0) {
|
|
|
|
$scope.entity.appStyle.push({"style_key": item.style_key,"style_value":""});
|
|
|
|
$scope.entity.appStyle.push({"style_key": item.style_key, "style_value": ""});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
};
|
|
|
|
};
|
|
|
|
$scope.appStyleList();
|
|
|
|
$scope.appStyleList();
|
|
|
|
$scope.addSpecOption = function() {
|
|
|
|
$scope.addSpecOption = function () {
|
|
|
|
$scope.entity.appStyle.push({});
|
|
|
|
$scope.entity.appStyle.push({});
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 删除规格选项
|
|
|
|
// 删除规格选项
|
|
|
|
$scope.delSpecOption = function(index) {
|
|
|
|
$scope.delSpecOption = function (index) {
|
|
|
|
$scope.entity.appStyle.splice(index, 1);
|
|
|
|
$scope.entity.appStyle.splice(index, 1);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.saveOneGroupAppStyle = function() {
|
|
|
|
$scope.saveOneGroupAppStyle = function () {
|
|
|
|
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
|
|
|
|
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
|
|
|
|
$scope.errmsg = "title不能为空";
|
|
|
|
$scope.errmsg = "title不能为空";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var item = "";
|
|
|
|
var item = "";
|
|
|
|
for (var i=0;i<$scope.entity.appStyle.length;i++) {
|
|
|
|
for (var i = 0; i < $scope.entity.appStyle.length; i++) {
|
|
|
|
item = $scope.entity.appStyle[i];
|
|
|
|
item = $scope.entity.appStyle[i];
|
|
|
|
if (item.style_value == "" || item.style_value == null) {
|
|
|
|
if (item.style_value == "" || item.style_value == null) {
|
|
|
|
$scope.errmsg = "value不能为空";
|
|
|
|
$scope.errmsg = "value不能为空";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (item.style_value.substr(0,4).toLowerCase() != "http" &&
|
|
|
|
if (item.style_value.substr(0, 4).toLowerCase() != "http" &&
|
|
|
|
item.style_value.substr(0,5).toLowerCase() != "https") {
|
|
|
|
item.style_value.substr(0, 5).toLowerCase() != "https") {
|
|
|
|
$scope.errmsg = "value必须以http或者https开头";
|
|
|
|
$scope.errmsg = "value必须以http或者https开头";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.ctrl.sending = true;
|
|
|
|
$scope.ctrl.sending = true;
|
|
|
|
$http.put('/app/cms/app_style/style_group/' + $scope.params.style_id + '/style?originStyleId=' + $scope.ctrl.originStyleId, $scope.entity).then(function(){
|
|
|
|
$http.put('/app/cms/app_style/style_group/' + $scope.params.style_id + '/style?originStyleId=' + $scope.ctrl.originStyleId, $scope.entity).then(function () {
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$state.go('cms.app_style.app_style_preview',{style_id: $scope.params.style_id});
|
|
|
|
$state.go('cms.app_style.app_style_preview', {style_id: $scope.params.style_id});
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
$scope.errmsg = resp.data.message;
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.toggleAppStyleIsValid = function(styleId) {
|
|
|
|
$scope.toggleAppStyleIsValid = function (styleId) {
|
|
|
|
if (styleId) {
|
|
|
|
if (styleId) {
|
|
|
|
commonDialog.confirm({
|
|
|
|
commonDialog.confirm({
|
|
|
|
title: '确认操作',
|
|
|
|
title: '确认操作',
|
|
|
|
content: '当前操作将发布title为:' +styleId +"的app图标,是否确认?"
|
|
|
|
content: '当前操作将发布title为:' + styleId + "的app图标,是否确认?"
|
|
|
|
}).then(function () {
|
|
|
|
}).then(function () {
|
|
|
|
$http.put('/app/cms/app_style/style_group/' + styleId).then(function () {
|
|
|
|
$http.put('/app/cms/app_style/style_group/' + styleId).then(function () {
|
|
|
|
$state.reload();
|
|
|
|
$state.reload();
|
|
|
@ -352,42 +377,42 @@ define(['angular', 'uiRouter', 'static/commons/angular-ueditor'], function (angu
|
|
|
|
}]);
|
|
|
|
}]);
|
|
|
|
app.controller('cmsAppStyleSaveCtrl', ['$scope', '$http', '$state', 'style', function ($scope, $http, $state, style) {
|
|
|
|
app.controller('cmsAppStyleSaveCtrl', ['$scope', '$http', '$state', 'style', function ($scope, $http, $state, style) {
|
|
|
|
$scope.ctrl = {sending: false, flag: true};
|
|
|
|
$scope.ctrl = {sending: false, flag: true};
|
|
|
|
$scope.entity={};
|
|
|
|
$scope.entity = {};
|
|
|
|
$scope.entity.appStyle = angular.copy(style);
|
|
|
|
$scope.entity.appStyle = angular.copy(style);
|
|
|
|
$scope.params = {style_id: ""};
|
|
|
|
$scope.params = {style_id: ""};
|
|
|
|
$scope.addSpecOption = function() {
|
|
|
|
$scope.addSpecOption = function () {
|
|
|
|
$scope.entity.appStyle.push({});
|
|
|
|
$scope.entity.appStyle.push({});
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// 删除规格选项
|
|
|
|
// 删除规格选项
|
|
|
|
$scope.delSpecOption = function(index) {
|
|
|
|
$scope.delSpecOption = function (index) {
|
|
|
|
console.log(index)
|
|
|
|
console.log(index)
|
|
|
|
$scope.entity.appStyle.splice(index, 1);
|
|
|
|
$scope.entity.appStyle.splice(index, 1);
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
$scope.saveOneGroupAppStyle = function() {
|
|
|
|
$scope.saveOneGroupAppStyle = function () {
|
|
|
|
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
|
|
|
|
if ($scope.params.style_id == "" || $scope.params.style_id == null) {
|
|
|
|
$scope.errmsg = "title不能为空";
|
|
|
|
$scope.errmsg = "title不能为空";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
var item = "";
|
|
|
|
var item = "";
|
|
|
|
for (var i=0;i<$scope.entity.appStyle.length;i++) {
|
|
|
|
for (var i = 0; i < $scope.entity.appStyle.length; i++) {
|
|
|
|
item = $scope.entity.appStyle[i];
|
|
|
|
item = $scope.entity.appStyle[i];
|
|
|
|
if (item.style_value == "" || item.style_value == null) {
|
|
|
|
if (item.style_value == "" || item.style_value == null) {
|
|
|
|
$scope.errmsg = "value不能为空";
|
|
|
|
$scope.errmsg = "value不能为空";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (item.style_value.substr(0,4).toLowerCase() != "http" &&
|
|
|
|
if (item.style_value.substr(0, 4).toLowerCase() != "http" &&
|
|
|
|
item.style_value.substr(0,5).toLowerCase() != "https") {
|
|
|
|
item.style_value.substr(0, 5).toLowerCase() != "https") {
|
|
|
|
$scope.errmsg = "value必须以http或者https开头";
|
|
|
|
$scope.errmsg = "value必须以http或者https开头";
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$scope.ctrl.sending = true;
|
|
|
|
$scope.ctrl.sending = true;
|
|
|
|
$http.post('/app/cms/app_style/style_group?style_id=' + $scope.params.style_id, $scope.entity).then(function(){
|
|
|
|
$http.post('/app/cms/app_style/style_group?style_id=' + $scope.params.style_id, $scope.entity).then(function () {
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$scope.ctrl.sending = false;
|
|
|
|
$state.go('cms.app_style.app_style_preview', {style_id: $scope.params.style_id});
|
|
|
|
$state.go('cms.app_style.app_style_preview', {style_id: $scope.params.style_id});
|
|
|
|
}, function (resp) {
|
|
|
|
}, function (resp) {
|
|
|
|