ソースを参照

活动发起右侧间隔处理;开奖报错处理。

dongbw 8 年 前
コミット
5de125744e

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

@@ -281,12 +281,12 @@ public class ActivityController {
     /**
      * 开奖
      */
-    @RequestMapping(value = "/openAward", method = RequestMethod.POST)
+    @RequestMapping(value = "/openAward/{id}", method = RequestMethod.POST)
     @ResponseBody
-    public ResponseEntity<ModelMap> openAward(Long activityId){
+    public ResponseEntity<ModelMap> openAward(@PathVariable("id") Long id){
         ModelMap map = new ModelMap();
-        Activity activity = activityService.openAward(activityId);
-        map.put("id", activityId);
+        Activity activity = activityService.openAward(id);
+        map.put("id", id);
         return new ResponseEntity<ModelMap>(map, HttpStatus.OK);
     }
 
@@ -331,7 +331,9 @@ public class ActivityController {
     @RequestMapping(value = "/delete/prizeImg/ByBatch", method = RequestMethod.DELETE)
     @ResponseBody
     public void deletePrizeImgByBatch(@RequestParam String path) {
-        List<String> paths = JSON.parseArray(path, String.class);
+        List<String> paths = new ArrayList<>();
+        List<String> temp = Arrays.asList(path.split(","));
+        paths.addAll(temp);
         activityService.deletePrizeImgByBatch(paths);
     }
 }

+ 1 - 0
donate-console/src/main/java/com/uas/console/donate/service/impl/ActivityServiceImpl.java

@@ -220,6 +220,7 @@ public class ActivityServiceImpl implements ActivityService{
 
     @Override
     public Activity openAward(Long activityId) {
+        //TODO 开奖算法
         Activity activity = activityDao.findOne(activityId);
         activity.setLuckyTime(new Date());
         return activityDao.save(activity);

+ 1 - 1
donate-console/src/main/webapp/resources/css/base.css

@@ -1,6 +1,6 @@
 *{box-sizing: border-box;padding: 0;margin:0; font-family: "Microsoft Yahei", "微软雅黑";}
 html{-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%;}
-body,ol,table,tr,td,ul,li,dt,dd,dl,h1,h2,h3,h4,h5,h6,form,input,select,textarea,p,em,i,b,strong,span{font-size: 12px;font-weight: normal;list-style-type:none;font-style: inherit;}
+body,ol,table,tr,td,ul,li,dt,dd,dl,h1,h2,h3,h4,h5,h6,form,input,select,textarea,p,em,i,b,strong,span{font-size: 12px;font-weight: normal;list-style-type:none;font-style: inherit; padding-right: 0!important;}
 h1,h2,h3,h4,h5,h6{
 	margin: 0 !important;
 }

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

@@ -2132,6 +2132,8 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
         $scope.selectedProjects = [];
         $scope.tempSelectedProjects = [];
         $scope.keyword = '';
+        $scope.actImgUrl = null;
+        $scope.bannerUrl = null;
         var loadSavedActivity = function() {
             Activity.getSavedActivity({}, function(data) {
                 if (null !== data) {
@@ -2481,7 +2483,7 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'file-
                         });
                     }
                     $scope.loading = false;
-                    window.location.href = '#/activity';
+                    window.location.hash = '#/activity';
                 }).error(function (data) {
                     $scope.loadingShow = false;
                     toaster.pop('error', '出现错误,操作失败');

+ 5 - 2
donate-console/src/main/webapp/resources/js/index/services/Activity.js

@@ -40,8 +40,11 @@ define ([ 'ngResource' ], function() {
             },
             // 开奖
             openAward : {
-                url: 'activity/openAward',
-                method: 'POST'
+                url: 'activity/openAward/:id',
+                method: 'POST',
+                params: {
+                    id: id
+                }
             },
             // 获取草稿
             getSavedActivity: {

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

@@ -641,7 +641,7 @@
                                    ng-click="openDatePicker($event, activity, '$startTimeOpened')">
                             <span class="fl"  style="margin-left: 5px;">至</span>
                             <input type="text" ng-model="activity.endTime" readonly required
-                                   class="date-choose f1 form-control" placeholder="结束时间" title="请先选择活动开始时间"
+                                   class="date-choose f1 form-control" placeholder="结束时间" title="选择活动开始时间后可选此项"
                                    datepicker-popup="yyyy-MM-dd" is-open="activity.$endTimeOpened" min-date="activity.startTime"
                                    ng-required="true" ng-disabled="activity.startTime == null"
                                    current-text="今天" clear-text="清除" close-text="关闭"
@@ -656,7 +656,7 @@
                         <label class="control-label fl">兑奖时间</label>
                         <div class="active-time fl">
                             <input type="text" ng-model="activity.receiveStartTime" readonly style="float:left" required
-                                   class="date-choose f1 form-control" placeholder="开始兑奖时间" title="请先选择活动开始及结束时间"
+                                   class="date-choose f1 form-control" placeholder="开始兑奖时间" title="选择活动开始及结束时间后可选此项"
                                    datepicker-popup="yyyy-MM-dd" is-open="activity.$receiveStartTimeOpened"
                                    ng-required="true" min-date="activity.startTime" max-date="activity.endTime"
                                    current-text="今天" clear-text="清除" close-text="关闭" ng-disabled="activity.startTime == null || activity.endTime == null"
@@ -664,7 +664,7 @@
                                    ng-click="openDatePicker($event, activity, '$receiveStartTimeOpened')">
                             <span class="fl" style="margin-left: 5px;">至</span>
                             <input type="text" ng-model="activity.receiveEndTime" readonly required
-                                   class="date-choose f1 form-control" placeholder="截止兑奖时间"  title="请先选择兑奖开始时间"
+                                   class="date-choose f1 form-control" placeholder="截止兑奖时间"  title="选择兑奖开始时间之后可选此项"
                                    datepicker-popup="yyyy-MM-dd" is-open="activity.$receiveEndTimeOpened"
                                    ng-required="true" min-date="activity.receiveStartTime" max-date="activity.endTime"
                                    current-text="今天" clear-text="清除" close-text="关闭" ng-disabled="activity.receiveStartTime == null"
@@ -690,7 +690,7 @@
                             <div><button>上传图片</button><span>(160*160)</span></div>
                             <input type="file" ng-multiple="false" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 0)'>
                             <div ng-if="null != actImgUrl" class="showImg">
-                                <img src="{{actImgUrl}}">
+                                <img src="{{actImgUrl}}" alt="活动图片">
                                 <span class="hover-show">
                                     <em style="cursor: pointer;" class="delete" title="删除" ng-click="clearFile('actImg')"><em class="fa fa-2x fa-trash"></em></em>
                                     <a ng-click="showImg('actImg')" title="点击查看大图"><em class="fa fa-search"></em> 查看</a>
@@ -706,7 +706,7 @@
                             <div><button>上传图片</button><span>(1140*140)</span></div>
                             <input type="file" ng-multiple="false" accept="image/*" onchange='angular.element(this).scope().fileChanged(this, 1)'>
                             <div ng-if="null != bannerUrl"  class="showImg showImgs">
-                                <img src="{{bannerUrl}}">
+                                <img src="{{bannerUrl}}" alt="Banner">
                                 <span class="hover-show">
                                     <em style="cursor: pointer;" class="delete" title="删除" ng-click="clearFile('banner')"><em class="fa fa-2x fa-trash"></em></em>
                                     <a ng-click="showImg('banner')" title="点击查看大图"><em class="fa fa-search"></em> 查看</a>

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

@@ -986,7 +986,7 @@
             </form>
         </div>
         <!--捐款完成弹出框-->
-        <div class="donationOver">
+        <div class="donationOver" style="display: none">
             <div class="header">
                请确认微信支付是否完成?
             </div>