Commit ed895398287e182f0a616009cbb58a28228deaa9

Authored by 王言钊
1 parent ffc2a8e8

活动管理分页查询、删除,以及其他的优化

src/main/java/com/cnlive/shenhe/controller/ShyActivityController.java
... ... @@ -49,16 +49,16 @@ import java.util.List;
49 49 * @create 2022-03-08 12:37
50 50 */
51 51 @Controller
52   -@RequestMapping("/page")
  52 +@RequestMapping("/activity")
53 53 public class ShyActivityController {
54 54 @Autowired
55 55 private ShyActivityImpl shyActivityImpl;
56 56  
57 57 @PostMapping("/add")
58 58 @ResponseBody
59   - public ResponseBean insterShyActivity(ShyActivity shyActivity, Model model){
  59 + public ResponseBean insterShyActivity(ShyActivity shyActivity) {
60 60 int i = shyActivityImpl.insertShyActivity(shyActivity);
61   - if (i>0) {
  61 + if (i > 0) {
62 62 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "当前用户添加成功");
63 63 }
64 64 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "添加失败,请重试");
... ... @@ -66,31 +66,33 @@ public class ShyActivityController {
66 66  
67 67 @DeleteMapping("/delete/{id}")
68 68 @ResponseBody
69   - public ResponseBean deleteShyActivity(@PathVariable(value = "id") Integer id,Model model){
  69 + public ResponseBean deleteShyActivity(@PathVariable(value = "id") Integer id) {
70 70 int i = shyActivityImpl.deleteShyActivity(id);
71   - if (i>0) {
  71 + if (i > 0) {
72 72 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "删除当前用户添加成功");
73 73 }
74 74 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "删除失败,请重试");
75 75  
76 76 }
  77 +
77 78 @PutMapping("/update")
78 79 @ResponseBody
79   - public ResponseBean updateShyActivity(ShyActivity shyActivity,Model model){
  80 + public ResponseBean updateShyActivity(ShyActivity shyActivity) {
80 81 int i = shyActivityImpl.updateShyActivity(shyActivity);
81   - if (i>0) {
  82 + if (i > 0) {
82 83 return new ResponseBean(ErrorEnum.SUCCESS.getErrorCode(), "修改当前用户添加成功");
83 84 }
84 85 return new ResponseBean(ErrorEnum.ERROR.getErrorCode(), "修改失败,请重试");
85 86  
86 87 }
87 88  
88   - @GetMapping("/get/{page}/{Pagesize}")
89   - public String getShyActivity(Integer id,@PathVariable(name = "page",value = "1") Integer page,@PathVariable(name = "Pagesize",value = "10") Integer Pagesize,Model model){
90   - PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(page, Pagesize, id);
91   - List<ShyActivity> list = shyActivityPageInfo.getList();
92   - model.addAttribute("list", list);
  89 + @GetMapping("/page")
  90 + public String getShyActivity(Integer id, @RequestParam(defaultValue = "1") Integer pageNum, @RequestParam(defaultValue = "10") Integer pageSize, Model model) {
  91 + PageInfo<ShyActivity> shyActivityPageInfo = shyActivityImpl.selectByExample(id,pageNum, pageSize);
  92 + List<ShyActivity> ShyActivitylist = shyActivityPageInfo.getList();
  93 + model.addAttribute("ShyActivitylist", shyActivityPageInfo);
93 94 return "page/activity.html";
94 95 }
95 96  
  97 +
96 98 }
... ...
src/main/java/com/cnlive/shenhe/controller/VideosController.java
... ... @@ -266,58 +266,6 @@ public class VideosController extends BaseController {
266 266 }
267 267 }
268 268  
269   - //if ("1".equals(source1)) {
270   - // detailsContent.setSpid_desc("童声共济" + "(目击者)");
271   - //} else if ("2".equals(source1)) {
272   - // detailsContent.setSpid_desc("全民健身" + "(目击者)");
273   - //} else if ("3".equals(source1)) {
274   - // detailsContent.setSpid_desc("政府监督" + "(目击者)");
275   - //} else if ("4".equals(source1)) {
276   - // detailsContent.setSpid_desc("美食中国" + "(目击者)");
277   - //} else if ("5".equals(source1)) {
278   - // detailsContent.setSpid_desc("老年大学" + "(目击者)");
279   - //} else if ("6".equals(source1)) {
280   - // detailsContent.setSpid_desc("旅游摄影大赛" + "(目击者)");
281   - //} else if ("7".equals(source1)) {
282   - // detailsContent.setSpid_desc("老年大学公开课" + "(目击者)");
283   - //} else if ("8".equals(source1)) {
284   - // detailsContent.setSpid_desc("甲申同文" + "(目击者)");
285   - //} else if ("9".equals(source1)) {
286   - // detailsContent.setSpid_desc("万人同唱一首歌" + "(目击者)");
287   - //} else if ("10".equals(source1)) {
288   - // detailsContent.setSpid_desc("上太空" + "(目击者)");
289   - //} else if ("11".equals(source1)) {
290   - // detailsContent.setSpid_desc("芳华归来个人" + "(目击者)");
291   - //} else if ("12".equals(source1)) {
292   - // detailsContent.setSpid_desc("芳华归来团体" + "(目击者)");
293   - //} else if ("13".equals(source1)) {
294   - // detailsContent.setSpid_desc("小小表演家" + "(目击者)");
295   - //} else if ("100".equals(source1)) {
296   - // detailsContent.setSpid_desc("追问发布会" + "(目击者)");
297   - //} else if ("14".equals(source1)) {
298   - // detailsContent.setSpid_desc("中国微电影" + "(目击者)");
299   - //} else if ("15".equals(source1)) {
300   - // detailsContent.setSpid_desc("幼儿闯关" + "(目击者)");
301   - //} else if ("16".equals(source1)) {
302   - // detailsContent.setSpid_desc("少儿闯关" + "(目击者)");
303   - //} else if ("101".equals(source1)) {
304   - // detailsContent.setSpid_desc("电商-cms" + "(目击者)");
305   - //} else if ("17".equals(source1)) {
306   - // detailsContent.setSpid_desc("青岛读书" + "(目击者)");
307   - //} else if ("18".equals(source1)) {
308   - // detailsContent.setSpid_desc("红色故事演讲" + "(目击者)");
309   - //} else if ("19".equals(source1)) {
310   - // detailsContent.setSpid_desc("红色诗词朗诵" + "(目击者)");
311   - //} else if ("20".equals(source1)) {
312   - // detailsContent.setSpid_desc("红色短剧展演" + "(目击者)");
313   - //} else if ("21".equals(source1)) {
314   - // detailsContent.setSpid_desc("视频号" + "(目击者)");
315   - //} else if ("33".equals(source1)) {
316   - // detailsContent.setSpid_desc("万人同唱献给党-独唱" + "(目击者)");
317   - //} else if ("34".equals(source1)) {
318   - // detailsContent.setSpid_desc("万人同唱献给党-合唱" + "(目击者)");
319   - //} else if ("29".equals(source1)) {
320   - // detailsContent.setSpid_desc("我们的声音上太空" + "(目击者)");
321 269 } else {
322 270 detailsContent.setSpid_desc(shySites.getName() + "(目击者)");
323 271 }
... ...
src/main/java/com/cnlive/shenhe/entity/ShyActivity.java
... ... @@ -19,12 +19,14 @@ public class ShyActivity {
19 19 /**
20 20 * 创建时间
21 21 */
22   - private Date createTime;
  22 + private Date create_time;
23 23  
24 24 /**
25 25 * 修改时间
26 26 */
27   - private Date updateTime;
  27 + private Date update_time;
  28 +
  29 + private Byte exempt_from_trial;
28 30  
29 31 /**
30 32 * 获取活动表主键ID
... ... @@ -65,36 +67,50 @@ public class ShyActivity {
65 67 /**
66 68 * 获取创建时间
67 69 *
68   - * @return createTime - 创建时间
  70 + * @return create_time - 创建时间
69 71 */
70   - public Date getCreateTime() {
71   - return createTime;
  72 + public Date getCreate_time() {
  73 + return create_time;
72 74 }
73 75  
74 76 /**
75 77 * 设置创建时间
76 78 *
77   - * @param createTime 创建时间
  79 + * @param create_time 创建时间
78 80 */
79   - public void setCreateTime(Date createTime) {
80   - this.createTime = createTime;
  81 + public void setCreate_time(Date create_time) {
  82 + this.create_time = create_time;
81 83 }
82 84  
83 85 /**
84 86 * 获取修改时间
85 87 *
86   - * @return updateTime - 修改时间
  88 + * @return update_time - 修改时间
87 89 */
88   - public Date getUpdateTime() {
89   - return updateTime;
  90 + public Date getUpdate_time() {
  91 + return update_time;
90 92 }
91 93  
92 94 /**
93 95 * 设置修改时间
94 96 *
95   - * @param updateTime 修改时间
  97 + * @param update_time 修改时间
  98 + */
  99 + public void setUpdate_time(Date update_time) {
  100 + this.update_time = update_time;
  101 + }
  102 +
  103 + /**
  104 + * @return exempt_from_trial
  105 + */
  106 + public Byte getExempt_from_trial() {
  107 + return exempt_from_trial;
  108 + }
  109 +
  110 + /**
  111 + * @param exempt_from_trial
96 112 */
97   - public void setUpdateTime(Date updateTime) {
98   - this.updateTime = updateTime;
  113 + public void setExempt_from_trial(Byte exempt_from_trial) {
  114 + this.exempt_from_trial = exempt_from_trial;
99 115 }
100 116 }
101 117 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/mapper/ShyActivityMapper.java
... ... @@ -3,5 +3,10 @@ package com.cnlive.shenhe.mapper;
3 3 import com.cnlive.shenhe.entity.ShyActivity;
4 4 import tk.mybatis.mapper.common.Mapper;
5 5  
  6 +import java.util.List;
  7 +
6 8 public interface ShyActivityMapper extends Mapper<ShyActivity> {
  9 +
  10 +
  11 + List<Integer> selectAllByExempt_from_trial(Integer exempt_from_trial);
7 12 }
8 13 \ No newline at end of file
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/ShyActivityImpl.java
... ... @@ -88,20 +88,32 @@ public class ShyActivityImpl {
88 88  
89 89 /**
90 90 * 查询活动
91   - * @param page
  91 + * @param pageNum
92 92 * @param pageSize
93 93 * @return
94 94 */
95   - public PageInfo<ShyActivity> selectByExample(Integer page, Integer pageSize,Integer id) {
  95 + public PageInfo<ShyActivity> selectByExample(Integer id,Integer pageNum, Integer pageSize) {
96 96 Example example = new Example(ShyActivity.class);
97 97 Example.Criteria criteria = example.createCriteria();
98 98 criteria.andEqualTo(id);
99   - PageHelper.startPage(page, pageSize, true);
  99 + PageHelper.startPage(pageNum, pageSize, true);
100 100 List<ShyActivity> shyActivities = ShyActivityMapper.selectByExample(example);
101 101 PageInfo<ShyActivity> shyActivityPageInfo = new PageInfo<>(shyActivities);
102 102 return shyActivityPageInfo;
103 103 }
104 104  
  105 +
  106 + /**
  107 + * 根据条件查询活动
  108 + * @param
  109 + * @param exempt_from_trial
  110 + * @return
  111 + */
  112 + public List<Integer> selectByExample(Integer exempt_from_trial) {
  113 + List<Integer> shyActivities = ShyActivityMapper.selectAllByExempt_from_trial(exempt_from_trial);
  114 + return shyActivities;
  115 + }
  116 +
105 117 /**
106 118 * 查询所有的数据
107 119 */
... ...
src/main/java/com/cnlive/shenhe/serviceImpl/VideosServiceImpl.java
... ... @@ -54,6 +54,8 @@ public class VideosServiceImpl {
54 54 VideofilterServiceImpl videofilterServiceImpl;
55 55 @Autowired
56 56 YiDunServiceImpl yiDunServiceImpl;
  57 + @Autowired
  58 + ShyActivityImpl shyActivityImpl;
57 59  
58 60 @Value("${qn_domain}")
59 61 String qn_domain;
... ... @@ -109,7 +111,7 @@ public class VideosServiceImpl {
109 111 return shyVideosMapper.updateByPrimaryKey(shyVideos);
110 112 }
111 113  
112   - public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id,String source,String video_user_id,String shen_auditor_id,String video_id) {
  114 + public PageInfo<ShyVideos> getListContent(String video_title, String start_date, String end_date, Integer state, Integer receive, Integer page, Integer pageSize, String video_priority, String orderByClause, Integer spid, String userId, String sp_Id, String source, String video_user_id, String shen_auditor_id, String video_id) {
113 115 Example example = new Example(ShyVideos.class);
114 116 Example.Criteria criteria = example.createCriteria();
115 117 Example.Criteria criteria2 = example.createCriteria();
... ... @@ -147,11 +149,11 @@ public class VideosServiceImpl {
147 149 criteria2.andEqualTo("video_id", video_id);
148 150 }
149 151  
150   - if(CommonUtils.isNotEmpty(shen_auditor_id)){
151   - if("白名单".equals(shen_auditor_id)||"自动审核".equals(shen_auditor_id)){
  152 + if (CommonUtils.isNotEmpty(shen_auditor_id)) {
  153 + if ("白名单".equals(shen_auditor_id) || "自动审核".equals(shen_auditor_id)) {
152 154 criteria.andEqualTo("updater", shen_auditor_id);
153 155 criteria2.andEqualTo("updater", shen_auditor_id);
154   - }else{
  156 + } else {
155 157 criteria.andEqualTo("auditor_id", shen_auditor_id);
156 158 criteria2.andEqualTo("auditor_id", shen_auditor_id);
157 159 }
... ... @@ -173,7 +175,7 @@ public class VideosServiceImpl {
173 175 if (CommonUtils.isNotNull(spid)) {
174 176 criteria.andEqualTo("spid", spid);
175 177 criteria2.andEqualTo("spid", spid);
176   - } else if(CommonUtils.isNotEmpty(sp_Id)) {
  178 + } else if (CommonUtils.isNotEmpty(sp_Id)) {
177 179 criteria.andEqualTo("spid", sp_Id);
178 180 criteria2.andEqualTo("spid", sp_Id);
179 181 }
... ... @@ -283,7 +285,7 @@ public class VideosServiceImpl {
283 285 * @param userId
284 286 * @return
285 287 */
286   - public List<ShyVideos> findByCondition(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, Integer spid, String userId,Integer source,String video_user_id) {
  288 + public List<ShyVideos> findByCondition(String video_title, String start_date, String end_date, Integer state, Integer receive, String video_priority, String orderByClause, Integer spid, String userId, Integer source, String video_user_id) {
287 289 Example example = new Example(ShyVideos.class);
288 290 Example.Criteria criteria = example.createCriteria();
289 291 Example.Criteria criteria2 = example.createCriteria();
... ... @@ -317,7 +319,7 @@ public class VideosServiceImpl {
317 319 criteria.andEqualTo("video_user_id", video_user_id);
318 320 }
319 321  
320   - if (source!=null) {
  322 + if (source != null) {
321 323 criteria.andEqualTo("source", source);
322 324 }
323 325  
... ... @@ -462,12 +464,13 @@ public class VideosServiceImpl {
462 464 public void getShenheType(ShyVideos shyVideo) {
463 465 //获取点播免审sp
464 466 List<Integer> sites = sitesService.getBusinessList(CommonConst.BUSINESS_VIDEO);
  467 + List<Integer> shyActivities = shyActivityImpl.selectByExample(CommonConst.AUDIT_TYPE_FREE);
465 468 logger.info("sites" + sites.toString());
466 469 //初始化一个审核状态
467 470 //审核类型,1:免审,2:机审,3:人工审
468 471 Integer shenheType = 3;
469 472 //如果当前sp是免审sp
470   - if (sites.contains(shyVideo.getSpid()) || "1".equals(shyVideo.getSource()) || "9".equals(shyVideo.getSource()) || "8".equals(shyVideo.getSource()) || "29".equals(shyVideo.getSource()) || "30".equals(shyVideo.getSource()) || "31".equals(shyVideo.getSource()) || "36".equals(shyVideo.getSource()) || "38".equals(shyVideo.getSource()) || "39".equals(shyVideo.getSource())|| "40".equals(shyVideo.getSource())) {
  473 + if (sites.contains(shyVideo.getSpid()) || shyActivities.contains(shyVideo.getSource())){
471 474 //免审
472 475 shenheType = 1;
473 476 } else {
... ...
src/main/resources/mapper/ShyActivityMapper.xml
... ... @@ -7,7 +7,13 @@
7 7 -->
8 8 <id column="id" jdbcType="INTEGER" property="id" />
9 9 <result column="activity" jdbcType="VARCHAR" property="activity" />
10   - <result column="createTime" jdbcType="TIMESTAMP" property="createTime" />
11   - <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
  10 + <result column="create_time" jdbcType="TIMESTAMP" property="create_time" />
  11 + <result column="update_time" jdbcType="TIMESTAMP" property="update_time" />
  12 + <result column="exempt_from_trial" jdbcType="TINYINT" property="exempt_from_trial" />
12 13 </resultMap>
  14 + <select id="selectAllByExempt_from_trial" resultType="java.lang.Integer">
  15 + select id from shy_activity where exempt_from_trial=${exempt_from_trial};
  16 + </select>
  17 +
  18 +
13 19 </mapper>
14 20 \ No newline at end of file
... ...
src/main/resources/templates/common/frame.html
... ... @@ -95,7 +95,7 @@ line-height: 2em; margin: 0 auto;font-size: 2em&quot; th:text=&quot;${session.sessionUser.
95 95 <li><a href="/email/page" id="/email/page"> 邮件消息管理</a></li>
96 96 <li><a href="/usersFree/page" id="/usersFree/page"> 网++白名单管理</a></li>
97 97 <li><a href="/notSpeak/page" id="/notSpeak/page"> 网++禁言管理</a></li>
98   - <li><a href="/page/get/" id="/page/get"> 活动管理</a></li>
  98 + <li><a href="/activity/page" id="/activity/page"> 活动管理</a></li>
99 99 </ul>
100 100 </li>
101 101 </ul>
... ...
src/main/resources/templates/page/activity.html
... ... @@ -3,65 +3,72 @@
3 3  
4 4 <head th:replace="../templates/common/head::head"></head>
5 5 <style type="text/css">
6   - .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search{margin-top: 0px;}
7   - .table{margin-bottom:0;}
8   -
9   -
10   - .switch {
11   - position: relative;
12   - display: inline-block;
13   - width: 60px;
14   - height: 34px;
15   -}
16   -
17   -.switch input {display:none;}
18   -
19   -.slider {
20   - position: absolute;
21   - cursor: pointer;
22   - top: 0;
23   - left: 0;
24   - right: 0;
25   - bottom: 0;
26   - background-color: red;
27   - -webkit-transition: .4s;
28   - transition: .4s;
29   -}
30   -
31   -.slider:before {
32   - position: absolute;
33   - content: "";
34   - height: 26px;
35   - width: 26px;
36   - left: 4px;
37   - bottom: 4px;
38   - background-color: white;
39   - -webkit-transition: .4s;
40   - transition: .4s;
41   -}
42   -
43   -input:checked + .slider {
44   - background-color: #2196F3;
45   -}
46   -
47   -input:focus + .slider {
48   - box-shadow: 0 0 1px #2196F3;
49   -}
50   -
51   -input:checked + .slider:before {
52   - -webkit-transform: translateX(26px);
53   - -ms-transform: translateX(26px);
54   - transform: translateX(26px);
55   -}
56   -
57   -/* Rounded sliders */
58   -.slider.round {
59   - border-radius: 34px;
60   -}
61   -
62   -.slider.round:before {
63   - border-radius: 50%;
64   -}
  6 + .fixed-table-toolbar .bs-bars, .fixed-table-toolbar .columns, .fixed-table-toolbar .search {
  7 + margin-top: 0px;
  8 + }
  9 +
  10 + .table {
  11 + margin-bottom: 0;
  12 + }
  13 +
  14 +
  15 + .switch {
  16 + position: relative;
  17 + display: inline-block;
  18 + width: 60px;
  19 + height: 34px;
  20 + }
  21 +
  22 + .switch input {
  23 + display: none;
  24 + }
  25 +
  26 + .slider {
  27 + position: absolute;
  28 + cursor: pointer;
  29 + top: 0;
  30 + left: 0;
  31 + right: 0;
  32 + bottom: 0;
  33 + background-color: red;
  34 + -webkit-transition: .4s;
  35 + transition: .4s;
  36 + }
  37 +
  38 + .slider:before {
  39 + position: absolute;
  40 + content: "";
  41 + height: 26px;
  42 + width: 26px;
  43 + left: 4px;
  44 + bottom: 4px;
  45 + background-color: white;
  46 + -webkit-transition: .4s;
  47 + transition: .4s;
  48 + }
  49 +
  50 + input:checked + .slider {
  51 + background-color: #2196F3;
  52 + }
  53 +
  54 + input:focus + .slider {
  55 + box-shadow: 0 0 1px #2196F3;
  56 + }
  57 +
  58 + input:checked + .slider:before {
  59 + -webkit-transform: translateX(26px);
  60 + -ms-transform: translateX(26px);
  61 + transform: translateX(26px);
  62 + }
  63 +
  64 + /* Rounded sliders */
  65 + .slider.round {
  66 + border-radius: 34px;
  67 + }
  68 +
  69 + .slider.round:before {
  70 + border-radius: 50%;
  71 + }
65 72  
66 73 </style>
67 74 <body class="skin-blue sidebar-mini">
... ... @@ -73,7 +80,7 @@ input:checked + .slider:before {
73 80 <div class="content-wrapper" style="min-height: 788px;">
74 81 <section class="content-header">
75 82 <h1>
76   - 活动管理
  83 + 活动管理
77 84 </h1>
78 85 <ol class="breadcrumb">
79 86 <li>首页</li>
... ... @@ -84,235 +91,267 @@ input:checked + .slider:before {
84 91 <section class="content">
85 92 <div class="row">
86 93 <div class="col-xs-12">
87   - <div class="box box-info">
88   - <div class="box-body">
89   - <div class="btn-group margin-bottom " style="padding: 0; width: 98%; float: right;">
90   - <div class="columns columns-right btn-group ">
91   - <button class="btn btn-success" onclick="javascript:add()" type="button" name="refresh" title="添加" id="email_addS">添加</button>
92   - </div>
93   - <div class="col-md-6 pull-right" style="padding: 0; width: 5%;">
94   - <button class="btn btn-default" type="button" name="refresh"
95   - title="搜索" id="emailQuery">搜索</button>
96   - </div>
97   - <div class="col-md-6 pull-right" style="padding: 0; width: 20%;">
98   - <label for="mobile" class="control-label cb-toolbar"
99   - style="font-size: 15px; top: 8px; font-weight: 100;">邮件地址:</label>
100   - <div class="col-sm-7" style="padding: 0;">
101   - <input class="form-control" type="text" th:value="${param.email}" id="email_query">
102   - </div>
103   - </div>
104   - <div class="col-md-5 pull-right" style="padding: 0; width: 15%;">
105   - <label for="sp_id" class="control-label cb-toolbar"
106   - style="font-size: 15px; top: 8px; font-weight: 100;">邮件人:</label>
107   - <div class="col-sm-7" style="padding: 0;">
108   - <input class="form-control" type="text" th:value="${param.remark}" id="remark_query">
109   - </div>
110   - </div>
111   - </div>
112   -
113   -
114   -
115   - <div class="fixed-table-container" style="padding-bottom: 0px;">
116   - <div class="fixed-table-body">
117   - <table data-toggle="table" data-pagination="true" data-search="false" data-show-refresh="true"
118   - data-show-toggle="true" data-show-columns="true" data-toolbar="#toolbar" class="table table-hover">
119   - <thead>
120   - <tr>
121   - <th style="text-align: center; width: 5%;" data-field="sp_id" tabindex="0">
122   - <div class="th-inner ">活动ID</div>
123   - <div class="fht-cell"></div>
124   - </th>
125   - <th style="text-align: center; width: 12%;" data-field="sp_id_brief" tabindex="0">
126   - <div class="th-inner ">活动名称</div>
127   - <div class="fht-cell"></div>
128   - </th>
129   -<!-- <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">-->
130   -<!-- <div class="th-inner ">邮件人</div>-->
131   -<!-- <div class="fht-cell"></div>-->
132   -<!-- </th>-->
133   -<!-- <th style="text-align: center; width: 12%;" data-field="type" tabindex="0">-->
134   -<!-- <div class="th-inner ">通知类型</div>-->
135   -<!-- <div class="fht-cell"></div>-->
136   -<!-- </th>-->
137   -<!-- <th style="text-align: center; width: 6%;" data-field="type" tabindex="0">-->
138   -<!-- <div class="th-inner ">使用状态</div>-->
139   -<!-- <div class="fht-cell"></div>-->
140   -<!-- </th>-->
141   -<!-- <th style="text-align: center; width: 8%;" data-field="type" tabindex="0">-->
142   -<!-- <div class="th-inner ">修改人</div>-->
143   -<!-- <div class="fht-cell"></div>-->
144   -<!-- </th>-->
145   - <th style="text-align: center; width: 12%;" data-field="upload_time" tabindex="0">
146   - <div class="th-inner ">创建时间</div>
147   - <div class="fht-cell"></div>
148   - </th>
149   - <th style="text-align: center; width: 12%;" data-field="updated_at" tabindex="0">
150   - <div class="th-inner ">更新时间</div>
151   - <div class="fht-cell"></div>
152   - </th>
153   - <th style="text-align: center; width: 10%;" data-field="action" tabindex="0">
154   - <div class="th-inner ">操作</div>
155   - <div class="fht-cell"></div>
156   - </th>
157   - </tr>
158   - </thead>
159   - <tbody>
160   - <tr th:data-index="${emailStat.index}" th:each="ls:${list}">
161   - <td style="text-align: center; width: 5%;" th:text="${ls.id}">82</td>
162   - <td style="text-align: center; width: 12%;" th:text="${ls.activity}">视讯中国</td>
163   - <td style="text-align: center; width: 12%;" th:text="${#dates.format(ls.createTime, 'yyyy-MM-dd HH:mm:ss')}">2018-11-22
164   - 23:08:48</td>
165   - <td style="text-align: center; width: 12%;" th:text="${#dates.format(ls.updateTime, 'yyyy-MM-dd HH:mm:ss')}">2016-08-03
166   - 14:27:17</td>
167   - <td style="text-align: center; width: 10%;">
168   - <span>&nbsp;</span>
169   - <a class="edit" th:href="'javascript:edit('+${ls.id}+',\''+${ls.activity}'">
170   - <button class="btn btn-primary btn-xs">修改</button>
171   - </a><span> </span><span>&nbsp;</span>
172   - <span>&nbsp;</span>
173   - <a class="delete" th:href="'javascript:deleted('+${ls.id}+')'">
174   - <button class="btn btn-danger btn-xs">删除</button>
175   - </a><span> </span><span>&nbsp;</span></td>
176   - </tr>
177   -
178   - </tbody>
179   - </table>
180   - </div>
181   -
182   - <div class="fixed-table-pagination" style="display: block;">
183   - <div class="pull-left pagination-detail">
184   - <span class="pagination-info"
185   - th:text="'共 '+${ls.total}+' 条记录,每页显示'">共 0 条记录</span>
186   - <select class="" id="pageSize" name="pageSize"
187   - onchange="selectPageSize()">
188   - <option value="10" th:selected="${pageSize==10}">10</option>
189   - <option value="20" th:selected="${pageSize==20}">20</option>
190   - <option value="50" th:selected="${pageSize==50}">50</option>
191   - <option value="100" th:selected="${pageSize==100}">100</option>
192   - </select> <span class="pagination-info">条记录</span>
193   - </div>
194   - <div class="pull-right pagination">
195   - <ul class="pagination" th:if="${emailPage.pages>1}">
196   - <li class="page-pre"><a
197   - th:href="'javascript:fanye(1);'">‹‹</a></li>
198   - <li class="page-pre" th:if="${!emailPage.isFirstPage}"><a
199   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'">‹</a>
200   - </li>
201   -
202   - <li class="page-number" th:if="${emailPage.pageNum-3>=1}"><a
203   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-3}+'\');'"
204   - th:text="${emailPage.pageNum-3}">2</a></li>
205   - <li class="page-number" th:if="${emailPage.pageNum-2>=1}"><a
206   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-2}+'\');'"
207   - th:text="${emailPage.pageNum-2}">2</a></li>
208   - <li class="page-number" th:if="${emailPage.pageNum-1>=1}"><a
209   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum-1}+'\');'"
210   - th:text="${emailPage.pageNum-1}">2</a></li>
211   - <li class="page-number active"><a
212   - href="javaScript:void(0);" th:text="${emailPage.pageNum}">2</a></li>
213   - <li class="page-number"
214   - th:if="${emailPage.pageNum+1<=emailPage.pages}"><a
215   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'"
216   - th:text="${emailPage.pageNum+1}">2</a></li>
217   - <li class="page-number"
218   - th:if="${emailPage.pageNum+2<=emailPage.pages}"><a
219   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+2}+'\');'"
220   - th:text="${emailPage.pageNum+2}">2</a></li>
221   - <li class="page-number"
222   - th:if="${emailPage.pageNum+3<=emailPage.pages}"><a
223   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+3}+'\');'"
224   - th:text="${emailPage.pageNum+3}">2</a></li>
225   -
226   - <li class="page-next" th:if="${!emailPage.isLastPage}"><a
227   - th:onclick="'javascript:fanye(\''+${emailPage.pageNum+1}+'\');'">›</a>
228   - </li>
229   - <li class="page-next"><a
230   - th:onclick="'javascript:fanye(\''+${emailPage.pages}+'\');'">››</a>
231   - </li>
232   - </ul>
233   - </div>
234   - </div>
235   - </div>
236   - </div>
237   - <div class="clearfix"></div>
238   - </div>
239   - </div>
  94 + <div class="box box-info">
  95 + <div class="box-body">
  96 + <div class="btn-group margin-bottom " style="padding: 0; width: 98%; float: right;">
  97 + <div class="columns columns-right btn-group ">
  98 + <button class="btn btn-success" onclick="javascript:add()" type="button"
  99 + name="refresh" title="添加" id="email_addS">添加
  100 + </button>
  101 + </div>
  102 + <div class="col-md-6 pull-right" style="padding: 0; width: 5%;">
  103 + <button class="btn btn-default" type="button" name="refresh"
  104 + title="搜索" id="emailQuery">搜索
  105 + </button>
  106 + </div>
  107 + <div class="col-md-6 pull-right" style="padding: 0; width: 20%;">
  108 + <label for="mobile" class="control-label cb-toolbar"
  109 + style="font-size: 15px; top: 8px; font-weight: 100;">活动名称:</label>
  110 + <div class="col-sm-7" style="padding: 0;">
  111 + <input class="form-control" type="text" th:value="${param.email}"
  112 + id="email_query">
  113 + </div>
  114 + </div>
  115 + <div class="col-md-5 pull-right" style="padding: 0; width: 15%;">
  116 + <label for="sp_id" class="control-label cb-toolbar"
  117 + style="font-size: 15px; top: 8px; font-weight: 100;">是否审核:</label>
  118 + <div class="col-sm-7" style="padding: 0;">
  119 + <input class="form-control" type="text" th:value="${param.remark}"
  120 + id="remark_query">
  121 + </div>
  122 + </div>
  123 + </div>
  124 +
  125 +
  126 + <div class="fixed-table-container" style="padding-bottom: 0px;">
  127 + <div class="fixed-table-body">
  128 + <table data-toggle="table" data-pagination="true" data-search="false"
  129 + data-show-refresh="true"
  130 + data-show-toggle="true" data-show-columns="true" data-toolbar="#toolbar"
  131 + class="table table-hover">
  132 + <thead>
  133 + <tr>
  134 + <th style="text-align: center; width: 5%;" data-field="sp_id" tabindex="0">
  135 + <div class="th-inner ">活动ID</div>
  136 + <div class="fht-cell"></div>
  137 + </th>
  138 + <th style="text-align: center; width: 12%;" data-field="sp_id_brief"
  139 + tabindex="0">
  140 + <div class="th-inner ">活动名称</div>
  141 + <div class="fht-cell"></div>
  142 + </th>
  143 +
  144 + <th style="text-align: center; width: 12%;" data-field="upload_time"
  145 + tabindex="0">
  146 + <div class="th-inner ">创建时间</div>
  147 + <div class="fht-cell"></div>
  148 + </th>
  149 + <th style="text-align: center; width: 12%;" data-field="updated_at"
  150 + tabindex="0">
  151 + <div class="th-inner ">更新时间</div>
  152 + <div class="fht-cell"></div>
  153 + </th>
  154 +
  155 + <th style="text-align: center; width: 12%;" data-field="upload_time"
  156 + tabindex="0">
  157 + <div class="th-inner ">免审状态</div>
  158 + <div class="fht-cell"></div>
  159 + </th>
  160 +
  161 + <th style="text-align: center; width: 10%;" data-field="action"
  162 + tabindex="0">
  163 + <div class="th-inner ">操作</div>
  164 + <div class="fht-cell"></div>
  165 + </th>
  166 + </tr>
  167 + </thead>
  168 + <tbody>
  169 + <tr th:data-index="${ShyActivityStat.index}"
  170 + th:each="ShyActivity :${ShyActivitylist.list}">
  171 + <td style="text-align: center; width: 5%;" th:text="${ShyActivity.id}">82
  172 + </td>
  173 + <td style="text-align: center; width: 12%;"
  174 + th:text="${ShyActivity.activity}">视讯中国
  175 + </td>
  176 + <td style="text-align: center; width: 12%;"
  177 + th:text="${#dates.format(ShyActivity.create_time, 'yyyy-MM-dd HH:mm:ss')}">
  178 + 2018-11-22
  179 + 23:08:48
  180 + </td>
  181 + <td style="text-align: center; width: 12%;"
  182 + th:text="${#dates.format(ShyActivity.update_time, 'yyyy-MM-dd HH:mm:ss')}">
  183 + 2016-08-03
  184 + 14:27:17
  185 + </td>
  186 +
  187 + <td style="text-align: center; width: 12%;"
  188 + th:text="${ShyActivity.exempt_from_trial} == 1 ? 已经免审 : 未免审">
  189 + 2016-08-03
  190 + 14:27:17
  191 + </td>
  192 +
  193 +
  194 + <td style="text-align: center; width: 10%;">
  195 + <span>&nbsp;</span>
  196 + <a class="edit"
  197 + th:href="'javascript:edit('+${ShyActivity.id}+',\''+${ShyActivity.activity}+',\''+${ShyActivity.exempt_from_trial} +'\')'">
  198 + <button class="btn btn-primary btn-xs">修改</button>
  199 + </a><span> </span><span>&nbsp;</span>
  200 + <span>&nbsp;</span>
  201 + <a class="delete" th:href="'javascript:deleted('+${ShyActivity.id}+')'">
  202 + <button class="btn btn-danger btn-xs">删除</button>
  203 + </a><span> </span><span>&nbsp;</span></td>
  204 + </tr>
  205 +
  206 + </tbody>
  207 + </table>
  208 + </div>
  209 +
  210 + <div class="fixed-table-pagination" style="display: block;">
  211 + <div class="pull-left pagination-detail">
  212 + <span class="pagination-info"
  213 + th:text="'共 '+${ShyActivitylist.total}+' 条记录,每页显示'">共 0 条记录</span>
  214 + <select class="" id="pageSize" name="pageSize"
  215 + onchange="selectPageSize()">
  216 + <option value="10" th:selected="${pageSize==10}">10</option>
  217 + <option value="20" th:selected="${pageSize==20}">20</option>
  218 + <option value="50" th:selected="${pageSize==50}">50</option>
  219 + <option value="100" th:selected="${pageSize==100}">100</option>
  220 + </select> <span class="pagination-info">条记录</span>
  221 + </div>
  222 + <div class="pull-right pagination">
  223 + <ul class="pagination" th:if="${ShyActivitylist.pages>1}">
  224 + <li class="page-pre"><a
  225 + th:href="'javascript:fanye(1);'">‹‹</a></li>
  226 + <li class="page-pre" th:if="${!ShyActivitylist.isFirstPage}"><a
  227 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum-1}+'\');'">‹</a>
  228 + </li>
  229 +
  230 + <li class="page-number" th:if="${ShyActivitylist.pageNum-3>=1}"><a
  231 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum-3}+'\');'"
  232 + th:text="${ShyActivitylist.pageNum-3}">2</a></li>
  233 + <li class="page-number" th:if="${ShyActivitylist.pageNum-2>=1}"><a
  234 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum-2}+'\');'"
  235 + th:text="${ShyActivitylist.pageNum-2}">2</a></li>
  236 + <li class="page-number" th:if="${ShyActivitylist.pageNum-1>=1}"><a
  237 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum-1}+'\');'"
  238 + th:text="${ShyActivitylist.pageNum-1}">2</a></li>
  239 + <li class="page-number active"><a
  240 + href="javaScript:void(0);"
  241 + th:text="${ShyActivitylist.pageNum}">2</a></li>
  242 + <li class="page-number"
  243 + th:if="${ShyActivitylist.pageNum+1<=ShyActivitylist.pages}"><a
  244 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum+1}+'\');'"
  245 + th:text="${ShyActivitylist.pageNum+1}">2</a></li>
  246 + <li class="page-number"
  247 + th:if="${ShyActivitylist.pageNum+2<=ShyActivitylist.pages}"><a
  248 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum+2}+'\');'"
  249 + th:text="${ShyActivitylist.pageNum+2}">2</a></li>
  250 + <li class="page-number"
  251 + th:if="${ShyActivitylist.pageNum+3<=ShyActivitylist.pages}"><a
  252 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum+3}+'\');'"
  253 + th:text="${ShyActivitylist.pageNum+3}">2</a></li>
  254 +
  255 + <li class="page-next" th:if="${!ShyActivitylist.isLastPage}"><a
  256 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pageNum+1}+'\');'">›</a>
  257 + </li>
  258 + <li class="page-next"><a
  259 + th:onclick="'javascript:fanye(\''+${ShyActivitylist.pages}+'\');'">››</a>
  260 + </li>
  261 + </ul>
  262 + </div>
  263 + </div>
  264 + </div>
  265 + </div>
  266 + <div class="clearfix"></div>
  267 + </div>
240 268 </div>
  269 + </div>
241 270 </section>
242 271 </div>
243 272  
244   -<!-- 模态框(Modal) -->
245   -<div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
246   - <div class="modal-dialog">
247   - <div class="modal-content" style="margin-top: 30%;">
248   - <div class="modal-header">
249   - <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
250   - <h4 class="modal-title" id="myModalLabel">编辑邮件消息</h4>
251   - </div>
252   - <div class="modal-body">
253   - <form action="/page/add" method="post" id="editWrite">
254   - <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
255   - <div class="form-group hide">
256   - <label class="control-label col-sm-3" style="font-size: 15px;" >Id:</label>
257   - <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
258   - <input class="form-control" style="width:30%;" type="text" value="" id="id" name="id">
259   - </div>
  273 + <!-- 模态框(Modal) -->
  274 + <div class="modal fade" id="editModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
  275 + aria-hidden="true">
  276 + <div class="modal-dialog">
  277 + <div class="modal-content" style="margin-top: 30%;">
  278 + <div class="modal-header">
  279 + <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
  280 + <h4 class="modal-title" id="myModalLabel">编辑邮件消息</h4>
260 281 </div>
261   - <div class="form-group">
262   - <label class="control-label col-sm-3" style="font-size: 15px;">活动名称:</label>
263   - <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
264   - <input class="form-control" style="width:40%;" type="text" value="" id="email_edit" name="activity">
265   - </div>
  282 + <div class="modal-body">
  283 + <form action="/activity/add" method="post" id="editWrite">
  284 + <input type="text" name="redirect_url" value="" class="hide" id="redirect_url"/>
  285 + <div class="form-group hide">
  286 + <label class="control-label col-sm-3" style="font-size: 15px;">Id:</label>
  287 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  288 + <input class="form-control" style="width:30%;" type="text" value="" id="id" name="id">
  289 + </div>
  290 + </div>
  291 + <div class="form-group">
  292 + <label class="control-label col-sm-3" style="font-size: 15px;">活动名称:</label>
  293 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  294 + <input class="form-control" style="width:40%;" type="text" value="" id="email_edit"
  295 + name="activity">
  296 + </div>
  297 + </div>
  298 +
  299 + <div class="form-group">
  300 + <label class="control-label col-sm-3" style="font-size: 15px;">是否免审:</label>
  301 + <div class="col-sm-9" style="margin-top: -5px;margin-bottom: 20px;">
  302 + <input class="form-control" style="width:40%;" type="text" value="" id="mianshen"
  303 + name="activity">
  304 + </div>
  305 + </div>
  306 +
  307 + </form>
266 308 </div>
267   -
268   -
269   - </form>
270   - </div>
271   - <div class="modal-footer">
272   - <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交</button>
273   - <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
274   - </div>
275   - </div><!-- /.modal-content -->
276   - </div><!-- /.modal-dialog -->
277   -</div>
278   -<!-- /.modal -->
  309 + <div class="modal-footer">
  310 + <button type="button" class="btn btn-primary" onclick="javascript:$('#editWrite').submit();">提交
  311 + </button>
  312 + <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
  313 + </div>
  314 + </div><!-- /.modal-content -->
  315 + </div><!-- /.modal-dialog -->
  316 + </div>
  317 + <!-- /.modal -->
279 318 <script>
280 319 //打开编辑窗口
281   - function edit(Id,email,remark,write_business){
282   - $("#myModalLabel").text("编辑活动名称");
  320 + function edit(Id, email, mianshen, write_business) {
  321 + $("#myModalLabel").text("编辑活动名称");
283 322 $("#id").val(Id);
284 323 $("#email_edit").val(email);
285   - $("#email_edit").attr("readonly","true");
286   - $("#remark_edit").val(remark);
287   - $("#redirect_url").val(location.pathname+location.search);
288   - $(".write_check input").prop("checked",false);
289   - if($.trim(write_business)!=''){
290   - var array = write_business.split(",")
291   - for (var i=0;i<array.length;i++){
292   - $("#write_check_"+array[i]).prop("checked",true);
293   - }
294   - }
  324 + $("#email_edit").attr("readonly", "true");
  325 + $("#mianshen").val(mianshen);
  326 + $("#redirect_url").val(location.pathname + location.search);
  327 + $(".write_check input").prop("checked", false);
  328 + if ($.trim(write_business) != '') {
  329 + var array = write_business.split(",")
  330 + for (var i = 0; i < array.length; i++) {
  331 + $("#write_check_" + array[i]).prop("checked", true);
  332 + }
  333 + }
295 334 $('#editModal').modal('show');
296 335 }
297   -
  336 +
298 337 //打开添加窗口
299   - function add(){
300   - $("#id").val("");
  338 + function add() {
  339 + $("#id").val("");
301 340 $("#email_edit").val("");
302 341 $("#email_edit").removeAttr("readonly");
303 342 $("#remark_edit").val("");
304   - $(".write_check input").prop("checked",false);
305   -
306   - $("#redirect_url").val(location.pathname+location.search);
  343 + $(".write_check input").prop("checked", false);
  344 +
  345 + $("#redirect_url").val(location.pathname + location.search);
307 346 $("#myModalLabel").text("添加活动名称");
308 347 $('#editModal').modal('show');
309 348 }
310 349  
311 350 //删除操作
312   - function deleted(id){
313   - var r = confirm("您确定删除本条内容吗?");
  351 + function deleted(id) {
  352 + var r = confirm("您确定删除本条内容吗?");
314 353 if (r == true) {
315   - $.post("/page/deleted?id=" + id, function (data) {
  354 + $.post("/activity/delete?id=" + id, function (data) {
316 355 if (data.errorCode == 0) {
317 356 alert(data.errorMessage);
318 357 location.href = location.href;
... ... @@ -322,14 +361,14 @@ input:checked + .slider:before {
322 361 })
323 362 }
324 363 }
325   -
326   -
  364 +
  365 +
327 366 //开关的点击事件
328   - $(".slider").on('click',function(e){
329   - var myId=$(this).prop("id");
330   - // var myIndex = $(".slider").index($(this));
331   - var checked=$("#id"+myId).prop("checked");//获取当前状态,下一个状态用!checked表示
332   - $.post("/email/updateState?id=" + myId+"&isEnable="+!checked, function (data) {
  367 + $(".slider").on('click', function (e) {
  368 + var myId = $(this).prop("id");
  369 + // var myIndex = $(".slider").index($(this));
  370 + var checked = $("#id" + myId).prop("checked");//获取当前状态,下一个状态用!checked表示
  371 + $.post("/email/updateState?id=" + myId + "&isEnable=" + !checked, function (data) {
333 372 if (data.errorCode == 0) {
334 373 alert(data.errorMessage);
335 374 location.href = location.href;
... ... @@ -338,71 +377,71 @@ input:checked + .slider:before {
338 377 location.href = location.href;
339 378 }
340 379 })
341   - })
  380 + })
342 381  
343 382 //翻页函数
344 383 function fanye(page) {
345 384 var param = location.search;
346   - if (param.indexOf("page=") != -1) {
347   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  385 + if (param.indexOf("pageNum=") != -1) {
  386 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
348 387 var split = se.split("&");
349 388 var h = "";
350 389 for (var i = 0; i < split.length; i++) {
351 390 var s = split[i];
352   - if (s.indexOf("page=") < 0) h = h + "&" + split[i];
  391 + if (s.indexOf("pageNum=") < 0) h = h + "&" + split[i];
353 392 }
354 393 h = h.substring(1, h.length);
355   - window.location.href = "/email/page?" + h + "&page=" + page;
  394 + window.location.href = "/activity/page?" + h + "&pageNum=" + page;
356 395 } else {
357 396 param = param.substring(1, param.length);
358   - window.location.href = "/email/page?" + param + "&page=" + page;
  397 + window.location.href = "/activity/page?" + param + "&pageNum=" + page;
359 398 }
360 399 }
361   -
  400 +
362 401 //选择每页数量触发函数
363   - function selectPageSize(){
364   - var pageSize=$("#pageSize").val();
365   - var param = location.search;
366   - if (param.indexOf("pageSize=") != -1) {
367   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
368   - var split = se.split("&");
369   - var h = "";
370   - for (var i = 0; i < split.length; i++) {
371   - var s = split[i];
372   - if (s.indexOf("pageSize=") < 0 &&s.indexOf("page=") < 0) h = h + "&" + split[i];
373   - }
374   - h = h.substring(1, h.length);
375   - window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
376   - } else {
377   - var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
378   - var split = se.split("&");
379   - var h = "";
380   - for (var i = 0; i < split.length; i++) {
381   - var s = split[i];
382   - if (s.indexOf("page=") < 0) h = h + "&" + split[i];
383   - }
384   - h = h.substring(1, h.length);
385   - window.location.href = "/email/page?" + h + "&pageSize=" + pageSize;
386   - }
  402 + function selectPageSize() {
  403 + var pageSize = $("#pageSize").val();
  404 + var param = location.search;
  405 + if (param.indexOf("pageSize=") != -1) {
  406 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  407 + var split = se.split("&");
  408 + var h = "";
  409 + for (var i = 0; i < split.length; i++) {
  410 + var s = split[i];
  411 + if (s.indexOf("pageSize=") < 0 && s.indexOf("pageNum=") < 0) h = h + "&" + split[i];
  412 + }
  413 + h = h.substring(1, h.length);
  414 + window.location.href = "/activity/page?" + h + "&pageSize=" + pageSize;
  415 + } else {
  416 + var se = param.replace("?", "");//去掉问号,防止问号和要去掉的参数相连
  417 + var split = se.split("&");
  418 + var h = "";
  419 + for (var i = 0; i < split.length; i++) {
  420 + var s = split[i];
  421 + if (s.indexOf("pageNum=") < 0) h = h + "&" + split[i];
  422 + }
  423 + h = h.substring(1, h.length);
  424 + window.location.href = "/activity/page?" + h + "&pageSize=" + pageSize;
  425 + }
387 426 }
388   -
  427 +
389 428 //搜索
390 429 $('#emailQuery').click(function () {
391   - var email = $("#email_query").val();
392   - var remark = $("#remark_query").val();
393   - var pageSize = $("#pageSize").val();
394   - window.location.href = "/email/page?email=" + email + "&remark=" + remark+ "&pageSize=" + pageSize;
395   - });
396   -
397   - //鼠标回车事件
398   - $(document).keyup(function(event){
399   - if(event.keyCode ==13){
400   - $("#emailQuery").trigger("click");
401   - }
402   - });
  430 + var email = $("#email_query").val();
  431 + var remark = $("#remark_query").val();
  432 + var pageSize = $("#pageSize").val();
  433 + window.location.href = "/activity/page?activity=" + activity + "&exempt_from_trial=" + exempt_from_trial + "&pageSize=" + pageSize;
  434 + });
  435 +
  436 + //鼠标回车事件
  437 + $(document).keyup(function (event) {
  438 + if (event.keyCode == 13) {
  439 + $("#emailQuery").trigger("click");
  440 + }
  441 + });
403 442 </script>
404 443  
405   - <footer th:replace="../templates/common/foot::foot" ></footer>
  444 + <footer th:replace="../templates/common/foot::foot"></footer>
406 445  
407 446  
408 447 <!-- Add the sidebar's background. This div must be placed
... ...