|
@@ -2,9 +2,9 @@
|
|
|
* index
|
|
* index
|
|
|
*
|
|
*
|
|
|
*/
|
|
*/
|
|
|
-define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-upload', 'common/directives', 'common/services', 'toaster', 'ngSanitize', 'services/Project', 'services/Activity', 'services/Organization', 'ui-form', 'services/User', 'services/Message'], function(angularAMD) {
|
|
|
|
|
|
|
+define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-upload', 'common/directives', 'common/services', 'toaster', 'ngSanitize', 'services/Project', 'services/Activity', 'services/Organization', 'ui-form', 'services/User', 'services/Message', 'services/Public'], function(angularAMD) {
|
|
|
'use strict';
|
|
'use strict';
|
|
|
- var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'angularFileUpload', 'common.directives', 'common.services', 'toaster', 'ngSanitize', 'ProjectService', 'ActivityService', 'OrganizationService', 'ui.form', 'UserService', 'MessageService']);
|
|
|
|
|
|
|
+ var app = angular.module('myApp', [ 'ui.router', 'ui.bootstrap', 'ng.local', 'ngTable', 'angularFileUpload', 'common.directives', 'common.services', 'toaster', 'ngSanitize', 'ProjectService', 'ActivityService', 'OrganizationService', 'ui.form', 'UserService', 'MessageService', 'PublicService']);
|
|
|
app.init = function() {
|
|
app.init = function() {
|
|
|
angularAMD.bootstrap(app);
|
|
angularAMD.bootstrap(app);
|
|
|
};
|
|
};
|
|
@@ -228,6 +228,29 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
};
|
|
|
}]);
|
|
}]);
|
|
|
|
|
|
|
|
|
|
+ app.controller('LeftSideCtrl', ['$scope', 'AuthenticationService', 'User', function ($scope, AuthenticationService, User) {
|
|
|
|
|
+
|
|
|
|
|
+ // 如果当前用户无机构信息,进入机构入驻页面
|
|
|
|
|
+ // 获取已登录的用户信息
|
|
|
|
|
+ $scope.launchProject = function() {
|
|
|
|
|
+ AuthenticationService.getAuthentication().success(function(data) {
|
|
|
|
|
+ if(data && data.content) {
|
|
|
|
|
+ $scope.userInfo = data.content;
|
|
|
|
|
+ User.getDetailByUserUU({userUU: $scope.userInfo.userUU}, {}, function(data) {
|
|
|
|
|
+ $scope.userInfo = data;
|
|
|
|
|
+ // 如果未登录,跳转到机构入驻
|
|
|
|
|
+ if (angular.isUndefined($scope.userInfo.org)) {
|
|
|
|
|
+ window.location.hash = '#/selectInstitutionsNature';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ window.location.hash = '#/launchProject/baseInfo';
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ // $scope.isAuthed = data !== null && !angular.isUndefined(data.content);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ }]);
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 项目列表
|
|
* 项目列表
|
|
|
*/
|
|
*/
|
|
@@ -407,13 +430,6 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
// 获取当前项目捐款明细
|
|
// 获取当前项目捐款明细
|
|
|
- // $scope.getRecords = function() {
|
|
|
|
|
- // Project.getRecords({proId:id}, {}, function(data) {
|
|
|
|
|
- // $scope.projectRecords = data;
|
|
|
|
|
- // }, function() {
|
|
|
|
|
- // toaster.pop('error', '捐款明细加载失败');
|
|
|
|
|
- // });
|
|
|
|
|
- // };
|
|
|
|
|
$scope.recordParams = new ngTableParams({
|
|
$scope.recordParams = new ngTableParams({
|
|
|
page: 1,
|
|
page: 1,
|
|
|
count: 5,
|
|
count: 5,
|
|
@@ -1432,8 +1448,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
/**
|
|
|
* 新建项目
|
|
* 新建项目
|
|
|
*/
|
|
*/
|
|
|
- app.controller('ProjectNewCtrl', ['$scope', 'BaseService', 'Project', '$http', 'toaster', '$stateParams', '$rootScope',
|
|
|
|
|
- function($scope, BaseService, Project, $http, toaster, $stateParams, $rootScope) {
|
|
|
|
|
|
|
+ app.controller('ProjectNewCtrl', ['$scope', 'BaseService', 'Project', '$http', 'toaster', '$stateParams', '$rootScope', 'AuthenticationService', 'User',
|
|
|
|
|
+ function($scope, BaseService, Project, $http, toaster, $stateParams, $rootScope, AuthenticationService, User) {
|
|
|
$scope.loading = true;
|
|
$scope.loading = true;
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
$rootScope.tree = 'project';
|
|
$rootScope.tree = 'project';
|
|
@@ -2224,12 +2240,24 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
/**
|
|
|
* 活动列表
|
|
* 活动列表
|
|
|
*/
|
|
*/
|
|
|
- app.controller('ActivityListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'Activity', '$modal',
|
|
|
|
|
- function ($scope, $rootScope, toaster, ngTableParams, BaseService, Activity, $modal) {
|
|
|
|
|
|
|
+ app.controller('ActivityListCtrl', ['$scope', '$rootScope', 'toaster', 'ngTableParams', 'BaseService', 'Activity', '$modal', 'Public',
|
|
|
|
|
+ function ($scope, $rootScope, toaster, ngTableParams, BaseService, Activity, $modal, Public) {
|
|
|
BaseService.scrollBackToTop();
|
|
BaseService.scrollBackToTop();
|
|
|
$rootScope.tree = 'activity';
|
|
$rootScope.tree = 'activity';
|
|
|
$rootScope.thief = 'list';
|
|
$rootScope.thief = 'list';
|
|
|
|
|
|
|
|
|
|
+ // 获取当前服务器时间(前端时间从本机获取,可能不准确,所以从服务器返回当前时间)
|
|
|
|
|
+ var getServeTime = function() {
|
|
|
|
|
+ Public.getServeTime({}, function(data) {
|
|
|
|
|
+ if (data.serveTime) {
|
|
|
|
|
+ $scope.serveTime = data.serveTime;
|
|
|
|
|
+ }
|
|
|
|
|
+ }, function() {
|
|
|
|
|
+ console.log('获取服务器时间失败!');
|
|
|
|
|
+ });
|
|
|
|
|
+ };
|
|
|
|
|
+ getServeTime();
|
|
|
|
|
+
|
|
|
var getActivityState = function (active) {
|
|
var getActivityState = function (active) {
|
|
|
// 正在进行
|
|
// 正在进行
|
|
|
var fn = 'getDone';
|
|
var fn = 'getDone';
|