Browse Source

修改弹框样式和轮播图

scr 8 years ago
parent
commit
80863c826b

+ 9 - 9
donate-console/src/main/webapp/resources/view/project/project_list.html

@@ -761,16 +761,16 @@
                             <thead>
                             <tr>
                                 <!--<td width="45"></td>-->
-                                <td width="230">项目名称</td>
-                                <td width="70" ng-if="active == 'audited'">进度</td>
+                                <td width="200">项目名称</td>
+                                <td width="80" ng-if="active == 'audited'">进度</td>
                                 <td width="120">领域分类</td>
                                 <td width="110">发布时间</td>
                                 <td width="200">发布机构</td>
                                 <td width="110">机构性质</td>
                                 <td width="100">募款目标</td>
-                                <td width="100">已筹善款</td>
-                                <td width="90">参与人</td>
-                                <td width="180"></td>
+                                <td width="140">已筹善款</td>
+                                <td width="90">参与人</td>
+                                <td width="80"></td>
                             </tr>
                             </thead>
                             <tbody ng-if="tableParams.total() == 0">
@@ -814,12 +814,12 @@
                                 </td>
                                 <td ng-if="active == 'audited'">{{project.overdue}}</td>
                                 <td>{{project.area}}</td>
-                                <td>{{project.submitTime | date:'yyyy-MM-dd HH:mm:ss'}}</td>
+                                <td>{{project.submitTime | date:'yyyy-MM-dd'}}</td>
                                 <td>{{project.orgName}}</td>
                                 <td>{{project.organization.type == 1 ? '公募' : '非公募'}}</td>
-                                <td>{{project.target | number}}元</td>
-                                <td>{{project.amount || 0 | number: 2}}元 <br/>({{project.amount * 100 / project.target || 0 | number: 2}}%)</td>
-                                <td>{{project.joinAmount || 0 | number}}人</td>
+                                <td>{{project.target||0}}元</td>
+                                <td>{{project.totalAmount||0.00}}元 <br/>({{(project.totalAmount/project.target*100)||0|number:2}})%</td>
+                                <td>{{project.joinAmount}}人</td>
                                 <td></td>
                             </tr>
                             </tbody>

+ 10 - 15
donate-service/pom.xml

@@ -48,11 +48,11 @@
     </profiles>
     <dependencies>
 
-      <!--  <dependency>
-        <groupId>com.uas.account</groupId>
-        <artifactId>account-common</artifactId>
-        <version>0.0.1-SNAPSHOT</version>
-    </dependency>-->
+        <dependency>
+            <groupId>com.uas.account</groupId>
+            <artifactId>account-common</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
 
         <dependency>
             <groupId>junit</groupId>
@@ -184,6 +184,11 @@
             <artifactId>commons-logging</artifactId>
             <version>1.2</version>
         </dependency>
+        <dependency>
+            <groupId>com.uas.account</groupId>
+            <artifactId>sso-core</artifactId>
+            <version>0.0.1-SNAPSHOT</version>
+        </dependency>
 
         <dependency>
             <groupId>com.github.binarywang</groupId>
@@ -201,21 +206,11 @@
             <artifactId>spring-context</artifactId>
             <version>4.3.3.RELEASE</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>4.3.3.RELEASE</version>
-        </dependency>
         <dependency>
             <groupId>org.springframework</groupId>
             <artifactId>spring-beans</artifactId>
             <version>4.3.9.RELEASE</version>
         </dependency>
-        <dependency>
-            <groupId>org.springframework</groupId>
-            <artifactId>spring-context</artifactId>
-            <version>4.3.3.RELEASE</version>
-        </dependency>
         <dependency>
             <groupId>log4j</groupId>
             <artifactId>log4j</artifactId>

+ 1 - 1
donate-service/src/main/java/com/uas/service/donate/SSOConfiguration.java

@@ -29,7 +29,7 @@ public class SSOConfiguration extends WebMvcConfigurerAdapter {
          * 拦截器配置
          */
 //        registry.addInterceptor(new SSOInterceptor()).addPathPatterns("/**").
-//                excludePathPatterns("/WEB-INF/**","/**/static/**", "/login/**", "/logout/**");
+//                excludePathPatterns("/WEB-INF/**","/**/static/**", "/sso/login/**", "/sso/logout/**");
     }
 
     @Bean

+ 4 - 2
donate-service/src/main/java/com/uas/service/donate/controller/AppController.java

@@ -1,6 +1,7 @@
 package com.uas.service.donate.controller;
 
 import com.alibaba.fastjson.JSONObject;
+import com.uas.account.util.AccountUtils;
 import com.uas.service.donate.model.*;
 import com.uas.service.donate.service.*;
 import org.springframework.beans.factory.annotation.Autowired;
@@ -92,7 +93,7 @@ public class AppController {
             List<Activity> activityList=activityController.getActivities(status);
             modelMap.put("activityList",activityList);
         }
-        if("".equals(keyWork)){
+        if(!"".equals(keyWork)){
             List<Activity> activityList=activityService.search(keyWork);
             modelMap.put("activityList",activityList);
         }
@@ -138,7 +139,8 @@ public class AppController {
      */
     @ResponseBody
     @RequestMapping(value = "/center",method = RequestMethod.GET)
-    public ModelMap center(Long uuid){
+    public ModelMap center(Long imid) throws Exception {
+        Long uuid=AccountUtils.getUserUUByImId(imid);
         ModelMap modelMap=new ModelMap();
         //获取个人账户信息
         User user=userService.findOne(uuid);

+ 1 - 1
donate-service/src/main/java/com/uas/service/donate/controller/CarouselController.java

@@ -22,4 +22,4 @@ public class CarouselController {
     public List<JSONObject> getCarousels(@RequestParam("useFor") String useFor){
         return carouselService.getCarousels(useFor);
     }
-}
+}

+ 4 - 32
donate-service/src/main/java/com/uas/service/donate/service/impl/ProjectRecordServiceImpl.java

@@ -54,39 +54,11 @@ public class ProjectRecordServiceImpl implements ProjectRecodeService {
     }
 
     public ProjectRecode join(ProjectRecode projectRecode) {
-        //得到此次捐款额
-        Double amount = projectRecode.getAmount();
-        //通过项目参与表的项目id,找到项目
-        Project project = projectService.findOne(projectRecode.getProId());
-        //通过项目id找到机构
-        Org org = orgService.findOne(project.getOrgId());
-
-        Double totalAmount = project.getTotalAmount();
-        if (totalAmount == null) {
-            totalAmount = (double) 0;
-        }
-        totalAmount += amount;
-        //重新设置该项目已筹集金额
-        project.setTotalAmount(totalAmount);
-        //得到该项目的参与人数
-        Long joinAmount = project.getJoinAmount();
-        if (joinAmount == null) {
-            joinAmount =  0L;
-        }
-        joinAmount++;
-        //重新设置该项目的参与人数
-        project.setJoinAmount(joinAmount);
-        //保存项目
-	    project = projectService.save(project);
+
         //设置项目待支付状态
-	    projectRecode.setStatus((short) 1);
-        //设置项目名
-        projectRecode.setProjectName(project.getName());
-        //设置机构名
-        projectRecode.setOrgName(org.getName());
-	    projectRecode = projectRecodeDao.save(projectRecode);
-	    projectRecode.setProject(project);
-        return projectRecode;
+        projectRecode.setStatus((short) 1);
+
+        return projectRecodeDao.save(projectRecode);
     }
 
     @Override

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

@@ -394,6 +394,14 @@
             color: #fff;
             cursor: pointer;
         }
+        .section2 .list-item a .donation:hover{
+            background: #be3b1b;
+        }
+        .section2 .list-item a.donationOver{
+            display: inline-block;
+            width: 190px;
+            height: 30px;
+            line-height: 30px;
         /*捐款完成*/
         .section2 .list-item a.donationOver{
             display: inline-block;
@@ -457,16 +465,17 @@
         .pop{
             position: fixed;
             background-color: white;
-            width: 480px;
+            width: 510px;
+            height: 410px;
             /*height: 330px;*/
             text-align: center;
-            /* border: 1px solid #e1e1e1; */
             display: none;
             top: 50%;
             left: 50%;
             margin-left: -240px;
             margin-top: -215px;
             z-index: 10;
+            background-color: white;
         }
         .pop .header{
             padding: 0 20px;
@@ -595,20 +604,22 @@
             height: 20px;
             vertical-align: middle;
         }
-        .pop .body button{
+
+        .pop .body .payMoeny{
             width: 200px;
             height: 40px;
             line-height: 40px;
             font-size: 18px;
             text-align: center;
-            background: #ef613b;
+            /* background: #ef613b;*/
+            background: #a0a0a0;
             color: #fff;
             border: none;
             outline: none;
         }
-        .pop .body button:hover{
+       /* .pop .body button:hover{
             background: #be3b1b;
-        }
+        }*/
         #hover-background .x-floating-wrap {
             position: fixed;
             z-index: 5;
@@ -660,6 +671,7 @@
         #toast-container {
             left: 0;
         }
+
     </style>
 </head>
 <script type="text/javascript" src="static/js/jquery-1.9.1.min.js"></script>
@@ -772,7 +784,7 @@
                         </div>
                         <div class="project-detail fl">
                             <p><a href="/project#/detail/${project.id}">${project.name!''}</a></p>
-                            <div><span>项目简介:</span><span>${project.summary!''}</span></div>
+                            <div><span>项目简介:</span><span>${project.proSummary!''}</span></div>
                             <div><span>筹款时间:</span><span>${project.startTime!''}至${project.endTime!''}</span></div>
                             <div><span>筹款目标:</span><span>${project.target!'0'}元</span></div>
                             <div><span>执&nbsp;行&nbsp;方:</span><span>${project.orgName!''}</span></div>
@@ -800,13 +812,13 @@
                             <div class="choose clearfix">
                                 <span class="fl">捐款金额:</span>
                                 <div class="fl">
-                                    <ul id="choose-money">
+                                    <ul class="choose-money">
                                         <li class="active">1元</li>
                                         <li>50元</li>
                                         <li>100元</li>
                                         <li>200元</li>
                                     </ul>
-                                    <div class="write"><input type="text" placeholder="其他金额" onkeyup= "if( ! /^d*(?:.d{0,2})?$/.test(this.value)) class="form-control" id="custom-amount${project.id!''}" maxlength="10"/><em>元</em></div>
+                                    <div class="write"><input name="othermoney" type="text" placeholder="其他金额" onkeyup= "if( ! /^d*(?:.d{0,2})?$/.test(this.value)) class="form-control" id="custom-amount${project.id!''}" maxlength="10"/><em>元</em></div>
                                 </div>
                             </div>
                             <div class="choose clearfix">
@@ -820,11 +832,11 @@
                             <div class="choose clearfix">
                             <#--<span class="fl best">我的祝福:</span>
                             <textarea name="" id="" cols="30" rows="10" class="fl form-control" maxlength="300"></textarea>-->
-                                <div class="fl agree clearfix">
-                                    <input type="checkbox" class="fl"><span class="fl">同意并接受《<a href="/userAgreement" target="_blank" style="color: #5078cb;">优软一元捐用户协议</a>》</span></span>
-                                </div>
+                            <div class="fl agree clearfix">
+                                    <input type="checkbox" name="checkbox" class="fl"><span class="fl">同意并接受《<a href="/userAgreement" target="_blank" style="color: #5078cb;">优软一元捐用户协议</a>》</span></span>
                             </div>
-                            <button onclick="pay(${project.id!''}, money, payWay)" class="buttonDisabled">确认捐款</button><#--</a>-->
+
+                            <input type="button" class="payMoeny" disabled="disabled" onclick="pay(${project.id!''}, money, payWay)" value="确认捐款"/><#--</a>-->
                         </div>
                     </div>
                 </div>
@@ -845,6 +857,7 @@
     </div>
 </div>
 <script>
+    /*生成轮播图*/
     $(document).ready(function () {
         var mySwiper = new Swiper ('.swiper-container', {
             autoplay:5000,
@@ -861,37 +874,61 @@
     $('.close').click(function(){
         $(this).parent().parent().css('display','none');
         $("#hover-background").css('display','none');
+    })
 
-        //重置弹出框条件
-//        var lis = $('#choose-money li');
-//        for (var i=0;i<lis.length; i++) {
-//            $(lis[i]).removeClass('active');
-//        }
-//        $(lis[0])..addClass('active');
-//
-//        var divs = $('#pay-way div.item');
-//        for (var i=0;i<divs.length; i++) {
-//            $(divs[i]).removeClass('active');
-//        }
-//        $(divs[0])..addClass('active');
-//
-//        var inputs = $(.write input);
-//        for (var i=0;i<inputs.length; i++) {
-//            $(inputs[i]).attr('value', '');
-//        }
-
+    //选择金额
+    var money = 1;
+    $('.choose-money li').on('click', function (event) {
+        var lis = $('.choose-money li');
+        for (var i=0;i<lis.length; i++) {
+            $(event.target).siblings('li').removeClass('active');
+        }
+        $(event.target).addClass('active');
+        money = $(event.target).text()
+    })
 
+    //选择支付方式
+    var payWay = "支付宝";
+    $('#pay-way div.item').on('click',function (event) {
+        var divs = $('#pay-way div.item');
+        for (var i=0;i<divs.length; i++) {
+            $(divs[i]).removeClass('active');
+        }
+        $(event.target).parent().addClass('active');
+        payWay = $(event.target).text()
     })
+    //    选择其他金额
+    $('.write input[type="text"]').focus(function(){
+        $(this).parent().prev().children('li').removeClass('active');
+//        console.log($(this).parent().prev().children('li').removeClass('active'))
+    })
+
+    function ispay(e){
+        var choosemoney=$(e).parent().siblings().find('.choose-money> li.active').text() ;
+        var othermoney=$(e).parent().siblings().find("input[name='othermoney']").val();
+        var isUserAgree=$(e).parent().siblings().find("input[name='checkbox']").is(':checked');
+        if((choosemoney!=null || othermoney!=null)&&isUserAgree!=null){
+            $(e).parent().siblings().find(".payMoeny").attr("background","#e96d08");
+        }
+    }
+
     function donate(e){
         $('.pop').css('display','none');
         $(e).parent().next().css('display','block');
         $("#hover-background").css('display','block');
+
+        setInterval(function(e){
+          ispay(e);
+       },0);
+
+        /*  var choosemoney=$(e).parent().next().find('.choose-money> li.active').text() ;
+          var othermoney=$(e).parent().next().find("input[name='othermoney']").val();
+          alert(choosemoney);
+          alert(othermoney);
+          var isUserAgree=$(e).parent().next().find("input[name='checkbox']").is(':checked');
+          alert(isUserAgree);*/
     }
 
-    //    banner
-    $('#myCarousel').carousel({
-        interval: 4000
-    })
     //    点击切换
     $('.button').on('click', 'span', function () {
         var index = $(this).index();
@@ -1017,52 +1054,7 @@
 
     })
 
-    //选择金额
-    var money = 1;
-    $('#choose-money li').on('click', function (event) {
-        var lis = $('#choose-money li');
-        for (var i=0;i<lis.length; i++) {
-            $(lis[i]).removeClass('active');
-        }
-        $(event.target).addClass('active');
-        money = $(event.target).text()
-    })
 
-    //选择支付方式
-    var payWay = "支付宝";
-    $('#pay-way div.item').on('click',function (event) {
-        var divs = $('#pay-way div.item');
-        for (var i=0;i<divs.length; i++) {
-            $(divs[i]).removeClass('active');
-        }
-        $(event.target).parent().addClass('active');
-//        console.log($(event.target).parent())
-        payWay = $(event.target).text()
-    })
-    //    选择其他金额
-    $('.write input[type="text"]').focus(function(){
-        $(this).parent().prev().children('li').removeClass('active');
-//        console.log($(this).parent().prev().children('li').removeClass('active'))
-    })
-
-    var ispayButtonAble = function () {
-        var isPayButtonAble = false;  //false时”确认捐款按钮不可点“
-        var isChooseMoney = false;
-        var isCustomAmount = false;
-        var isUserAgree = false;
-        console.log(isPayButtonAble);
-        console.log(isChooseMoney);
-        console.log(isCustomAmount);
-        console.log(isUserAgree);
-        //1. 判断默认金额处是否有选中的 var isChooseMoney = false; 有选中的话置为true
-        //2. 判断输入框是否有内容 var isCustomAmount = false; 有内容置为true
-        //3. 判断协议选择框是否处于选择状态 var isUserAgree = false; 选中置为true
-
-        if ((isChooseMoney || isCustomAmount) && isUserAgree) {
-            isPayButtonAble = true;
-        }
-        return isPayButtonAble;
-    }
 
     //    initToast();
     //    function initToast(){

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

@@ -669,8 +669,8 @@
                                             <em ng-if="project.overdue == 1">已结束</em>
                                         </span>
                                     </div>
-                                    <div><span>已参与:<em>{{joinedHistory | number}}</em>人</span></div>
-                                    <div><span>已筹款:<em>{{project.totalAmount | number}}</em>元({{project.totalAmount * 100 / project.target}}%)</span></div>
+                                    <div><span>已参与:<em>{{joinedHistory | number || 0}}</em>人</span></div>
+                                    <div><span>已筹款:<em>{{project.totalAmount | number || 0}}</em>元(({{project.totalAmount*100/project.target}})||0.00%)</span></div>
                                 </div>
                                 <a class="fr donation" data-toggle="modal" data-target="#layer">我要捐款</a>
                             </div>