|
|
@@ -80,6 +80,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
url : '/charityCertificationStep0',
|
|
|
title : '公益机构认证协议',
|
|
|
templateUrl : 'static/view/user/charityCertification.html',
|
|
|
+ controller : 'CertificationStep0Ctrl'
|
|
|
}).state("charityCertificationStep1", {
|
|
|
url : '/charityCertificationStep1',
|
|
|
title : '公益机构认证第一步',
|
|
|
@@ -104,6 +105,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
url : '/publicOfferingCertificationStep0',
|
|
|
title : '公募机构认证协议',
|
|
|
templateUrl : 'static/view/user/publicOfferingCertification.html',
|
|
|
+ controller : 'CertificationStep0Ctrl'
|
|
|
}).state("publicOfferingCertificationStep1", {
|
|
|
url : '/publicOfferingCertificationStep1',
|
|
|
title : '公募机构认证第一步',
|
|
|
@@ -435,14 +437,154 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
/**
|
|
|
* 机构入驻选择
|
|
|
*/
|
|
|
- app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization',
|
|
|
- function ($scope, toaster, Organization) {
|
|
|
+ app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location',
|
|
|
+ function ($scope, toaster, Organization, $location) {
|
|
|
// 获取当前账户注册机构情况
|
|
|
- Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
|
|
|
$scope.org = data;
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
+
|
|
|
+ //公益机构注册
|
|
|
+ $scope.registerCharityCertification = function () {
|
|
|
+ if (typeof $scope.org.id == 'undefined') {
|
|
|
+ $location.path('charityCertificationStep0');
|
|
|
+ } else {
|
|
|
+ if ($scope.org.type == 2) {
|
|
|
+ //之前已填写过公益机构注册信息
|
|
|
+ if ($scope.org.publish != 2) {
|
|
|
+ //未完成或保存为草稿
|
|
|
+ $location.path('charityCertificationStep1');
|
|
|
+ } else {
|
|
|
+ //发布正式
|
|
|
+ if ($scope.org.status == 0) {
|
|
|
+ //已发布待审核 (暂时)
|
|
|
+ $location.path('charityCertificationStep4');
|
|
|
+ } else if ($scope.org.status == 1) {
|
|
|
+ //已发布已审核
|
|
|
+ $location.path('charityCertificationStep4');
|
|
|
+ } else if ($scope.org.status == 2) {
|
|
|
+ //已发布已驳回
|
|
|
+ $location.path('charityCertificationStep1');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if ($scope.org.type == 1) {
|
|
|
+ //之前填写过公募机构注册信息
|
|
|
+ if ($scope.org.publish != 2) {
|
|
|
+ //未完成或保存为草稿
|
|
|
+ //TODO 模态框判断
|
|
|
+ var decideContinue = false;
|
|
|
+ if (decideContinue) {
|
|
|
+ //TODO 继续注册公益机构并替换掉之前的公募机构注册信息
|
|
|
+ $location.path('charityCertificationStep0');
|
|
|
+ } else {
|
|
|
+ //TODO 继续之前的公募机构注册信息
|
|
|
+ toaster.pop('info', '继续之前的公募机构注册信息');
|
|
|
+ $location.path('publicOfferingCertificationStep1');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //发布正式
|
|
|
+ if ($scope.org.status == 0) {
|
|
|
+ //已发布待审核 (暂时)
|
|
|
+ $location.path('publicOfferingCertificationStep5');
|
|
|
+ } else if ($scope.org.status == 1) {
|
|
|
+ //已发布已审核
|
|
|
+ $location.path('publicOfferingCertificationStep5');
|
|
|
+ } else if ($scope.org.status == 2) {
|
|
|
+ //已发布已驳回
|
|
|
+ $location.path('publicOfferingCertificationStep1');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ //公募机构注册
|
|
|
+ $scope.registerPublicOfferingCertification = function () {
|
|
|
+ if (typeof $scope.org.id == 'undefined') {
|
|
|
+ $location.path('publicOfferingCertificationStep0');
|
|
|
+ } else {
|
|
|
+ if ($scope.org.type == 1) {
|
|
|
+ //之前已填写过公募机构注册信息
|
|
|
+ if ($scope.org.publish != 2) {
|
|
|
+ //未完成或保存为草稿
|
|
|
+ $location.path('publicOfferingCertificationStep1');
|
|
|
+ } else {
|
|
|
+ //发布正式
|
|
|
+ if ($scope.org.status == 0) {
|
|
|
+ //已发布待审核 (暂时)
|
|
|
+ $location.path('publicOfferingCertificationStep5');
|
|
|
+ } else if ($scope.org.status == 1) {
|
|
|
+ //已发布已审核
|
|
|
+ $location.path('publicOfferingCertificationStep5');
|
|
|
+ } else if ($scope.org.status == 2) {
|
|
|
+ //已发布已驳回
|
|
|
+ $location.path('publicOfferingCertificationStep1');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else if ($scope.org.type == 2) {
|
|
|
+ //之前填写过公益机构注册信息
|
|
|
+ if ($scope.org.publish != 2) {
|
|
|
+ //未完成或保存为草稿
|
|
|
+ //TODO 模态框判断
|
|
|
+ var decideContinue = false;
|
|
|
+ if (decideContinue) {
|
|
|
+ //TODO 继续注册公募机构并替换掉之前的公益机构注册信息
|
|
|
+ $location.path('publicOfferingCertificationStep0');
|
|
|
+ } else {
|
|
|
+ //TODO 继续之前的公益机构注册信息
|
|
|
+ toaster.pop('info', '继续之前的公益机构注册信息');
|
|
|
+ $location.path('charityCertificationStep1');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ //发布正式
|
|
|
+ if ($scope.org.status == 0) {
|
|
|
+ //已发布待审核 (暂时)
|
|
|
+ $location.path('charityCertificationStep4');
|
|
|
+ } else if ($scope.org.status == 1) {
|
|
|
+ //已发布已审核
|
|
|
+ $location.path('charityCertificationStep4');
|
|
|
+ } else if ($scope.org.status == 2) {
|
|
|
+ //已发布已驳回
|
|
|
+ $location.path('charityCertificationStep1');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 机构入驻同意协议
|
|
|
+ */
|
|
|
+ app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location',
|
|
|
+ function ($scope, toaster, Organization, $location) {
|
|
|
+ $scope.checked = false;
|
|
|
+ $scope.changeChecked = function() {
|
|
|
+ $scope.checked = !$scope.checked;
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.stepNext = function (checked, orgType) {
|
|
|
+ if (checked) {
|
|
|
+ if (orgType == 1) {
|
|
|
+ $location.path('publicOfferingCertificationStep1');
|
|
|
+ } else if (orgType == 2) {
|
|
|
+ $location.path('charityCertificationStep1');
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 获取当前账户注册机构情况
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
|
|
|
+ if (typeof data.id == 'undefined') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $scope.checked = true;
|
|
|
+ }, function() {
|
|
|
+ toaster.pop('error', '注册情况加载失败');
|
|
|
+ });
|
|
|
}]);
|
|
|
|
|
|
/**
|
|
|
@@ -450,10 +592,20 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
*/
|
|
|
app.controller('CertificationStep1Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
+ // 主要领域
|
|
|
+ // $scope.areas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
|
|
|
+
|
|
|
+ $scope.org = {
|
|
|
+ majorArea: 1
|
|
|
+ };
|
|
|
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
- Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
|
|
|
+ if (typeof data.id == 'undefined') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
$scope.org = data;
|
|
|
orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
@@ -467,9 +619,10 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
$scope.provinces = response.data;
|
|
|
});
|
|
|
|
|
|
- $scope.selectMajorArea = function (index) {
|
|
|
+ // 设置主要领域
|
|
|
+ $scope.selectMajorArea = function(index) {
|
|
|
$scope.org.majorArea = index;
|
|
|
- }
|
|
|
+ };
|
|
|
|
|
|
$scope.openDatePicker = function ($event, item, openParam) {
|
|
|
$event.preventDefault();
|
|
|
@@ -532,7 +685,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
- Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
|
|
|
$scope.org = data;
|
|
|
orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
@@ -583,11 +736,18 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
*/
|
|
|
app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
|
|
|
function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization) {
|
|
|
-
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
- Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041558
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
|
|
|
+ if (typeof data.id == 'undefined') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
$scope.org = data;
|
|
|
+ $scope.logoUrl = $scope.org.logo;
|
|
|
+ $scope.personCertificateUrl = $scope.org.personCertificate;
|
|
|
+ $scope.donateCertificateUrl = $scope.org.donateCertificate;
|
|
|
+ $scope.legalIdCardUrl = $scope.org.legalIdCard;
|
|
|
+
|
|
|
orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
@@ -601,7 +761,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
$scope.org.branchMessage = "";
|
|
|
} else {
|
|
|
bankCard = bankCard.toString();
|
|
|
- $.getJSON("resources/jsondata/bank.json", {}, function (data) {
|
|
|
+ $.getJSON("static/jsondata/bank.json", {}, function (data) {
|
|
|
var bankBin = 0;
|
|
|
var isFind = false;
|
|
|
for (var key = 10; key >= 2; key--) {
|
|
|
@@ -626,18 +786,126 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
}
|
|
|
|
|
|
+ /*$scope.fileChanged = function(ele, order){
|
|
|
+ if (order == 0) {
|
|
|
+ $scope.logo = ele.files[0];
|
|
|
+ } else if (order == 1) {
|
|
|
+ $scope.personCertificate = ele.files[0];
|
|
|
+ } else if (order == 2) {
|
|
|
+ $scope.donateCertificate = ele.files[0];
|
|
|
+ } else if (order == 3) {
|
|
|
+ $scope.legalIdCard = ele.files[0];
|
|
|
+ }
|
|
|
+ $scope.$apply();
|
|
|
+ };*/
|
|
|
+
|
|
|
+ //建立一个可存取到该file的url
|
|
|
+ var getObjectURL = function (file) {
|
|
|
+ var url = null;
|
|
|
+ if (window.createObjectURL != undefined) { // basic
|
|
|
+ url = window.createObjectURL(file);
|
|
|
+ } else if (window.URL != undefined) { // mozilla(firefox)
|
|
|
+ url = window.URL.createObjectURL(file);
|
|
|
+ } else if (window.webkitURL != undefined) { // webkit or chrome
|
|
|
+ url = window.webkitURL.createObjectURL(file);
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 图片上传
|
|
|
$scope.fileChanged = function(ele, order){
|
|
|
if (order == 0) {
|
|
|
$scope.logo = ele.files[0];
|
|
|
+ $scope.logoUrl = getObjectURL($scope.logo);
|
|
|
} else if (order == 1) {
|
|
|
$scope.personCertificate = ele.files[0];
|
|
|
+ $scope.personCertificateUrl = getObjectURL($scope.personCertificate);
|
|
|
} else if (order == 2) {
|
|
|
$scope.donateCertificate = ele.files[0];
|
|
|
+ $scope.donateCertificateUrl = getObjectURL($scope.donateCertificate);
|
|
|
} else if (order == 3) {
|
|
|
$scope.legalIdCard = ele.files[0];
|
|
|
+ $scope.legalIdCardUrl = getObjectURL($scope.legalIdCard);
|
|
|
}
|
|
|
$scope.$apply();
|
|
|
};
|
|
|
+
|
|
|
+ // 查看范例
|
|
|
+ $scope.showImg = function (type) {
|
|
|
+ var img = null;
|
|
|
+ var imgUrl = null;
|
|
|
+ switch (type) {
|
|
|
+ case 'logo':
|
|
|
+ img = $scope.org.logo;
|
|
|
+ imgUrl = $scope.logoUrl;
|
|
|
+ break;
|
|
|
+ case 'personCertificate':
|
|
|
+ img = $scope.org.personCertificate;
|
|
|
+ imgUrl = $scope.personCertificateUrl;
|
|
|
+ break;
|
|
|
+ case 'donateCertificate':
|
|
|
+ img = $scope.org.donateCertificate;
|
|
|
+ imgUrl = $scope.donateCertificateUrl;
|
|
|
+ break;
|
|
|
+ case 'legalIdCard':
|
|
|
+ img = $scope.org.legalIdCard;
|
|
|
+ imgUrl = $scope.legalIdCardUrl;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (img) {
|
|
|
+ var src = img, box = $('#image-box');
|
|
|
+ box.show();
|
|
|
+ box.find('img').attr('src', src);
|
|
|
+ box.find('a').click(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ box.dblclick(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ } else if (imgUrl != null) {
|
|
|
+ var src = imgUrl, box = $('#image-box');
|
|
|
+ box.show();
|
|
|
+ box.find('img').attr('src', src);
|
|
|
+ box.find('a').click(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ box.dblclick(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ $scope.clearFile = function (type) {
|
|
|
+ switch (type) {
|
|
|
+ case 'logo':
|
|
|
+ $scope.logo = null;
|
|
|
+ $scope.logoUrl = null;
|
|
|
+ break;
|
|
|
+ case 'personCertificate':
|
|
|
+ $scope.personCertificate = null;
|
|
|
+ $scope.personCertificateUrl = null;
|
|
|
+ break;
|
|
|
+ case 'donateCertificate':
|
|
|
+ $scope.donateCertificate = null;
|
|
|
+ $scope.donateCertificateUrl = null;
|
|
|
+ break;
|
|
|
+ case 'legalIdCard':
|
|
|
+ $scope.legalIdCard = null;
|
|
|
+ $scope.legalIdCardUrl = null;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // 清空input框的内容
|
|
|
+ var file=document.getElementById(type);
|
|
|
+ //IE,Safari,chrome
|
|
|
+ if(file.outerHTML){
|
|
|
+ file.outerHTML=file.outerHTML;
|
|
|
+ }
|
|
|
+ else{ //FF
|
|
|
+ file.value="";
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
//提交
|
|
|
$scope.saveStep3 = function (org, isDraft, orgType) {
|
|
|
if (orgCopy == org) {
|
|
|
@@ -703,14 +971,20 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
|
|
|
var orgCopy;
|
|
|
// 获取当前账户注册机构情况
|
|
|
- Organization.getByUuid({uuid : 10041166}, {}, function(data) {//10041166 10041558
|
|
|
+ Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041166 10041558
|
|
|
+ if (typeof data.id == 'undefined') {
|
|
|
+ return;
|
|
|
+ }
|
|
|
$scope.org = data;
|
|
|
+ $scope.materialUrl = $scope.org.material;
|
|
|
+ $scope.certifyUrl = $scope.org.certify;
|
|
|
+
|
|
|
orgCopy = angular.copy($scope.org);
|
|
|
}, function() {
|
|
|
toaster.pop('error', '注册情况加载失败');
|
|
|
});
|
|
|
|
|
|
- $scope.fileChanged = function(ele, order){
|
|
|
+ /*$scope.fileChanged = function(ele, order){
|
|
|
if (order == 0) {
|
|
|
//合作商户资料
|
|
|
$scope.material = ele.files[0];
|
|
|
@@ -719,7 +993,93 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
|
|
|
$scope.certify = ele.files[0];
|
|
|
}
|
|
|
$scope.$apply();
|
|
|
- }
|
|
|
+ }*/
|
|
|
+
|
|
|
+ //建立一个可存取到该file的url
|
|
|
+ var getObjectURL = function (file) {
|
|
|
+ var url = null;
|
|
|
+ if (window.createObjectURL != undefined) { // basic
|
|
|
+ url = window.createObjectURL(file);
|
|
|
+ } else if (window.URL != undefined) { // mozilla(firefox)
|
|
|
+ url = window.URL.createObjectURL(file);
|
|
|
+ } else if (window.webkitURL != undefined) { // webkit or chrome
|
|
|
+ url = window.webkitURL.createObjectURL(file);
|
|
|
+ }
|
|
|
+ return url;
|
|
|
+ };
|
|
|
+
|
|
|
+ // 图片上传
|
|
|
+ $scope.fileChanged = function(ele, order){
|
|
|
+ if (order == 0) {
|
|
|
+ $scope.material = ele.files[0];
|
|
|
+ $scope.materialUrl = getObjectURL($scope.material);
|
|
|
+ } else if (order == 1) {
|
|
|
+ $scope.certify = ele.files[0];
|
|
|
+ $scope.certifyUrl = getObjectURL($scope.certify);
|
|
|
+ }
|
|
|
+ $scope.$apply();
|
|
|
+ };
|
|
|
+
|
|
|
+ // 查看范例
|
|
|
+ $scope.showImg = function (type) {
|
|
|
+ var img = null;
|
|
|
+ var imgUrl = null;
|
|
|
+ switch (type) {
|
|
|
+ case 'material':
|
|
|
+ img = $scope.org.material;
|
|
|
+ imgUrl = $scope.materialUrl;
|
|
|
+ break;
|
|
|
+ case 'certify':
|
|
|
+ img = $scope.org.certify;
|
|
|
+ imgUrl = $scope.certifyUrl;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ if (img) {
|
|
|
+ var src = img, box = $('#image-box');
|
|
|
+ box.show();
|
|
|
+ box.find('img').attr('src', src);
|
|
|
+ box.find('a').click(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ box.dblclick(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ } else if (imgUrl != null) {
|
|
|
+ var src = imgUrl, box = $('#image-box');
|
|
|
+ box.show();
|
|
|
+ box.find('img').attr('src', src);
|
|
|
+ box.find('a').click(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ box.dblclick(function () {
|
|
|
+ box.hide();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
+ // 删除
|
|
|
+ $scope.clearFile = function (type) {
|
|
|
+ switch (type) {
|
|
|
+ case 'material':
|
|
|
+ $scope.material = null;
|
|
|
+ $scope.materialUrl = null;
|
|
|
+ break;
|
|
|
+ case 'certify':
|
|
|
+ $scope.certify = null;
|
|
|
+ $scope.certifyUrl = null;
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ // 清空input框的内容
|
|
|
+ var file=document.getElementById(type);
|
|
|
+ //IE,Safari,chrome
|
|
|
+ if(file.outerHTML){
|
|
|
+ file.outerHTML=file.outerHTML;
|
|
|
+ }
|
|
|
+ else{ //FF
|
|
|
+ file.value="";
|
|
|
+ }
|
|
|
+ };
|
|
|
+
|
|
|
//提交
|
|
|
$scope.saveStep4 = function (org, isDraft) {
|
|
|
if (orgCopy == org) {
|