Bläddra i källkod

机构注册第二步

huangct 8 år sedan
förälder
incheckning
22fd9c85a9

+ 24 - 3
donate-console/src/main/webapp/resources/js/index/app.js

@@ -502,19 +502,40 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
 
             }
 
-
-
+            $scope.fileChanged = function(ele, order){
+                if (order == 0) {
+                    $scope.logo = ele.files[0];
+                } else if (order == 1) {
+                    $scope.personCertificate = ele.files[0];
+                } if (order == 2) {
+                    $scope.donateCertificate = ele.files[0];
+                } if (order == 3) {
+                    $scope.legalIdCard = ele.files[0];
+                }
+                $scope.$apply();
+            }
             //提交
             $scope.saveStep3 = function (org) {
+                var data = new FormData();      //以下为像后台提交图片数据
+                data.append('logo', $scope.logo);
+                data.append('personCertificate', $scope.personCertificate);
+                data.append('donateCertificate', $scope.donateCertificate);
+                data.append('legalIdCard', $scope.legalIdCard);
                 $http({
+                    headers: {
+                        'Content-Type': undefined
+                    },
                     method : 'POST',
+                    processData : false,
+                    async: false,
                     url : '/org/save',
+                    data: data,
                     params : {
                         jsonStr : org
                     },
                 }).success(function (data) {
                     if (data.success) {
-                        $location.path('charityCertificationStep2');
+                        $location.path('charityCertificationStep3');
                     }
                     if (data.error) {
                         toaster.pop('error', '提示', data.error);

+ 20 - 6
donate-console/src/main/webapp/resources/view/user/charityCertification3.html

@@ -482,6 +482,16 @@
         border-radius: 3px;
         border: none;
     }
+
+    .lookImg{
+        margin-left: 40px;
+        width: 40px;
+        height: 34px;
+        line-height: 34px;
+        text-align: center;
+        vertical-align: middle ;
+        border: 1px solid #dcdcdc;
+    }
 </style>
 
 <!--主体内容-->
@@ -507,11 +517,11 @@
                             <form action="">
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">机构开户名称</label>
-                                    <input type="text" class="fl form-control" ng-model="org.bankCardName">
+                                    <input type="text" class="fl form-control" ng-model="org.bankCardName" required="true">
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">银行账号</label>
-                                    <input type="text" class="fl form-control" ng-model="org.account" ng-change="getBankName({{org.account}})">
+                                    <input type="text" class="fl form-control" ng-model="org.account" required="true" ng-change="getBankName({{org.account}})">
                                 </div>
                                 <div class="form-group clearfix">
                                     <label for="" class="fl control-label">开户银行支行</label>
@@ -529,32 +539,36 @@
                                     <span class="fl">上传机构logo</span>
                                     <div class="fl uploadImg">
                                         <button>上传图片</button>
-                                        <input type="file">
+                                        <input type="file" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 0)'>
                                     </div>
+                                    <img class="fl lookImg" src="{{org.logo}}">
                                 </div>
                                 <div class="certificate-item clearfix">
                                     <span class="fl">慈善组织法人登记证书(加盖慈善机构红章)</span>
                                     <div class="fl uploadImg">
                                         <button>上传图片</button>
-                                        <input type="file">
+                                        <input type="file" id="personCertificateImage" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 1)'>
                                         <a href="">查看样式</a>
                                     </div>
+                                    <img class="fl lookImg" src="{{org.personCertificate}}">
                                 </div>
                                 <div class="certificate-item clearfix">
                                     <span class="fl">慈善组织公开募捐资格证书(加盖机构红章)</span>
                                     <div class="fl uploadImg">
                                         <button>上传图片</button>
-                                        <input type="file">
+                                        <input type="file" id="donateCertificateImage" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 2)'>
                                         <a href="">查看样式</a>
                                     </div>
+                                    <img class="fl lookImg" src="{{org.donateCertificate}}">
                                 </div>
                                 <div class="certificate-item clearfix">
                                     <span class="fl">法人身份证(加盖机构红章)</span>
                                     <div class="fl uploadImg">
                                         <button>上传图片</button>
-                                        <input type="file">
+                                        <input type="file" id="legalIdCardImage" ng-multiple="false" onchange='angular.element(this).scope().fileChanged(this, 3)'>
                                         <a href="">查看样式</a>
                                     </div>
+                                    <img class="fl lookImg" src="{{org.legalIdCard}}">
                                 </div>
                                 <div class="text-left submitBtn" style="margin-top: 75px;">
                                     <button type="submit" ng-click="saveStep3(org)" ng-disabled="charityCertification3.$invalid">保存,下一步</button>