Browse Source

bug修改

dongbw 8 years ago
parent
commit
ec8fda983a

+ 7 - 6
donate-console/src/main/java/com/uas/console/donate/controller/ActivityController.java

@@ -22,6 +22,8 @@ import org.springframework.ui.ModelMap;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.bind.annotation.*;
 import org.springframework.web.multipart.MultipartFile;
 import org.springframework.web.multipart.MultipartFile;
 
 
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
 import java.io.IOException;
 import java.io.IOException;
 import java.text.SimpleDateFormat;
 import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.ArrayList;
@@ -76,11 +78,7 @@ public class ActivityController {
     @ResponseBody
     @ResponseBody
     @RequestMapping("/save")
     @RequestMapping("/save")
     public Activity save(String jsonStr) throws IOException {
     public Activity save(String jsonStr) throws IOException {
-
         Activity activity = JSONObject.parseObject(jsonStr, Activity.class);
         Activity activity = JSONObject.parseObject(jsonStr, Activity.class);
-
-        List<Award> award=activity.getAwards();
-
         return activityService.save(activity);
         return activityService.save(activity);
     }
     }
 
 
@@ -89,9 +87,12 @@ public class ActivityController {
      */
      */
     @ResponseBody
     @ResponseBody
     @RequestMapping("/submit")
     @RequestMapping("/submit")
-    public Activity submit(String jsonStr){
+    public Activity submit(@RequestParam(required = false) MultipartFile logo,
+                           @RequestParam(required = false) MultipartFile pcImg,
+                           @RequestParam(required = false) MultipartFile mobileImg,
+                           @RequestParam (required = false) MultipartFile mobileListImg,
+                           @RequestParam String jsonStr, HttpServletRequest request, HttpServletResponse response){
         Activity activity = JSONObject.parseObject(jsonStr, Activity.class);
         Activity activity = JSONObject.parseObject(jsonStr, Activity.class);
-
         return activityService.submit(activity);
         return activityService.submit(activity);
     }
     }
 
 

+ 7 - 6
donate-console/src/main/java/com/uas/console/donate/controller/ProjectController.java

@@ -1,5 +1,6 @@
 package com.uas.console.donate.controller;
 package com.uas.console.donate.controller;
 
 
+import com.alibaba.fastjson.JSON;
 import com.alibaba.fastjson.JSONObject;
 import com.alibaba.fastjson.JSONObject;
 import com.uas.console.donate.model.*;
 import com.uas.console.donate.model.*;
 import com.uas.console.donate.service.AttachService;
 import com.uas.console.donate.service.AttachService;
@@ -109,8 +110,8 @@ public class ProjectController {
     public Project save(@RequestParam(required = false) MultipartFile logo,
     public Project save(@RequestParam(required = false) MultipartFile logo,
                         @RequestParam(required = false) MultipartFile pcImg,
                         @RequestParam(required = false) MultipartFile pcImg,
                         @RequestParam(required = false) MultipartFile mobileImg,
                         @RequestParam(required = false) MultipartFile mobileImg,
-                        @RequestParam(required = false) MultipartFile mobileListImg,
-                        String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException{
+                        @RequestParam (required = false) MultipartFile mobileListImg,
+                        @RequestParam String jsonStr, HttpServletRequest request, HttpServletResponse response) throws IOException{
 
 
         Project project=JSONObject.parseObject(jsonStr,Project.class);
         Project project=JSONObject.parseObject(jsonStr,Project.class);
         if(logo!=null){
         if(logo!=null){
@@ -153,8 +154,8 @@ public class ProjectController {
     public Project submit(@RequestParam(required = false) MultipartFile logo,
     public Project submit(@RequestParam(required = false) MultipartFile logo,
                           @RequestParam(required = false) MultipartFile pcImg,
                           @RequestParam(required = false) MultipartFile pcImg,
                           @RequestParam(required = false) MultipartFile mobileImg,
                           @RequestParam(required = false) MultipartFile mobileImg,
-                          @RequestParam(required = false) MultipartFile listImg,
-                          String jsonStr, HttpServletRequest request, HttpServletResponse response)throws IOException{
+                          @RequestParam (required = false) MultipartFile mobileListImg,
+                          @RequestParam String jsonStr, HttpServletRequest request, HttpServletResponse response)throws IOException{
         Project project = JSONObject.parseObject(jsonStr, Project.class);
         Project project = JSONObject.parseObject(jsonStr, Project.class);
         if(logo!=null){
         if(logo!=null){
             String file1=fileClient.upload(logo.getBytes(),logo.getSize(),"jpg",null);
             String file1=fileClient.upload(logo.getBytes(),logo.getSize(),"jpg",null);
@@ -168,8 +169,8 @@ public class ProjectController {
             String file3=fileClient.upload(mobileImg.getBytes(),mobileImg.getSize(),"jpg",null);
             String file3=fileClient.upload(mobileImg.getBytes(),mobileImg.getSize(),"jpg",null);
             project.setMobileImg(file3);
             project.setMobileImg(file3);
         }
         }
-        if(listImg!=null){
-            String file4=fileClient.upload(listImg.getBytes(),listImg.getSize(),"jpg",null);
+        if(mobileListImg!=null){
+            String file4=fileClient.upload(mobileListImg.getBytes(),mobileListImg.getSize(),"jpg",null);
             project.setListImg(file4);
             project.setListImg(file4);
         }
         }
         Date date=new Date();
         Date date=new Date();

+ 12 - 15
donate-console/src/main/webapp/WEB-INF/views/index.html

@@ -173,21 +173,18 @@
     });
     });
 
 
     $(document).ready(function() {
     $(document).ready(function() {
-        var btn = document.getElementsByClassName('dropdown-toggle');
-        console.log(btn.length);
-        for (var i = 0; i < btn.length; i++) {
-            console.log(btn);
-            var sib = btn[i].nextElementSibling;
-            var flag = true;
-            console.log(btn[i].nextElementSibling);
-            btn[i].onclick = function () {
-                if (flag) {
-                    sib.style.display = 'none';
-                    flag = false
-                } else {
-                    sib.style.display = 'block';
-                    flag = true
-                }
+        var btn = document.getElementsByClassName('dropdown-toggle')[0];
+        console.log(btn);
+        var sib = btn.nextElementSibling;
+        var flag = true;
+        console.log(btn.nextElementSibling);
+        btn.onclick = function () {
+            if (flag) {
+                sib.style.display = 'none';
+                flag = false
+            } else {
+                sib.style.display = 'block';
+                flag = true
             }
             }
         }
         }
     });
     });

+ 18 - 13
donate-console/src/main/webapp/resources/js/index/app.js

@@ -631,7 +631,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                     $scope.legalIdCard = ele.files[0];
                     $scope.legalIdCard = ele.files[0];
                 }
                 }
                 $scope.$apply();
                 $scope.$apply();
-            }
+            };
             //提交
             //提交
             $scope.saveStep3 = function (org, isDraft, orgType) {
             $scope.saveStep3 = function (org, isDraft, orgType) {
                 if (orgCopy == org) {
                 if (orgCopy == org) {
@@ -908,6 +908,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             data.append('mobileImg', $scope.mobileImg);
             data.append('mobileImg', $scope.mobileImg);
             data.append('mobileListImg', $scope.mobileListImg);
             data.append('mobileListImg', $scope.mobileListImg);
             data.append('logo', $scope.logo);
             data.append('logo', $scope.logo);
+            data.append('jsonStr', JSON.stringify(project));
             // type为true即为发布
             // type为true即为发布
             var url;
             var url;
             if (type) {
             if (type) {
@@ -921,12 +922,10 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                 },
                 },
                 method : 'POST',
                 method : 'POST',
                 processData : false,
                 processData : false,
+                contentType: false,
                 async: false,
                 async: false,
                 url : url,
                 url : url,
-                data: data,
-                params : {
-                    jsonStr : project
-                }
+                data: data
             }).success(function (data) {
             }).success(function (data) {
                 if (type) {
                 if (type) {
                     toaster.pop('success', '发布成功');
                     toaster.pop('success', '发布成功');
@@ -1513,8 +1512,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
     /**
     /**
      * 活动发起
      * 活动发起
      */
      */
-    app.controller('ActivityNewCtrl', ['$scope', 'BaseService', 'toaster', 'Activity',
-        function($scope, BaseService, toaster, Activity) {
+    app.controller('ActivityNewCtrl', ['$scope', 'BaseService', 'toaster', 'Activity', '$http',
+        function($scope, BaseService, toaster, Activity, $http) {
 
 
         $scope.activity = {
         $scope.activity = {
             awards:[],
             awards:[],
@@ -1563,7 +1562,12 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             if ($scope.awards.length >= 4) {
             if ($scope.awards.length >= 4) {
                 toaster.pop('warning', '提示', '最多可添加四个奖品');
                 toaster.pop('warning', '提示', '最多可添加四个奖品');
             } else {
             } else {
-                $scope.awards.push({});
+                $scope.awards.push({
+                    name: '',
+                    amount: null,
+                    awardLevel: '',
+                    way: 1
+                });
             }
             }
         };
         };
 
 
@@ -1673,13 +1677,16 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
 
 
         // 保存 或 提交
         // 保存 或 提交
         $scope.submit = function(type) {
         $scope.submit = function(type) {
+            var projectQualificationList = [];
             angular.forEach($scope.selectedProjects, function(project) {
             angular.forEach($scope.selectedProjects, function(project) {
                 var projectQualification = {};
                 var projectQualification = {};
                 projectQualification.activityId = $scope.activity.id;
                 projectQualification.activityId = $scope.activity.id;
                 projectQualification.proId = project.id;
                 projectQualification.proId = project.id;
                 projectQualification.name = project.name;
                 projectQualification.name = project.name;
-                $scope.activity.projectQualificationList.push(projectQualification);
+                projectQualificationList.push(projectQualification);
             });
             });
+            $scope.activity.projectQualificationList = projectQualificationList;
+            $scope.activity.awards = $scope.awards;
             var url;
             var url;
             if (type) {
             if (type) {
                 url = 'activity/submit';
                 url = 'activity/submit';
@@ -1693,6 +1700,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
             data.append('award2', $scope.award2);
             data.append('award2', $scope.award2);
             data.append('award3', $scope.award3);
             data.append('award3', $scope.award3);
             data.append('award4', $scope.award4);
             data.append('award4', $scope.award4);
+            data.append('jsonStr', JSON.stringify($scope.activity));
             $http({
             $http({
                 headers: {
                 headers: {
                     'Content-Type': undefined
                     'Content-Type': undefined
@@ -1701,10 +1709,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                 processData : false,
                 processData : false,
                 async: false,
                 async: false,
                 url : url,
                 url : url,
-                data: data,
-                params : {
-                    jsonStr : $scope.activity
-                }
+                data: data
             }).success(function (data) {
             }).success(function (data) {
                 if (type) {
                 if (type) {
                     toaster.pop('success', '发布成功');
                     toaster.pop('success', '发布成功');

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

@@ -17,7 +17,7 @@
         background: #ffffff;
         background: #ffffff;
         margin-bottom: 20px;
         margin-bottom: 20px;
         width: 100%;
         width: 100%;
-        height: 1700px;
+        min-height: 1700px;
         border: 1px solid #dcdcdc;
         border: 1px solid #dcdcdc;
         box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
         box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
     }
     }
@@ -594,7 +594,8 @@
                     </div>
                     </div>
                     <div class="form-group clearfix">
                     <div class="form-group clearfix">
                         <label for="" class="control-label fl">活动奖品</label>
                         <label for="" class="control-label fl">活动奖品</label>
-                            <div class="prise-list" ng-repeat="award in activity.awards">
+                        <div class="prise fl">
+                            <div class="prise-list" ng-repeat="award in awards">
                                 <div class="prise-detail">
                                 <div class="prise-detail">
                                     <div class="award"> <input type="text" ng-model="award.name"></div>
                                     <div class="award"> <input type="text" ng-model="award.name"></div>
                                     <span>{{$index + 1}}</span>
                                     <span>{{$index + 1}}</span>
@@ -611,8 +612,8 @@
                                 <div class="award-detail clearfix">
                                 <div class="award-detail clearfix">
                                     <span class="fl">赠送方式</span>
                                     <span class="fl">赠送方式</span>
                                     <select name="" ng-model="award.way" class="form-control fl">
                                     <select name="" ng-model="award.way" class="form-control fl">
-                                        <option ng-value="1">短信通知</option>
-                                        <option ng-value="2">快递配送</option>
+                                        <option ng-value="'1'">短信通知</option>
+                                        <option ng-value="'2'">快递配送</option>
                                     </select>
                                     </select>
                                     <!--<a class="edit-template fl" data-target="#redact" data-toggle="modal">编辑模板</a>-->
                                     <!--<a class="edit-template fl" data-target="#redact" data-toggle="modal">编辑模板</a>-->
                                 </div>
                                 </div>
@@ -622,11 +623,11 @@
                                 </div>
                                 </div>
                             </div>
                             </div>
                             <div class="add-price">
                             <div class="add-price">
-                                <span ng-click="addAward()">+添加奖品</span>
+                                <a ng-click="addAward()">+添加奖品</a>
                             </div>
                             </div>
                         </div>
                         </div>
                     </div>
                     </div>
-                    <div class="form-group clearfix">
+                    <div class="form-group clearfix" style="height:auto;">
                         <label class="control-label fl">活动项目</label>
                         <label class="control-label fl">活动项目</label>
                         <div class="project fl">
                         <div class="project fl">
                             <div class="activity-project">
                             <div class="activity-project">

+ 2 - 2
donate-console/src/main/webapp/resources/view/project/project_launch_1.html

@@ -523,7 +523,7 @@
                             <form action="" class="form" name="baseInfoForm">
                             <form action="" class="form" name="baseInfoForm">
                                 <div class="form-group clearfix">
                                 <div class="form-group clearfix">
                                     <label for="" class="fl">项目名称</label>
                                     <label for="" class="fl">项目名称</label>
-                                    <input type="text" ng-model="project.name" class="form-control fl" required>
+                                    <input type="text" ng-model="project.name" class="form-control fl" ng-maxlength="9" required>
                                     <span class="fl help-txt">(不超过9个字,例如“为植物人撑起希望”)</span>
                                     <span class="fl help-txt">(不超过9个字,例如“为植物人撑起希望”)</span>
                                 </div>
                                 </div>
                                 <div class="form-group clearfix">
                                 <div class="form-group clearfix">
@@ -579,7 +579,7 @@
 
 
                                 <div class="form-group clearfix">
                                 <div class="form-group clearfix">
                                     <label for="" class="fl">筹款目标</label>
                                     <label for="" class="fl">筹款目标</label>
-                                    <input type="text" ng-model="project.target" class="form-control fl" ng-pattern="/^\+?[1-9][0-9]*$  /" required>
+                                    <input type="text" ng-model="project.target" class="form-control fl" ng-pattern="/^\+?[1-9][0-9]*$/" required>
                                     <span class="fl help-txt">(请输入整数金额,例如:5000)</span>
                                     <span class="fl help-txt">(请输入整数金额,例如:5000)</span>
                                 </div>
                                 </div>
                                 <div class="form-group clearfix">
                                 <div class="form-group clearfix">

+ 0 - 60
donate-service/src/main/webapp/resources/view/common/donate_over.html

@@ -1,60 +0,0 @@
-<style>
-    .donate-overflow{
-        width: 480px;
-        height: 220px;
-    }
-    .donate-overflow .header{
-        padding: 0 20px;
-        width: 100%;
-        height: 44px;
-        line-height: 44px;
-        overflow: hidden;
-        background: #eeeeee;
-    }
-    .donate-overflow .header p{
-        font-size: 16px;
-        color: #e96d08;
-        font-weight: bold;
-    }
-    .donate-overflow .header .close{
-        font-size: 38px;
-    }
-    .donate-overflow .body{
-        padding-top: 50px;
-        margin: 0 auto;
-        text-align: center;
-    }
-    .donate-overflow .body p{
-        margin-bottom: 45px;
-        font-size: 16px;
-        color: #505050;
-    }
-    .donate-overflow .body .btn{
-        margin: 0 auto;
-        text-align: center;
-    }
-    .donate-overflow .body .btn button{
-        width: 110px;
-        height: 34px;
-        font-size: 16px;
-        color: #fff;
-        background: #ef613b;
-        border-radius: 0;
-        border: none;
-        outline: none;
-        text-align: center;
-    }
-    .donate-overflow .body .btn button:hover{
-        background: #be3b1b;
-    }
-</style>
-<div class="donate-overflow">
-    <div class="header">
-        <p class="fl">系统提示</p>
-        <div class="close fr" id="close">&times;</div>
-    </div>
-    <div class="body">
-        <p>感谢您的善心,该项目筹得目标善款!</p>
-        <div class="btn"><button>确认</button></div>
-    </div>
-</div>

+ 0 - 50
donate-service/src/main/webapp/resources/view/common/project_detail_side.html

@@ -1,50 +0,0 @@
-<!-- 项目相关内容 -->
-<!--参与的活动-->
-<div class="project-box fl">
-    <div class="box box1">
-        <span class="join">参与的活动</span>
-        <p class="title"><a href="/activity#/detail/{{activity.id}}">{{activity.name}}</a></p>
-        <div class="box-details">
-            <div class="box-detail clearfix">
-                <span class="fl">活动时间:</span>
-                <div class="fl">
-                    <span>{{activity.startTime | date:'yyyy-MM-dd'}}&nbsp;至&nbsp;{{activity.endTime | date:'yyyy-MM-dd'}} </span>
-                </div>
-            </div>
-            <div class="box-detail clearfix">
-                <span class="fl">活动奖品:</span>
-                <div class="fl">
-                    <span ng-repeat="award in activity.awards">{{award.awardName}}*{{award.amount}}</span>
-                </div>
-            </div>
-            <div class="box-detail clearfix">
-                <span class="fl">参加条件:</span>
-                <div class="fl">
-                    <span>相关的项目捐款一元以上</span>
-                </div>
-            </div>
-        </div>
-    </div>
-    <!--执行机构简介-->
-    <div class="box box2">
-        <span class="join">执行机构简介</span>
-        <p class="title">{{organization.name}}</p>
-        <div class="box-details">
-            <p>{{organization.summary}}</p>
-            <img src="{{organization.logo}}" alt="机构LOGO"/>
-        </div>
-    </div>
-    <!--同类项目-->
-    <div class="box3"  ng-if="sameKinds.length() != 0">
-        <h4>同类项目</h4>
-        <div class="item-list clearfix" ng-repeat="sameKind in sameKinds">
-            <div class="img fl">
-                <a ui-sref="detail(sameKind.id)"><img src="{{sameKind.listImg}}" alt="项目缩略图"></a>
-            </div>
-            <div class="txt fl">
-                <p><a ui-sref="detail(sameKind.id)">{{sameKind.name}}</a></p>
-                <span ng-bind="sameKind.proSummary"></span>
-            </div>
-        </div>
-    </div>
-</div>