Explorar o código

Merge branch 'develop' into bin2107

bin2107 %!s(int64=5) %!d(string=hai) anos
pai
achega
7be8e1faeb

+ 6 - 0
src/main/java/com/style24/persistence/domain/Review.java

@@ -100,6 +100,12 @@ public class Review extends TscBaseDomain {
 	private String itemNm;
 	private String colorNm;	
 	
+	
+
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] orgFileNmArr;
+	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
+	private String[] sysFileNmArr;
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)
 	private String[] itemNmArr;		// 옵션코드
 	@JsonFormat(with = JsonFormat.Feature.ACCEPT_SINGLE_VALUE_AS_ARRAY)

+ 10 - 2
src/main/java/com/style24/persistence/mybatis/shop/TsfPlanning.xml

@@ -17,7 +17,15 @@
 	<!-- 기획전 카테고리 목록 -->
 	<select id="getPlanningCategoryList" parameterType="Plan" resultType="Plan">
 		/* TsfPlanning.getPlanningCategoryList */
-		SELECT PL.CATE_NO             /*카테고리번호*/
+		SELECT C.CATE1_NO AS CATE_NO            /*카테고리번호*/
+		     , C.CATE1_NM AS CATE_NM /*카테고리명*/
+		FROM TB_CATE1 C
+		WHERE 1=1
+		AND    C.SITE_CD = #{siteCd}
+		AND    C.CATE_GB = 'G032_101' /*BYITEM*/
+		AND    C.CATE_TYPE = 'G031_10' /*상품카테고리*/
+		AND    C.DISP_YN = 'Y' /*전시하는 카테고리*/
+<!-- 		SELECT PL.CATE_NO             /*카테고리번호*/
 		     , C1.CATE1_NM AS CATE_NM /*카테고리명*/
 		FROM   TB_PLAN P
 		     , TB_PLAN_CATE PL
@@ -37,7 +45,7 @@
 		AND    C1.CATE_GB = 'G032_101' /*BYITEM*/
 		AND    C1.CATE_TYPE = 'G031_10' /*상품카테고리*/
 		AND    C1.DISP_YN = 'Y' /*전시하는 카테고리*/
-		ORDER  BY C1.DISP_ORD
+		ORDER  BY C1.DISP_ORD -->
 	</select>
 	
 	<select id="getPlanAllCount" resultType="int" parameterType="Plan">

+ 1 - 1
src/main/java/com/style24/persistence/mybatis/shop/TsfReview.xml

@@ -1007,7 +1007,7 @@
 		SET R.DEL_YN = 'Y'
 		WHERE 1=1
  		AND R.REVIEW_SQ = #{reviewSq}
- 		AND R.ADM_RPL IS NULL
+ 		-- AND R.ADM_RPL IS NULL
  		AND R.CUST_NO = #{custNo}
 	</update>
 	

+ 24 - 8
src/main/webapp/WEB-INF/views/web/mypage/MypageReviewCreateFormWeb.html

@@ -341,8 +341,8 @@
 														<!-- 이미지첨부 -->
 														<div class="form_field">
 															<div class="imgUpload">
-																<label for="fileAdd" class="fileAdd">첫번째업로드</label>
-																<input type="file" id="fileAdd" name="files[]">
+																<label for="fileAdd" class="fileAdd" id="fileAdd_reply">첫번째업로드</label>
+																<input type="file" id="fileAdd" name="files">
 															</div>
 														</div>
 														<!-- //이미지첨부 -->
@@ -551,10 +551,25 @@ $('#reviewContent').keyup(function (e){
 $('#fileAdd').on('change', function() { fnChooseFile(this); });
 
 var fnChooseFile = function(obj) {
+	var picLength = $(".pics").length;
+	
 	// multiple 속성이 있으면 files에는 다수의 객체가 할당됨
 	var file = obj.files[0];
-	
-	if (!gagajf.isNull(file.size) && Number(file.size) > 10 * 1000000) {
+
+	if (!gagajf.isNull(file.name)) {
+		var extension = "\.(jpg|jpeg|png)$";
+		if (!(new RegExp(extension, "i")).test(file.name)) {
+			mcxDialog.alertC('이미지는 [jpg, jpeg, png] 파일만 가능합니다.', {
+				sureBtnText: "확인",
+				sureBtnClick: function() {
+					$(obj).parent('.imgUpload').find('.removes').trigger('click');
+				}
+			});
+			return false;
+		}
+	}
+	// 이거 왜 안먹히지 
+	if (!gagajf.isNull(file.size) && Number(file.size) > (10 * 1000000)) {
 		mcxDialog.alertC('이미지는 최대 10MB 이하 파일만 가능합니다.', {
 			sureBtnText: "확인",
 			sureBtnClick: function() {
@@ -565,16 +580,17 @@ var fnChooseFile = function(obj) {
 	}
 	
 	// 파일 업로드
-	gagajf.ajaxFileUpload('/common/file/upload?subDir=/review'
+	 gagajf.ajaxFileUpload('/common/file/upload?subDir=/review'
 			, file
 			, function(result) {
 				// 업로드한 파일명 설정
-				$('input[name=' + obj.name + 'OrgFileNm]').val(result.oldFileName);
-				$('input[name=' + obj.name + 'SysFileNm]').val(result.newFileName);
+				$(".pics").children().eq(0).append("<input type='hidden' name='orgFileNmArr' id='orgFileNm"+(picLength+1)+"' value='"+result.oldFileName+"'>");
+				$(".pics").children().eq(0).append("<input type='hidden' name='sysFileNmArr' id='sysFileNm"+(picLength+1)+"' value='"+result.newFileName+"'>");
 			}
-	);
+	); 
 }
 
+
 $(document).ready(function() {
 	if (reviewList.goodsType == 'G056_S') {
 		$.each(reviewList.colorNmArr, function(index, option) {

+ 37 - 38
src/main/webapp/WEB-INF/views/web/planning/PlanningDetailFormWeb.html

@@ -551,7 +551,6 @@ if(goods4.length>0){
 			html += '<div class="cont_head">';
 			html += '<div>';
 			html += '        <h4>';
-			console.log(template[i].linkOpenGb );
 			if (template[i].linkUrl != null && template[i].linkUrl != '') { /* 링크 변경 예정 */
 				if (template[i].linkOpenGb == "M") { //본창
 					html += '        <a href="http://'+template[i].linkUrl+'" target="_self">'+template[i].title+' <i class="ico_arrow"></i></a>';
@@ -798,7 +797,7 @@ var fnSearchCallback = function (result) {
 				 html += '			<span class="date">'+item.entryDt+'</span>';
 				 html += '		</div>';
 				 html += '		<div class="cmt_cont">';
-				 html += '			<div class="img_wrap clear">';
+				 html += '			<div class="img_wrap clear" onclick="fnImgAttach(this)">';
 				 if (result.replyAttachList.length>0) {
 					for (var i = 0; i < result.replyAttachList.length; i++) {
 						if(result.replyAttachList[i].planEntrySq == item.planEntrySq){
@@ -930,12 +929,47 @@ var fnReplySave = function() {
 		gagajf.ajaxJsonSubmit('/planning/reply/save', jsonData,function() {
 			ajaxReplyList();	
 			$('#replyText').val('');
+			$('.pics').remove();
 			});
 		}
 	})
 }
 
 
+var fnImgAttach = function (obj) {
+	 $("#thumbImgPop .swiper-wrapper").empty();
+	//var popSlideIndex = $(obj).find('span').length -1;
+	var popSlideIndex = 0;
+	contactPopSwiper.slideTo(popSlideIndex);
+	contactPopSwiper.update();
+	
+	var contactImglength = $(obj).find('span').length;
+	var popImgHtml = "";
+	for (i = 0; i < contactImglength; i++) {
+		
+		var contactImgSrc =$(obj).find('img').eq(i).attr('src');
+		popImgHtml += "<div class='swiper-slide'><div class='pop_img' style='background-image:url("+ contactImgSrc +")'></div></div>";
+	}
+
+	$("#thumbImgPop .swiper-wrapper").append(popImgHtml);
+	$('#thumbImgPop').modal("show");
+	
+	return false;
+}
+
+/* SLIDE - 댓글 이미지 팝업 */
+var contactPopSwiper = new Swiper('.thumb_img_pop .swiper-container', {
+	navigation: {
+		nextEl: '.thumb_img_pop .swiper-button-next',
+		prevEl: '.thumb_img_pop .swiper-button-prev',
+	},
+	pagination: {
+		el: '.thumb_img_pop .swiper-pagination',
+		clickable: true,
+	},
+	observer:true,
+	observeParents: true,
+});				
 
 
 $(document).ready( function() {
@@ -1066,6 +1100,7 @@ $(document).ready( function() {
 			$('#fileAdd').removeAttr("disabled");
 		}
 	});			
+	
 
 	//댓글 작성시 글자 카운트
 	$('.cmt_ans').keyup(function (e){
@@ -1078,42 +1113,6 @@ $(document).ready( function() {
 		}
 	});
 	
-	//팝업 - 댓글 이미지 슬라이드
-	 $(document).on('click','.cmt_cont .img_wrap .pics',function(e){
-		$("#thumbImgPop .swiper-wrapper").empty();
-		var popSlideIndex = $(this).index();
-		contactPopSwiper.slideTo(popSlideIndex);
-		contactPopSwiper.update();
-
-		var contactImglength = $('.cmt_cont .img_wrap .pics').length;
-		var popImgHtml = "";
-		for (i = 1; i <= contactImglength; i++) {
-			var contactImg = $(this).find('img');
-			var contactImgSrc = $('.cmt_cont .img_wrap .pics:nth-child('+i+') img').attr('src');
-			popImgHtml += "<div class='swiper-slide'><div class='pop_img' style='background-image:url("+ contactImgSrc +")'></div></div>";
-		}
-
-		$("#thumbImgPop .swiper-wrapper").append(popImgHtml);
-		$('#thumbImgPop').modal("show");
-		
-		return false;
-	});         
-	
-	 /* SLIDE - 댓글 이미지 팝업 */
-	var contactPopSwiper = new Swiper('.thumb_img_pop .swiper-container', {
-		navigation: {
-			nextEl: '.thumb_img_pop .swiper-button-next',
-			prevEl: '.thumb_img_pop .swiper-button-prev',
-		},
-		pagination: {
-			el: '.thumb_img_pop .swiper-pagination',
-			clickable: true,
-		},
-		observer:true,
-		observeParents: true,
-	});				
-
-
 
 });
 </script>

+ 1 - 4
src/main/webapp/WEB-INF/views/web/planning/PlanningMainFormWeb.html

@@ -36,7 +36,7 @@
 				</div>
 				<div class="cont_body">
 					<div class="taps">
-						<div id="taps">
+						<div>
 							<ul>
 								<li th:class="${cateNo == null ? 'active' : ''}"><a href="javascript:void(0);" onclick="cfnGoToPage(_PAGE_PLANNING_MAIN);">전체</a></li>
 								<li th:each="oneData, stat : ${cateList}" th:class="${oneData.cateNo == cateNo ? 'active' : '' }" ><a href="javascript:void(0);" th:onclick="|cfnGoToPage(_PAGE_PLANNING_MAIN + '?cateNo=${oneData.cateNo}');|">[[${oneData.cateNm}]]</a></li>
@@ -122,7 +122,6 @@
 				if (status == 'success') {
 					if(result.length == 0){
 						$('#planningTotCnt').html('<span>0</span>개의 기획전');
-						$("#taps").hide();
 					}
 						
                     if (result.length > 0) {
@@ -174,14 +173,12 @@
 						
 						tag += '</div>\n';
 						$('#divPlanningList').html(tag);
-						$('#taps').show();
 						$('#divPlanningNoData').hide();
 						$('#divPlanningList').show();
 
                     }else{
                     	$('#divPlanningNoData').show();
     					$('#divPlanningList').hide();
-    					$('#taps').hide();
                     
                 	}
                 }

+ 44 - 7
src/main/webapp/ux/plugins/gaga/gaga.summernote.js

@@ -35,7 +35,7 @@ var gagaSn = {
 		if (typeof(type) == 'undefined' || type == 'default') {
 			return [
 				['style', ['style']],
-				['Font Style', ['fontname']],
+				//['Font Style', ['fontname']], <!-- 210309 삭제 -->
 				['fontsize', ['fontsize']],
 				['height', ['height']],
 				['style', ['bold', 'italic', 'underline','clear']],
@@ -50,7 +50,7 @@ var gagaSn = {
 		} else if (type == 'media') {
 			return [
 				['style', ['style']],
-				['Font Style', ['fontname']],
+				//['Font Style', ['fontname']], <!-- 210309 삭제 -->
 				['fontsize', ['fontsize']],
 				['height', ['height']],
 				['style', ['bold', 'italic', 'underline','clear']],
@@ -79,15 +79,26 @@ var gagaSn = {
 			placeholder: '내용을 입력하세요',
 			height: editorHeight, //에디터 기본 높이
 			lang : 'ko-KR', //기본 언어 인코딩
-			fontNames: ['Malgun Gothic', 'HY견고딕', 'Helvetica', 'Verdana', 'Arial', 'Arial Black'], //폰트 스타일
-			fontNamesIgnoreCheck: ['Malgun Gothic'], //기본폰트 스타일
+			//fontNames: ['Malgun Gothic', 'HY견고딕', 'Helvetica', 'Verdana', 'Arial', 'Arial Black'], //폰트 스타일  <!-- 210309 삭제 -->
+			//fontNamesIgnoreCheck: ['Malgun Gothic'], //기본폰트 스타일  <!-- 210309 삭제 -->
+			fontNames: ['Noto Sans kr'], //폰트 스타일  <!-- 210309 수정 -->
+			fontNamesIgnoreCheck: ['Noto Sans kr'], //기본폰트 스타일  <!-- 210309 수정 -->
 			focus: false, //로드시 에디터창에 포커싱
 			fontSizes: ['8','9','10','11','12','13','14','15','16','17','18','19','20','24','30','36'],
 			toolbar: toolbarOptions,
 			callbacks: {
-				onImageUpload: function(files, editor, welEditable) { //이미지 업로드
-					for (var i = files.length - 1; i >= 0; i--) {
-						sendFile(files[i], this);
+				onImageUpload: function(files) { // 이미지 업로드
+					for (var i = 0; i < files.length; i++) {
+						uploadImage(files[i], this);
+					}
+				},
+				onPaste: function(e) {
+					var clipboardData = e.originalEvent.clipboardData;
+					if (clipboardData && clipboardData.items && clipboardData.items.length) {
+						var item = clipboardData.items[0];
+						if (item.kind === 'file' && item.type.indexOf('image/') !== -1) {
+							e.preventDefault();
+						}
 					}
 				}
 			}
@@ -105,6 +116,32 @@ var gagaSn = {
 		} catch(e) {
 			// Do nothing
 		}
+	},
+	
+	uploadImage : function(file, editorId) {
+		var formData = new FormData();
+		formData.append("file", file);
+		formData.append("policy", image);
+		
+		$.ajax({
+			data : formData,
+			type : 'POST',
+			url : '/common/file/upload?subDir=/editor',
+			cache : false,
+			contentType : false,
+			enctype : 'multipart/form-data',
+			processData : false,
+			success : function(data) {
+				console.log("================== EDITOR FILE UPLOAD ===================");
+				console.log("viewUrl : " + data.viewUrl);
+				console.log("viewPath : " + data.viewPath);
+				console.log("oldFileNm : " + data.oldFileNm);
+				console.log("newFileNm : " + data.newFileNm);
+				console.log("filePath : " + data.filePath);
+				console.log("================== // EDITOR FILE UPLOAD ===================");
+				$(editorId).summernote('insertImage', data.viewPath);
+			}
+		});
 	}
 
 }