Explorar el Código

Merge branch 'master' of http://47.112.200.206:3000/shenhao/sys

wuwen hace 4 años
padre
commit
77d8d797e8

+ 14 - 6
src/main/java/com/ssj/bean/sys/poster/domain/PosterJoin.java

@@ -14,11 +14,16 @@ public class PosterJoin extends BaseEntity {
     private static final long serialVersionUID = 1L;
 
     private String name;
-    
-    private String phone;
+
+	/**
+	 * 联系人,如果有2个联系人需要换行显示 用/n
+	 */
+	private String phone;
     
     private String logoImg;
-    
+
+    private String logoImg2;
+
     private String qrcodeImg1;
     
     private String qrcodeImg2;
@@ -103,8 +108,11 @@ public class PosterJoin extends BaseEntity {
 		this.address = address;
 	}
 
+	public String getLogoImg2() {
+		return logoImg2;
+	}
 
-    
-    
-    
+	public void setLogoImg2(String logoImg2) {
+		this.logoImg2 = logoImg2;
+	}
 }

+ 88 - 25
src/main/java/com/ssj/bean/sys/poster/domain/PosterTemplate.java

@@ -12,32 +12,65 @@ import com.ssj.bean.common.framework.core.domain.BaseEntity;
 public class PosterTemplate extends BaseEntity {
 	
     private static final long serialVersionUID = 1L;
-    
-    private String id;
-    
-    private String backImg;
-    
-    private String logoPosition;
-    
-    private String numberPosition;
-    
-    private String addressPosition;
-    
-    private String qrcodePosition1;
-    
+
+	/**
+	 * 背景模板
+	 */
+	private String backImg;
+
+	/**
+	 * 二维码1的位置 x;y
+	 */
+	private String logoPosition;
+	/**
+	 * 二维码2的坐标信息 x;y
+	 */
+    private String logoPosition2;
+
+	/**
+	 * 联系方式的坐标信息x;y;rightx
+	 */
+	private String numberPosition;
+
+	/**
+	 * 地址坐标信息x;y;rightx
+	 */
+	private String addressPosition;
+
+	/**
+	 * 二维码大小坐标信息w;h;x;y
+	 */
+	private String qrcodePosition1;
+
+	/**
+	 * 二维码大小坐标信息w;h;x;y
+	 */
     private String qrcodePosition2;
-    
-    private Integer status;
-    
-    private Date createTime;
 
-	public String getId() {
-		return id;
-	}
+	/**
+	 * 状态
+	 */
+	private Integer status;
 
-	public void setId(String id) {
-		this.id = id;
-	}
+	/**
+	 * 创建时间
+	 */
+	private Date createTime;
+
+	/**
+	 * 字体大小
+	 */
+	private int fontSize;
+
+	/**
+	 * rgba 四个数字用;分割
+	 */
+	private String fontColor;
+
+	/**
+	 * 海报宽度
+	 */
+	private int backLength;
 
 	public String getBackImg() {
 		return backImg;
@@ -102,6 +135,36 @@ public class PosterTemplate extends BaseEntity {
 	public void setAddressPosition(String addressPosition) {
 		this.addressPosition = addressPosition;
 	}
-   
-    
+
+	public String getLogoPosition2() {
+		return logoPosition2;
+	}
+
+	public void setLogoPosition2(String logoPosition2) {
+		this.logoPosition2 = logoPosition2;
+	}
+
+	public int getFontSize() {
+		return fontSize;
+	}
+
+	public void setFontSize(int fontSize) {
+		this.fontSize = fontSize;
+	}
+
+	public String getFontColor() {
+		return fontColor;
+	}
+
+	public void setFontColor(String fontColor) {
+		this.fontColor = fontColor;
+	}
+
+	public int getBackLength() {
+		return backLength;
+	}
+
+	public void setBackLength(int backLength) {
+		this.backLength = backLength;
+	}
 }

+ 58 - 22
src/main/java/com/ssj/service/sys/poster/service/impl/PosterJoinServiceImpl.java

@@ -10,11 +10,13 @@ import java.awt.image.BufferedImage;
 import java.io.File;
 import java.util.Date;
 import java.util.Map;
+import java.util.Objects;
 
 import javax.imageio.ImageIO;
 
 import com.ssj.bean.sys.poster.domain.PosterActivityJoin;
 import com.ssj.dao.sys.poster.dao.*;
+import com.ssj.framework.weixin.news.bean.Template;
 import org.apache.commons.lang3.StringUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -97,22 +99,24 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 	public static void main(String[] args) {
 		
 		PosterTemplate posterTemplate=new PosterTemplate();
-		posterTemplate.setBackImg("1.png");
-		posterTemplate.setAddressPosition("856");
-		posterTemplate.setNumberPosition("856");
-		posterTemplate.setLogoPosition("30;34");
-		posterTemplate.setQrcodePosition1("123;123;77;505");
-		posterTemplate.setQrcodePosition2("123;123;300;505");
+		posterTemplate.setBackImg("3-1.png");
+		posterTemplate.setAddressPosition("307;1622;150");
+		posterTemplate.setNumberPosition("307;1580;150");
+		posterTemplate.setLogoPosition("64;63");
+		posterTemplate.setQrcodePosition1("155;155;110;1511");
+		posterTemplate.setFontColor("59;63;66;1");
+		posterTemplate.setFontSize(28);
+		posterTemplate.setBackLength(1000);
+		//posterTemplate.setQrcodePosition2("123;123;300;505");
 
 		PosterJoin posterJoin=new PosterJoin();
-		posterJoin.setLogoImg("2.png");
-		posterJoin.setQrcodeImg1("3.png");
-		posterJoin.setQrcodeImg2("3.png");
+		posterJoin.setLogoImg("logo.png");
+		posterJoin.setQrcodeImg1("qr1.png");
 		posterJoin.setName("活动");
-		posterJoin.setPhone("联系人:吴老师 13265096161");
-		posterJoin.setAddress("地址:佛山市南海区桂城融和路号号中铁建水岸花园号号号铺铺铺");//33个字
+		posterJoin.setPhone("吴老师 13265096161");
+		posterJoin.setAddress("广州市海珠区罗马家园中盛路拜庭二期04-06 商铺");
 
-		String url=runGeneratePosterImg(posterTemplate, posterJoin,"");
+		String url=runGeneratePosterImg(posterTemplate, posterJoin,"测试");
 		System.out.println(url);
 
 
@@ -138,6 +142,13 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 	    	String[] logoPositions=posterTemplate.getLogoPosition().split(";");
 	    	BufferedImage logoImage = ImageIO.read(new File(savePath+posterJoin.getLogoImg()));
 	    	BufferedImage target_template=ImgBean.modifyImagetogeter(logoImage, source_template,Integer.parseInt(logoPositions[0]),Integer.parseInt(logoPositions[1]));
+
+	    	if(StringUtils.isNotEmpty(posterTemplate.getLogoPosition2())){
+				//合成logo2
+				logoImage = ImageIO.read(new File(savePath+posterJoin.getLogoImg2()));
+				target_template=ImgBean.modifyImagetogeter(logoImage, target_template,Integer.parseInt(logoPositions[2]),Integer.parseInt(logoPositions[3]));
+			}
+
 	    	
 	    	//合成二维码1
 	    	String[] qrcodePositions=posterTemplate.getQrcodePosition1().split(";");
@@ -181,21 +192,46 @@ public class PosterJoinServiceImpl extends BaseServiceImpl<PosterJoin, String> i
 				File code1File2 = new File(code);
 				code1File2.delete();
 	    	}
-	    	
-	    	//合成联系人
+
+	    	//设置字体大小
+			int fontSize = posterTemplate.getFontSize();
+            Font font = new Font("黑体", Font.BOLD, fontSize);
+
+	    	//String[] colorRgba = posterTemplate.getFontColor().split(";");
+			//Color color = new Color(Integer.parseInt(colorRgba[0]),Integer.parseInt(colorRgba[1]) ,Integer.parseInt(colorRgba[2]) ,Integer.parseInt(colorRgba[3]));
+            Color color = new Color(0,0,0);
+	    	//合成联系人 x;y
 	    	String[] numberPositions=posterTemplate.getNumberPosition().split(";");
-	    	ImgBean.modifyImage(target_template,"联系人:"+posterJoin.getPhone(),115,Integer.parseInt(numberPositions[0]),new Color(240,240,240),new Font("黑体", Font.PLAIN, 19));
+	    	String phone = "联系人:"+posterJoin.getPhone();
+	    	int leftX = Integer.parseInt(numberPositions[0]);
+	    	int topY = Integer.parseInt(numberPositions[1]);
+	    	if(posterJoin.getPhone().contains("/n")){
+	    		String[] phones = phone.split("/n");
+				ImgBean.modifyImage(target_template,phones[0],leftX,topY,color,font);
+				phone = phones[1];
+				leftX = leftX+fontSize*4;
+				topY = topY+fontSize+2;
+			}
+            //ImgBean.modifyImage(target_template,"联系人:"+posterJoin.getPhone(),leftX,topY,new Color(240,240,240),new Font("黑体", Font.PLAIN, 28));
+	    	ImgBean.modifyImage(target_template,phone,leftX,topY,color,font);
 	    	
-	    	//合成地址
+	    	//合成地址 x;y;rx
 	    	//长500的,最多33个字,500/33=15px  (33-Address.le)/2=?
 	    	String[] addressPositions=posterTemplate.getAddressPosition().split(";");
-	    	int left=0;
-	    	if(posterJoin.getAddress().length()<33) {
-	    		left=(33-posterJoin.getAddress().length())/2*15;
-	    	}
-	    	ImgBean.modifyImage(target_template,"地址:"+posterJoin.getAddress(),left,Integer.parseInt(addressPositions[0]),new Color(220,220,220),new Font("黑体", Font.PLAIN, 15));
+            int leftAddress = Integer.parseInt(addressPositions[0]);
+            int topAddress = Integer.parseInt(addressPositions[1]);
+            int rightAddress = Integer.parseInt(addressPositions[2]);
+	    	int maxNum = (posterTemplate.getBackLength()-leftAddress-rightAddress)/fontSize;
+	    	String address = "地址:"+posterJoin.getAddress();
+	    	//换行
+	    	if(address.length()>maxNum){
+                ImgBean.modifyImage(target_template,address.substring(0,maxNum),leftAddress,topAddress,color,font);
+                address = address.substring(maxNum);
+                leftAddress = leftAddress+fontSize*3;
+                topAddress = topAddress+fontSize+2;
+            }
+	    	ImgBean.modifyImage(target_template,address,leftAddress,topAddress,color,font);
 
-			//System.out.println("step--生成海报-->ImgBean.writeImageLocal--"+target_path);
 	    	//生成海报
 	    	ImgBean.writeImageLocal(target_path,  source_template);
 	    	

+ 2 - 3
src/main/java/com/ssj/sys/interceptor/LoginInterceptor.java

@@ -184,10 +184,9 @@ public class LoginInterceptor extends HandlerInterceptorAdapter{
 
     public static void initModelAndView(HttpServletRequest request, ModelAndView modelAndView) throws Exception {
         //modelAndView.addObject("sysUrl", "https://sys.sharingschool.com");
-        modelAndView.addObject("sysUrl", PropertiesUtil.getValue("sys_url"));
+        modelAndView.addObject("sysUrl", PropertiesUtil.getValue("gz_sys_url"));
        // modelAndView.addObject("sysUrl", "http://127.0.0.1:8080");
-        modelAndView.addObject("imgUrl", PropertiesUtil.getValue("STATIC_FILE_URL"));
-
+        modelAndView.addObject("imgUrl", PropertiesUtil.getValue("GZ_STATIC_FILE_URL"));
     }
 
 

+ 117 - 0
src/main/resources/templates/sys/common/imgUpload_four.html

@@ -0,0 +1,117 @@
+
+<!-- 
+	data-bindelem:
+		绑定元素
+		
+	data-filepaths:
+		回显数据图片路径	
+		
+	data-type:
+		1:图片上传
+		2:文件上传
+		
+	data-maxnum:
+		可最大上传的数量	
+		
+		
+
+ -->
+
+
+<div id="pluguploaddiv1_four" style="display: none">
+	<span class="layui-upload" >
+	  <button type="button" class="layui-btn " id="pluguploadbutton1_four"><i class="layui-icon">&#xe60d;</i>上传图片 <i style="margin-left: 10px;display: none" class="layui-icon layui-icon-loading layui-icon layui-anim layui-anim-rotate layui-anim-loop"></i></button>
+	  </span>
+	 <span class="layui-upload-list" id="pluguploadimg1_four"></span>
+</div>
+
+
+<script>
+var sysUrl_four="[[${sysUrl}]]";
+var imgUrl_four="[[${imgUrl}]]";
+var type_four=$("#pluguploadid_four").data("type");
+var width_four=$("#pluguploadid_four_four").data("imgwidth");
+var height_four=$("#pluguploadid_four").data("imgheight");
+var maxnum_four=$("#pluguploadid_four").data("maxnum");
+var bindelem_four=$("#pluguploadid_four").data("bindelem");
+var filePaths_four=$("#pluguploadid_four").data("filepaths");
+
+if(type_four==undefined || type_four=='undefined' || type_four==null || type_four==''){
+	type_four=1;
+}
+if(maxnum_four==undefined || maxnum_four=='undefined' || maxnum_four==null || maxnum_four==''){
+	maxnum_four=10;
+}
+if(bindelem_four==undefined || bindelem_four=='undefined' || bindelem_four==null || bindelem_four==''){
+	bindelem_four=null;
+}
+if(filePaths_four==undefined || filePaths_four=='undefined' || filePaths_four==null || filePaths_four==''){
+	filePaths_four=null;
+}
+
+layui.use('upload', function(){
+  var $ = layui.jquery
+  ,upload = layui.upload;
+  
+  if(bindelem_four!=null && filePaths_four!=null){
+		$(bindelem_four).val(filePaths_four);
+		var fps=filePaths_four.split(";");
+		for (var i = 0; i < fps.length; i++) {
+		 $('#pluguploadimg'+type+'_four').append('<span class="pluguploadimgcss"  style="width: 100px;height:100px"><i onclick="deletepulgimg_four(this,\''+fps[i]+'\')" class="layui-icon layui-icon-close g_icon"></i><img onclick="openpulgimg(this)" src="'+ imgUrl+fps[i] +'"  style="width:100%"  class="layui-upload-img "></span>') 
+		}
+	}
+	$("#pluguploaddiv"+type+"_four").show();
+  
+  //普通图片上传
+  var uploadInst = upload.render({
+    elem: '#pluguploadbutton1_four'
+    ,url: '[[${sysUrl}]]/file/uploads'
+    ,before: function(obj){
+      $(".layui-icon-loading").show();
+      obj.preview(function(index, file, result){//预读本地文件示例,不支持ie8
+    	
+      });
+    },done: function(res){
+      $(".layui-icon-loading").hide();
+      if($(bindelem_four).val().split(";").length>=maxnum_four){
+		  return layer.msg('上传文件已超过最大值');
+	  }
+      if(res.code == '000'){
+    	  return layer.msg('上传失败,刷新后重试!');
+      }
+      layer.msg('上传成功');
+      if(res != null && res != ""){
+		 var obj = res;
+		 var filePath = obj.data.pics[0].filePath;
+		 var fileCode = obj.data.pics[0].fileCode;
+		 var fileExt = obj.data.pics[0].fileExts;
+		 var id = obj.data.pics[0].id;
+		 var name = obj.data.pics[0].name;
+		 var fileWidth = obj.data.pics[0].fileWidth;
+		 var fileHeight = obj.data.pics[0].fileHeight;
+		 var fileName = obj.data.pics[0].fileName;
+		 var fileSize = obj.data.pics[0].fileSize;
+		 var fileThumPath = obj.data.pics[0].fileThumPath;
+		 $('#pluguploadimg1_four').append('<span class="pluguploadimgcss"  style="width: 100px;height:100px"><i onclick="deletepulgimg_four(this,\''+filePath+'\')" class="layui-icon layui-icon-close g_icon"></i><img onclick="openpulgimg(this)" src="'+ fileThumPath +'"  style="width:100%"  class="layui-upload-img "></span>') //图片链接(base64)
+		 if(bindelem_four!=null){
+			$(bindelem_four).val($(bindelem_four).val()!=''? $(bindelem_four).val()+";"+filePath : filePath);
+		 }
+	   }
+    },error: function(){
+    	  $(".layui-icon-loading").hide();
+    	  return layer.msg('上传失败,刷新后重试!');
+    }
+  });
+});
+
+function deletepulgimg_four(obj,filePath){
+	$(obj).parent().remove();
+	$(bindelem_four).val($(bindelem_four).val().replace(filePath+";",""));
+	$(bindelem_four).val($(bindelem_four).val().replace(";"+filePath,""));
+	$(bindelem_four).val($(bindelem_four).val().replace(filePath,""));
+}
+
+
+
+
+</script>

+ 0 - 1
src/main/resources/templates/sys/poster/activity_join_list.html

@@ -100,7 +100,6 @@
 					<img th:if="${item.qrcode_img2!=null && item.qrcode_img2!=''}" style="width: 50px;height: 50px;" th:src="${imgUrl+item.qrcode_img2}">
 				</td>
 				<td >
-					<a href="javascript:;" th:onclick="'edit(\''+${item.id}+'\')'" >编辑</a>
 					<a th:href="${imgUrl+item.poster_img}" download  class="tablelink">下载</a>
 					<a th:href="${'javascript:joinDel(''' + item.id + ''')'}"  class="tablelink">删除</a>
 				</td>

+ 6 - 0
src/main/resources/templates/sys/poster/join_edit.html

@@ -103,6 +103,12 @@ dtext{
 				<input type="hidden" id="logoImg" th:data-path="${posterJoin.logoImg}" />
 				<plug id="pluguploadid" th:include="sys/common/imgUpload"  th:inline="javascript"  data-bindelem="#logoImg" th:data-filepaths="${posterJoin.logoImg}"  data-type="1" data-maxnum="2"  \>
 			</li>
+
+			<li style="margin-bottom:3px">
+				<label>机构LOGO2:<b>*</b></label>
+				<input type="hidden" id="logoImg2" th:data-path="${posterJoin.logoImg2}" />
+				<plug id="pluguploadid_four" th:include="sys/common/imgUpload_four"  th:inline="javascript"  data-bindelem="#logoImg" th:data-filepaths="${posterJoin.logoImg2}"  data-type="1" data-maxnum="2"  \>
+			</li>
 			
 			<li style="margin-bottom:3px">
 				<label>机构二维码1:<b>*</b></label>

+ 173 - 0
src/main/resources/templates/sys/poster/template_edit.html

@@ -0,0 +1,173 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/city.json.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/citySetMe_V.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/js/city/Popt.js}"></script>
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+ <style type="text/css">
+   body{min-width:180px;}
+       .select1{
+   		    width:100%;
+		    height: 32px;
+		    line-height: 32px;
+		    border-top: solid 1px #a7b5bc;
+		    border-left: solid 1px #a7b5bc;
+		    border-right: solid 1px #ced9df;
+		    border-bottom: solid 1px #ced9df;
+		    opacity:1;
+	        margin-bottom: 10px;
+    	}
+    	.btn{
+    	  width: 100px;
+    	}
+     label.control-label-error {color: Red;}	
+     
+._citys {     background-color: whitesmoke;width: 450px; display: inline-block; border: 2px solid #eee; padding: 5px; position: relative; }
+._citys span { color: #05920a; height: 15px; width: 15px; line-height: 15px; text-align: center; border-radius: 3px; position: absolute; right: 10px; top: 10px; border: 1px solid #05920a; cursor: pointer; }
+._citys0 { width: 95%; height: 34px; line-height: 34px; display: inline-block; border-bottom: 2px solid #05920a; padding: 0px 5px; font-size:14px; font-weight:bold; margin-left:6px; }
+._citys0 li { display: inline-block; line-height: 34px; font-size: 15px; color: #888; width: 80px; text-align: center; cursor: pointer; }
+._citys1 { width: 100%; display: inline-block; padding: 10px 0; }
+._citys1 a { width: 83px; height: 35px; display: inline-block; background-color: #f5f5f5; color: #666; margin-left: 6px; margin-top: 3px; line-height: 35px; text-align: center; cursor: pointer; font-size: 12px; border-radius: 5px; overflow: hidden; }
+._citys1 a:hover { color: #fff; background-color: #05920a; }
+.AreaS { background-color: #05920a !important; color: #fff !important; }
+#school{
+	margin-left: 110px;
+	padding-bottom: 10px;
+}  
+#school span{
+  	min-width: 25%;
+    float: left;
+    margin-bottom: 10px;
+}
+.joinseachform li{
+	width: 50%;
+	margin-right: 0px;
+	padding-right: 0px;
+}
+
+.schoolseachform li{
+	width: 50%;
+	margin-right: 0px;
+	padding-right: 0px;
+}    
+
+dtext{
+	color: red;
+	cursor: pointer;
+}
+.forminfo li label{
+	text-align: right;
+	padding-right: 10px
+}
+#posterimgs img{
+	width: 120px;
+  
+    margin: 10px;
+}
+
+.imgred{
+  border: 1px solid red;
+}
+
+.imgfff{
+  border: 1px solid #fff;
+}
+  
+</style>
+<body>
+<div class="formbody">
+		<ul class="forminfo">
+			<input type="hidden" id="id" class="dfinput fl" name="id" th:value="${posterActivity.id}"/>
+			
+			<li>
+				<label>活动名称:	<b>*</b></label>
+				<input type="text" id="name" class="dfinput fl" name="name" th:value="${posterActivity.name}" />
+			</li>
+			
+			<li style="margin-bottom:3px">
+				<label>海报模板:<b></b></label>
+				<div id="posterimgs">
+					<img class="imgfff" th:each="item:${templates}" th:data-id="${item.id}" th:src="${imgUrl+item.backImg}">
+				</div>
+			</li>
+			
+			<li style="padding-top: 20px">
+				<label>&nbsp;</label>
+				<button type="submit" onclick="save();" class="btn">提交</button>
+				<button type="button" class="btn" onclick="closeWin();">取消</button>
+			</li>
+			
+		</ul>
+			
+</div>
+
+</body>
+<script type="text/javascript">
+
+
+$(function (){
+     $('#posterimgs img').click(function() {
+    	 // $('#posterimgs img').removeClass('imgred');
+    	 // $('#posterimgs img').addClass('imgfff');
+		 if($(this).hasClass("imgfff")){
+			 $(this).removeClass('imgfff');
+			 $(this).addClass('imgred');
+		 }else{
+			 $(this).removeClass('imgred');
+			 $(this).addClass('imgfff');
+		 }
+
+     }); 
+})
+
+function  closeWin() {
+	parent.layer.close(parent.layer.getFrameIndex(window.name));
+}
+
+function save(){
+	
+	if($("#name").val()==''){
+		parent.layer.msg("活动名称不能为空",{icon:11});
+		return
+	}
+	var templateId="";
+	$('.imgred').each(function(i,n){
+		templateId=templateId+$(n).data("id")+",";
+	});
+	if(templateId.endsWith(",")){
+		templateId = templateId.substr(0,templateId.length-1);
+	}
+	console.log("templateId--->"+templateId);
+	if(templateId=='' || templateId==undefined || templateId=='undefined'){
+		parent.layer.msg("活动模板不能为空",{icon:11});
+		return
+	}
+	parent.layer.confirm("确定保存活动信息?", {
+		icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+	}, function(){
+		var url="[[${sysUrl}]]/sys/poster/activity/save";
+		var params ={
+			'id' : $("#id").val(),
+            'name' : $("#name").val(),
+            'templateId' : templateId,
+        };
+		$.post(url,params,function(data){
+			if(data.meta.success){
+				parent.layer.msg("保存成功",{icon:1});
+				parent.location.reload();
+				parent.layer.close(parent.layer.getFrameIndex(window.name));
+			}else{
+				parent.layer.msg(data.meta.message,{icon:11});
+			}
+		});
+	});
+}
+
+
+
+</script>
+</html>

+ 154 - 0
src/main/resources/templates/sys/poster/template_list.html

@@ -0,0 +1,154 @@
+<html xmlns:th="http://www.thymeleaf.org">
+<head>
+<title>私塾家</title>
+<script th:include="sys/common/metaCSS" th:remove="tag"></script> 
+<script th:include="sys/common/metaJS" th:remove="tag"></script> 
+<script src="sys/js/My97DatePicker/WdatePicker.js" th:src="@{/static/sys/js/My97DatePicker/WdatePicker.js}"></script>
+</head>
+<style>
+	.tablelink{margin-right:10px;}
+	.stylecss{
+	      color: red;
+	}
+	.select_width{
+	     width: 220px;
+	}
+	.date_width{
+	     width: 150px;
+	}
+	
+	.tablelist th,td{
+		white-space: nowrap;
+		text-overflow: ellipsis;
+		overflow: hidden;
+	}
+	.tablelist td a{
+    	text-decoration: underline;
+	}
+	img{
+		margin-left: 3px;
+	}
+</style>
+<body>
+<div class="place">
+	<span>位置:</span>
+	<ul class="placeul">
+		<li><a href="#">活动海报</a></li>
+		<li><a href="#">活动海报模板管理</a></li>
+	</ul>
+</div>
+<div class="rightinfo">
+	<form id="seachform" th:action="@{/sys/poster/template/list.html}" method="post">
+	<input type="hidden" name="pageSize" id="pageSize" value="10" />
+	<ul class="seachform">
+			<li>
+			 <label>活动名称</label>
+			  <input name="name" type="text" class="scinput" th:value="${search.name}"  />
+		    </li>
+			<li>
+				<input type="button" class="scbtn" value="查询" />
+			</li>
+			<li>
+				<ul class="toolbar">
+					<a href="javascript:;" onclick="exportAll()">
+						<input type="button" class="scbtn" value="导出" />
+					</a>
+				</ul>
+				<ul class="toolbar">
+					<a href="javascript:;" onclick="edit('')">
+						<li class="click"><span><img th:src="@{/static/sys/images/t01.png}"></span>新增活动</li>
+					</a>
+				</ul>
+			</li>
+			
+	</ul>
+	</form> 
+
+	<table class="tablelist">
+		<thead>
+		    <tr>
+		    	<th style="width: 50px;">序号</th>
+		    	<th >活动名称</th>
+		    	<th >海报模板 </th>
+		    	<th >创建时间</th>
+		    	<th >份数</th>
+		    	<th >操作 </th>
+		    </tr> 
+		</thead>
+		<tbody>
+			<tr th:each="item:${list}" >
+				<td th:text="${itemStat.count+((page.pageNo-1)*page.pageSize) }"></td>
+				<td th:title="${item.name}" th:text="${item.name}"></td>
+				<td>
+					<img th:each="image:${#strings.listSplit(item.back_img,',')}" style="width: 50px;height: 50px;" th:src="${imgUrl+image}">
+				</td>
+				<td th:text="${item.create_time}"></td>
+				<td th:text="${item.count}"></td>
+				<td >
+					<a style="color: red" th:href="${'javascript:activityDel(''' + item.id + ''')'}"  class="tablelink">删除活动</a>
+					&nbsp;
+					<a th:href="@{/sys/poster/activityJoin/list.html(id=${item.id})}">
+						查看明细
+					</a>
+					
+					
+				</td>
+			</tr>
+		</tbody>
+	</table>
+
+	<!-- 分页 -->
+	<div class="pagin">
+    	<div class="message">共<i class="blue">[[${page.rowCnt}]]</i>条记录,当前显示第&nbsp;<i class="blue">[[${page.pageNo }]]&nbsp;</i>页</div>
+    	<div th:utext='${listNavigatHtml}' th:remove="tag" ></div>
+   	</div>
+</div>
+</body>
+
+<script type="text/javascript">
+	function edit(id){
+		var title="添加活动";
+		if(id!=null && id!='' && id!=undefined){
+			title="编辑活动";
+		}
+		parent.layer.open({
+		    type: 2,
+		    title: title,
+		    closeBtn: 1, //不显示关闭按钮
+		    shift: 0.8,
+		    offset: '100px',
+		    area: ['50%', '60%'],
+		    content: '[[${sysUrl}]]/sys/poster/activity/edit.html?id='+id
+		});
+	}
+	
+	function activityDel(id){
+		parent.layer.confirm("您确定要删除活动?", {
+			icon: 4, btn: ['确定','关闭'],offset: '100px' //按钮
+		}, function(){
+			var url="[[${sysUrl}]]/sys/poster/activity/del?id="+id;
+			var params ={};
+			$.post(url,params,function(data){
+				if(data.meta.success){
+					parent.layer.msg("删除成功",{icon:1});
+					location.reload();
+				}else{
+					parent.layer.msg(data.meta.message,{icon:11});
+				}
+			});
+		});
+	}
+	function exportAll() {
+		document.getElementById("seachform").action = "[[${sysUrl}]]/sys/poster/exportDetail";
+		$("#seachform").submit();
+		window.setTimeout(function(){
+			document.getElementById("seachform").action = "[[${sysUrl}]]/sys/poster/activity/list.html";
+		},3000);
+	}
+	
+	
+	
+	
+</script>
+
+</html>