Эх сурвалжийг харах

Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	donate-console/src/main/webapp/resources/js/index/app.js
dongbw 8 жил өмнө
parent
commit
0e23a5f76e

+ 124 - 43
donate-console/src/main/webapp/resources/js/index/app.js

@@ -564,13 +564,30 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
      * 机构入驻选择
      */
+    app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
+        function ($scope, toaster, Organization, $location, AuthenticationService) {
     app.controller('SelectInstitutionsNatureCtrl', ['$scope', 'toaster', 'Organization', '$location', 'BaseService', '$rootScope',
         function ($scope, toaster, Organization, $location, BaseService, $rootScope) {
             BaseService.scrollBackToTop();
             $rootScope.tree = 'user';
             $rootScope.thief = 'newOrg';
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        $scope.org = data;
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
+            });
+            Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
                 $scope.org = data;
             }, function() {
                 toaster.pop('error', '注册情况加载失败');
@@ -694,6 +711,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             BaseService.scrollBackToTop();
             $rootScope.tree = 'user';
             $rootScope.thief = 'newOrg';
+    app.controller('CertificationStep0Ctrl', ['$scope', 'toaster', 'Organization', '$location', 'AuthenticationService',
+        function ($scope, toaster, Organization, $location, AuthenticationService) {
             $scope.checked = true;
             $scope.changeChecked = function() {
                 $scope.checked = !$scope.checked;
@@ -710,19 +729,32 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             }
 
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                if (typeof data.id == 'undefined') {
-                    return;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+                        $scope.checked = true;
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
                 }
-                $scope.checked = true;
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
             });
+
         }]);
 
     /**
      * 机构认证第一步
      */
+    app.controller('CertificationStep1Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', '$filter', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, $filter, toaster, Organization, AuthenticationService) {
     app.controller('CertificationStep1Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', '$filter', 'toaster', 'Organization',
         function ($scope, BaseService, $http, $rootScope, $timeout, $location, $filter, toaster, Organization) {
             BaseService.scrollBackToTop();
@@ -730,22 +762,31 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             $rootScope.thief = 'newOrg';
             // 主要领域
             // $scope.areas = ['疾病援助', '扶贫/救灾', '教育/助学' , '环境/动物保护', '其他'];
-
             $scope.org = {
                 majorArea: 1
             };
 
             var orgCopy;
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                if (typeof data.id == 'undefined') {
-                    return;
-                }
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
-                $scope.org = data;
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        if (typeof data.id == 'undefined') {
+                            return;
+                        }
+
+                        $scope.org = data;
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
 
             // 获取地址信息
@@ -784,6 +825,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                         $location.path('charityCertificationStep2');
                     }
                 } else {
+                    org.uuid = $scope.userUU;
                     org.type = orgType;//机构类别(1:公募 2:非公募)
                     //var file = $scope.myFiles, file = file && file.length > 0 ? file[0] : null;// 可以不传附件
                     $http({
@@ -824,6 +866,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
      * 机构认证第二步
      */
+    app.controller('CertificationStep2Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
+
     app.controller('CertificationStep2Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
         function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization) {
             BaseService.scrollBackToTop();
@@ -831,11 +876,21 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             $rootScope.thief = 'newOrg';
             var orgCopy;
             // 获取当前账户注册机构情况
-            Organization.getByUuid({uuid : 222222}, {}, function(data) {//10041558
-                $scope.org = data;
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
+
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, function(data) {//10041558
+                        $scope.org = data;
+                        orgCopy = angular.copy($scope.org);
+                    }, function() {
+                        toaster.pop('error', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
 
             //提交
@@ -886,6 +941,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
      * 机构认证第三步
      */
+    app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'BaseService', 'AuthenticationService',
+        function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization, BaseService, AuthenticationService) {
     app.controller('CertificationStep3Ctrl', ['$scope', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'BaseService',
         function ($scope, $http, $rootScope, $timeout, $location, toaster, Organization, BaseService) {
             BaseService.scrollBackToTop();
@@ -893,20 +950,31 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             $rootScope.thief = 'newOrg';
             var orgCopy;
             // 获取当前账户注册机构情况
-            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;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, 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', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
+
             if (angular.isUndefined($scope.org)) {
                 $scope.org = {};
             }
@@ -1130,6 +1198,9 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
      * 公募机构认证第四步
      */
+    app.controller('PublicCertificationStep4Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization', 'AuthenticationService',
+        function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization, AuthenticationService) {
+
     app.controller('PublicCertificationStep4Ctrl', ['$scope', 'BaseService', '$http', '$rootScope', '$timeout', '$location', 'toaster', 'Organization',
         function ($scope, BaseService, $http, $rootScope, $timeout, $location, toaster, Organization) {
             BaseService.scrollBackToTop();
@@ -1137,17 +1208,27 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             $rootScope.thief = 'newOrg';
             var orgCopy;
             // 获取当前账户注册机构情况
-            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;
+            AuthenticationService.getAuthentication().success(function (data) {
+                if (data.content) {
+                    $scope.userUU = data.content.userUU;
 
-                orgCopy = angular.copy($scope.org);
-            }, function() {
-                toaster.pop('error', '注册情况加载失败');
+                    Organization.getByUuid({uuid : $scope.userUU}, {}, 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', '注册情况加载失败');
+                    });
+                }
+                if (data == null || !data.content) {
+                    //$scope.isAuthed = false;
+                    AuthenticationService.redirectSignin();
+                }
             });
 
             if (angular.isUndefined($scope.org)) {

+ 2 - 2
donate-console/src/main/webapp/resources/view/activity/activity_launch.html

@@ -770,7 +770,7 @@
                                 <div class="award-detail clearfix">
                                     <span class="fl">数量</span>
                                     <input ng-pattern="/^[1-9]\d*$/" type="text" name="awardAmount" ng-model="award.amount" class="fl form-control" required
-                                           ng-class="{'showEmpty' : submited && activityForm.awardAmount.$error.required}"/>
+                                           ng-class="{'showEmpty': submited && activityForm.awardAmount.$error.required || submited && activityForm.awardAmount.$error.pattern}"/>
 
                                     <span class="error" ng-show="submited && activityForm.awardAmount.$error.required">*活动奖品的数量不能为空</span>
                                     <span class="error" ng-show="submited && activityForm.awardAmount.$error.pattern">*活动奖品的数量不正确</span>
@@ -778,7 +778,7 @@
                                 <div class="award-detail clearfix">
                                     <span class="fl">奖品等级</span>
                                     <input type="text" ng-model="award.awardLevel" maxlength="10" class="fl form-control" required
-                                                       ng-class="{'showEmpty' : submited && !award.awardLevel}"/>
+                                                       ng-class="{'showEmpty': submited && !award.awardLevel}"/>
 
                                     <span class="error" ng-show="submited && !award.awardLevel">*活动奖品的奖品等级不能为空</span>
                                 </div>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification1.html

@@ -509,7 +509,7 @@
                                 </div>
                                     <div class="form-group clearfix">
                                         <label for="" class="fl control-label">优软账号</label>
-                                        <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" ng-model="org.uuid">
+                                        <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" value="{{userUU}}" readonly><!--ng-model="org.uuid"-->
 
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                         <span class="error" ng-show="submited && charityCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>

+ 2 - 1
donate-console/src/main/webapp/resources/view/user/charityCertification3.html

@@ -619,9 +619,10 @@
                             </div>
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">银行账号</label>
-                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" required="true" ng-change="getBankName({{org.account}})">
+                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" ng-pattern="/^[0-9]*$/" required="true" ng-change="getBankName({{org.account}})">
 
                                 <span class="error" ng-show="submited && charityCertification3.orgAccount.$error.required">*银行账号不能为空</span>
+                                <span class="error" ng-show="submited && charityCertification3.orgAccount.$error.pattern">*请输入正确的银行账号</span>
                             </div>
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">开户银行支行</label>

+ 1 - 1
donate-console/src/main/webapp/resources/view/user/publicOfferingCertification1.html

@@ -544,7 +544,7 @@
                             </div>
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">优软账号</label>
-                                <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" ng-model="org.uuid">
+                                <input required type="text" name="orgUuid" class="fl form-control" ng-maxlength="15" placeholder="请输入企业UU号" value="{{userUU}}" readonly><!--ng-model="org.uuid"-->
 
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.required">*优软账号不能为空</span>
                                 <span class="error" ng-show="submited && publicOfferingCertification1.orgUuid.$error.maxlength">*请填写正确的账号</span>

+ 2 - 1
donate-console/src/main/webapp/resources/view/user/publicOfferingCertification3.html

@@ -634,9 +634,10 @@
                             </div>
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">银行账号</label>
-                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" required="true" ng-change="getBankName({{org.account}})">
+                                <input type="text" class="fl form-control" name="orgAccount" ng-model="org.account" ng-pattern="/^[0-9]*$/" required="true" ng-change="getBankName({{org.account}})">
 
                                 <span class="error" ng-show="submited && publicOfferingCertification3.orgAccount.$error.required">*银行账号不能为空</span>
+                                <span class="error" ng-show="submited && publicOfferingCertification3.orgAccount.$error.pattern">*请输入正确的银行账号</span>
                             </div>
                             <div class="form-group clearfix">
                                 <label for="" class="fl control-label">开户银行支行</label>

+ 1 - 1
donate-service/src/main/resources/templates/index.ftl

@@ -1218,7 +1218,7 @@
                 "closeButton": true,
                 "debug": false,
                 "newestOnTop": false,
-                "progressBar": true,
+                "progressBar": false,
                 "positionClass": "toast-top-center",
                 "preventDuplicates": false,
                 "onclick": null,

+ 1 - 1
donate-service/src/main/webapp/WEB-INF/views/project.html

@@ -60,7 +60,7 @@ data-main="static/js/project/main.js"></script>
             "closeButton": true,
             "debug": false,
             "newestOnTop": false,
-            "progressBar": true,
+            "progressBar": false,
             "positionClass": "toast-top-center",
             "preventDuplicates": false,
             "onclick": null,

+ 3 - 0
donate-service/src/main/webapp/resources/js/mobile/controllers/MobileProjectDetailCtrl.js

@@ -6,15 +6,18 @@ define([ 'app/app' ], function(app) {
         var id = $stateParams.id;
         $scope.outTradeNo = $stateParams.outTradeNo;
         $scope.imId = null;
+        $scope.loading = true;
         if (!angular.isUndefined($stateParams.imId)) {
             $scope.imId = $stateParams.imId;
         }
         var init = function () {
 
             Project.getDetailById({ id: id}, {}, function (data) {
+                $scope.loading = false;
                 $scope.project = data;
                 $scope.styCode = $scope.project.introduction;
                 $scope.introduction = $sce.trustAsHtml($scope.styCode);
+                alert($scope.introduction.length());
                 $scope.organization = data.organization;
                 $scope.percentage = data.totalAmount / data.target;
                 // document.write('<script type="text/javascript" src="static/js/mobile/detail.js"></script>');

+ 2 - 3
donate-service/src/main/webapp/resources/js/pay.js

@@ -6,9 +6,8 @@
 // var amount;
 // var payWay;//0支付宝 1微信 2银联
 // var uuid = "10041166";
-
-const userAgent = navigator.userAgent;
-const isMobile = /(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(userAgent);
+var userAgent = navigator.userAgent;
+var isMobile = /(iPhone|iPad|Opera Mini|Android.*Mobile|NetFront|PSP|BlackBerry|Windows Phone)/ig.test(userAgent);
 
 var pay =function (proId, amount, payWay, imid) {
      var customAmount = $("#custom-amount" + proId).val();

+ 29 - 7
donate-service/src/main/webapp/resources/view/mobile/mobile_project_detail.html

@@ -119,6 +119,8 @@
     }
     .banner img{
         width: 100%;
+        height: 5.2rem;
+        margin: 0 auto;
     }
     .banner .carousel-indicators{
         bottom: 0;
@@ -250,12 +252,23 @@
         font-size: .24rem;
         color: #969696;
     }
+    .project-item .intro-date p.time{
+        float: left;
+        margin-left: .2rem;
+        width: 4.5rem;
+        text-align: left;
+        font-size: .24rem;
+        color: #969696;
+    }
     .project-intro {
         padding: 0 .3rem;
         margin-top: .2rem;
         background: #fff;
         text-align: left;
     }
+    .project-init{
+        margin-bottom: 1.55rem;
+    }
     .project-first{
         margin-top: 0;
     }
@@ -286,6 +299,10 @@
         font-size: .28rem !important ;
         color: #666;
     }
+    .project-intro .bottom .list-show .show-all div{
+        font-size: .28rem !important ;
+        color: #666;
+    }
     .project-intro .bottom .list-show .show-all a{
         width: 100% !important;
     }
@@ -684,6 +701,7 @@
         -webkit-overflow-scrolling: touch;
         outline: 0;
         background: rgba(0,0,0,.5);
+        display: none;
     }
     #myModal{
         display: table;
@@ -754,7 +772,7 @@
                 </div>
                 <div class="intro-detail">
                     <div class="intro-date">
-                        <span>筹款截止日期</span>
+                        <span>筹款时间</span>
                         <p class="time">{{project.startTime | date:'yyyy-MM-dd'}}至&nbsp;{{project.endTime | date:'yyyy-MM-dd'}}</p>
                     </div>
                 </div>
@@ -796,7 +814,7 @@
                     <!--</p>-->
                 <!--</div>-->
             <!--</div>-->
-            <div class="project-intro">
+            <div class="project-intro project-init">
                 <div class="top">
                     <span>执行机构</span>
                 </div>
@@ -810,7 +828,7 @@
             </div>
             <div class="footer">
                 <!--<a href="" class="look"><img src="../static/images/mobile/list-ul.png" alt=""/>查看同类其他项目</a>-->
-                <button type="button" class="attend" ng-disabled="project.overdue == '已结束'">我要捐款</button>
+                <button type="button" class="attend" ng-disabled="project.overdue == '已结束' || loading">我要捐款</button>
             </div>
         </div>
         <!--进度-->
@@ -890,7 +908,7 @@
                     </p>
                 </div>
             </div>
-            <div class="project-intro">
+            <div class="project-intro project-init">
                 <div class="top">
                     <span>机构信息</span>
                 </div>
@@ -957,9 +975,12 @@
                         <div ng-bind-html="introduction">
 
                         </div>
-                        <div class="btnClick">
+                        <div class="btnClick btnDown" style="display:none">
                             展开全文<i class="fa fa-angle-down"></i>
                         </div>
+                        <div class="btnClick btnUp" style="display:none">
+                            收起<i class="fa fa-angle-up"></i>
+                        </div>
                     </div>
                 </div>
             </div>
@@ -982,7 +1003,7 @@
                     <!--</p>-->
                 <!--</div>-->
             <!--</div>-->
-            <div class="project-intro">
+            <div class="project-intro project-init">
                 <div class="top">
                     <span>执行机构</span>
                 </div>
@@ -1061,7 +1082,8 @@
         var $showAll = $('.show-all');
 
         var $height = document.documentElement.clientHeight;
-        console.log($height)
+//        alert($height);
+//        alert($showAll.height());
         if ($height > 700) {
             $showAll.css({
                 'height': '6rem',

+ 4 - 2
donate-service/src/main/webapp/resources/view/project/donateQrcode.html

@@ -127,6 +127,10 @@
             font-size: 14px;
             color: #8c8c8c;
         }
+        .modal-backdrop{
+            position: static !important ;
+            background-color: transparent !important ;
+        }
     </style>
 </head>
 <body>
@@ -148,7 +152,5 @@
 <!--js begin-->
 <script src="/static/lib/jquery/jquery.min.js"></script>
 <script src="/static/lib/bootstrap/js/bootstrap.min.js"></script>
-<script>
-</script>
 </body>
 </html>

+ 22 - 16
donate-service/src/main/webapp/resources/view/project/project_detail.html

@@ -670,6 +670,9 @@
     .show{
         display: block;
     }
+    /*.modal-backdrop{*/
+        /*background-color: transparent !important ;*/
+    /*}*/
 </style>
 <body>
 <!-- loading start -->
@@ -751,7 +754,7 @@
                         <span>已筹款:<em ng-bind="project.totalAmount || 0 | number: 2"></em>元<span>({{percentage * 100 || 0 | number: 2}}%)</span></span>
                     </div>
                     <!--我要捐款-->
-                    <button class="button" data-toggle="modal" data-target="#layer" ng-disabled="!canDonate">我要捐款</button>
+                    <button class="button" data-toggle="modal" data-target="#layer" ng-disabled="!canDonate" data-dismiss="modal">我要捐款</button>
                 </div>
             </div>
         </div>
@@ -777,7 +780,7 @@
                         <p>联系电话:<span ng-bind="project.personTel"></span></p>
                     </div>
                     <div class="button">
-                        <button class="button" data-toggle="modal" data-target="#layer"  ng-disabled="cannotDonate">我要捐款</button>
+                        <button class="button" data-toggle="modal" data-target="#layer"  ng-disabled="!canDonate" data-dismiss="modal">我要捐款</button>
                     </div>
                 </div>
                 <div ng-include src="'static/view/project/project_detail_side.html'"></div>
@@ -853,21 +856,24 @@
     </div>
 </div>
 <script>
-    //    点击切换
-    $('#top').on('click', '.tabNav', function () {
-        var index = $(this).index();
-        $(this).addClass('active').siblings().removeClass('active');
-        $('.bottom').eq(index).addClass('show').siblings().removeClass('show');
-    });
+    $(function(){
 
-    $('.select-money').on('click', function () {
-        $(this).addClass('active').siblings().removeClass('active');
-    });
-    $('.select-way').on('click', function () {
-        $(this).addClass('active').siblings().removeClass('active');
-    });
-    $('.input-money').on('focus', function () {
-        $('.select-money').removeClass('active');
+        //    点击切换
+        $('#top').on('click', '.tabNav', function () {
+            var index = $(this).index();
+            $(this).addClass('active').siblings().removeClass('active');
+            $('.bottom').eq(index).addClass('show').siblings().removeClass('show');
+        });
+
+        $('.select-money').on('click', function () {
+            $(this).addClass('active').siblings().removeClass('active');
+        });
+        $('.select-way').on('click', function () {
+            $(this).addClass('active').siblings().removeClass('active');
+        });
+        $('.input-money').on('focus', function () {
+            $('.select-money').removeClass('active');
+        });
     });
 </script>
 <script type="text/javascript" src="static/js/pay.js"></script>