Prechádzať zdrojové kódy

메인전시 몰메인 띠배너관련 수정

bin2107 5 rokov pred
rodič
commit
b751b31a50

+ 136 - 23
src/main/webapp/WEB-INF/views/display/MainContentsPopupForm.html

@@ -103,7 +103,7 @@
 				if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
 					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
 				}
-				if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005'){
+				if(contentsLoc!='SMM005' && contentsLoc!='SBM005' && contentsLoc!='SBMM005' && contentsLoc!='SGNB001'){
 					html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
 				}
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
@@ -129,22 +129,75 @@
 				}
 				html += '	</td>';
 				html += '</tr>';
-				html += '	<tr name="tabBgColorRow'+i+'"';
+
+				if(result[i].contentsType=='OPEN'){
+					var src = $("#uploadDefaultUrlPop").val().replace('/contents/', '')+result[i].imgPath1;
+					var src2 = $("#uploadDefaultUrlPop").val().replace('/contents/', '')+result[i].imgPath2;
+					html += '<tr name="imgPopRow" id="openBanner0">';
+					html += '	<th>띠배너<br>이미지</th>';
+					html += '	<td><div class="uFile w300">';
+					html += '			<input id="filePop_0" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, 0)"/>';
+					html += '			<label for="filePop_0" class="uFileLabel">파일선택</label>';
+					html += '			<input type="hidden" name="imgPath" value="'+result[i].imgPath1+'"/>';
+					html += '			<input type="hidden" name="newImgFile" value="" />';
+					html += '		</div>';
+					html += '	<div id="imgViewPop_0" class=';
+					if(src!=''){
+						html += '"on">';
+					}else{
+						html += '"off">';
+					}
+					html += '		<img id="bannerPreViewUrlPop_0" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
+					html += '	</div></td>';
+					html += '</tr>';
+
+					html += '<tr name="imgPopRow" id="openBanner1">';
+					html += '	<th>오픈배너<br>이미지</th>';
+					html += '	<td><div class="uFile w300">';
+					html += '			<input id="filePop_1" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, 1)"/>';
+					html += '			<label for="filePop_1" class="uFileLabel">파일선택</label>';
+					html += '			<input type="hidden" name="imgPath" value="'+result[i].imgPath2+'"/>';
+					html += '			<input type="hidden" name="newImgFile" value="" />';
+					html += '		</div>';
+					html += '	<div id="imgViewPop_1" class=';
+					if(src!=''){
+						html += '"on">';
+					}else{
+						html += '"off">';
+					}
+					html += '		<img id="bannerPreViewUrlPop_1" src="'+src2+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src2\'));"/>';
+					html += '	</div></td>';
+					html += '</tr>';
+				}
+
 				if(result[i].contentsType=='IMG'){
-					html += 'style="display:none;"';
+					var src = $("#uploadDefaultUrlPop").val().replace('/contents/', '')+result[i].imgPath1;
+					html += '<tr name="imgPopRow" id="openBanner0">';
+					html += '	<th>띠배너<br>이미지</th>';
+					html += '	<td><div class="uFile w300">';
+					html += '			<input id="filePop_0" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, 0)"/>';
+					html += '			<label for="filePop_0" class="uFileLabel">파일선택</label>';
+					html += '			<input type="hidden" name="imgPath" value="'+result[i].imgPath1+'"/>';
+					html += '			<input type="hidden" name="newImgFile" value="" />';
+					html += '		</div>';
+					html += '	<div id="imgViewPop_0" class=';
+					if(src!=''){
+						html += '"on">';
+					}else{
+						html += '"off">';
+					}
+					html += '		<img id="bannerPreViewUrlPop_0" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
+					html += '	</div></td>';
+					html += '</tr>';
 				}
-				html += ' >';
-				html += '		<th>배경 RGB코드</th>';
-				html += '		<td><input name="gnbBgColor' + i + '" type="text" maxlength="200" data-valid-name="배경 RGB코드" value="' + result[i].strVar5 + '"/></td>';
-				html += '	</tr>';
 
-				html += '	<tr name="tabTextColorRow'+i+'"';
-				if(result[i].contentsType!='TEXT'){
+				html += '	<tr name="tabBgColorRow'+i+'"';
+				if(result[i].contentsType=='TEXT'){
 					html += 'style="display:none;"';
 				}
 				html += ' >';
-				html += '		<th>텍스트 RGB코드</th>';
-				html += '		<td><input name="gnbTextColor'+i+'" type="text" maxlength="200" data-valid-name="텍스트 RGB코드" value="' + result[i].strVar6 + '"/></td>';
+				html += '		<th>배경 RGB코드</th>';
+				html += '		<td><input name="gnbBgColor' + i + '" type="text" maxlength="200" data-valid-name="배경 RGB코드" value="' + result[i].strVar5 + '"/></td>';
 				html += '	</tr>';
 
 				html += '	<tr name="tabShowYnRow'+i+'"';
@@ -271,8 +324,10 @@
 					if(strTitle!=null && strTitle!='null' && strTitle!='' ){
 						html += fnAddTitlePopRow(strTitle);
 					}
-					if(imgPath!=null && imgPath!='null' && imgPath!='' ){
-						html += fnAddImgPopRow(imgPath);
+					if(contentsLoc!='SGNB001'){
+						if(imgPath!=null && imgPath!='null' && imgPath!='' ){
+							html += fnAddImgPopRow(imgPath);
+						}
 					}
 					if(strVar!=null && strVar!='null' && strVar!='' ){
 						html += fnAddLinkPopRow(strVar);
@@ -303,15 +358,39 @@
 		if(cateType=='OPEN'){
 			$(obj).closest("table").find("[name=tabBgColorRow"+idx+"]").show();
 			$(obj).closest("table").find("[name=tabShowYnRow"+idx+"]").show();
-			$(obj).closest("table").find("[name=tabTextColorRow"+idx+"]").hide();
+			$(obj).closest("table").find("[id=openBanner0]").show();
+			$(obj).closest("table").find("[id=openBanner1]").show();
+			$(obj).closest("table").find("[name=file]").closest('div').find('label').text('파일선택');
+			$(obj).closest("table").find("[name=imgPath]").val('');
+			$(obj).closest("table").find("[name=newImgFile]").val('');
+			$("#bannerPreViewUrlPop_0").attr('src', '');
+			$("#imgViewPop_0").removeClass("on").addClass("off");
+			$("#bannerPreViewUrlPop_1").attr('src', '');
+			$("#imgViewPop_1").removeClass("on").addClass("off");
 		}else if(cateType=='IMG'){
-			$(obj).closest("table").find("[name=tabBgColorRow"+idx+"]").hide();
+			$(obj).closest("table").find("[name=tabBgColorRow"+idx+"]").show();
 			$(obj).closest("table").find("[name=tabShowYnRow"+idx+"]").hide();
-			$(obj).closest("table").find("[name=tabTextColorRow"+idx+"]").hide();
+			$(obj).closest("table").find("[id=openBanner0]").show();
+			$(obj).closest("table").find("[id=openBanner1]").hide();
+			$(obj).closest("table").find("[name=file]").closest('div').find('label').text('파일선택');
+			$(obj).closest("table").find("[name=imgPath]").val('');
+			$(obj).closest("table").find("[name=newImgFile]").val('');
+			$("#bannerPreViewUrlPop_0").attr('src', '');
+			$("#imgViewPop_0").removeClass("on").addClass("off");
+			$("#bannerPreViewUrlPop_1").attr('src', '');
+			$("#imgViewPop_1").removeClass("on").addClass("off");
 		}else if(cateType=='TEXT'){
-			$(obj).closest("table").find("[name=tabBgColorRow"+idx+"]").show();
+			$(obj).closest("table").find("[name=tabBgColorRow"+idx+"]").hide();
 			$(obj).closest("table").find("[name=tabShowYnRow"+idx+"]").hide();
-			$(obj).closest("table").find("[name=tabTextColorRow"+idx+"]").show();
+			$(obj).closest("table").find("[id=openBanner0]").hide();
+			$(obj).closest("table").find("[id=openBanner1]").hide();
+			$(obj).closest("table").find("[name=file]").closest('div').find('label').text('파일선택');
+			$(obj).closest("table").find("[name=imgPath]").val('');
+			$(obj).closest("table").find("[name=newImgFile]").val('');
+			$("#bannerPreViewUrlPop_0").attr('src', '');
+			$("#imgViewPop_0").removeClass("on").addClass("off");
+			$("#bannerPreViewUrlPop_1").attr('src', '');
+			$("#imgViewPop_1").removeClass("on").addClass("off");
 		}
 	}
 
@@ -363,7 +442,7 @@
 			if(contentsLoc=='SBM005' || contentsLoc=='SBMM005'){
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddBrandDescRow(this);">브랜드소개추가</button>';
 			}
-			if(contentsLoc!='SBM005' && contentsLoc!='SBMM005') {
+			if(contentsLoc!='SBM005' && contentsLoc!='SBMM005' && contentsLoc!='SGNB001') {
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddImgPopRow(this);">이미지추가</button>';
 			}
 				html += '<button type="button" class="btn btn-base btn-lg" onclick="fnAddLinkPopRow(this);">링크추가</button>';
@@ -379,14 +458,48 @@
 			html += '		<label class="rdoBtn"><input type="radio" name="cateType'+dataIdx+'" value="TEXT" onclick="fnChangeGnbCateType(this,'+dataIdx+');"/>텍스트배너</label>';
 			html += '	</td>';
 			html += '</tr>';
+
+			var src = '';
+			html += '<tr name="imgPopRow" id="openBanner0">';
+			html += '	<th>띠배너<br>이미지</th>';
+			html += '	<td><div class="uFile w300">';
+			html += '			<input id="filePop_0" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, 0)"/>';
+			html += '			<label for="filePop_0" class="uFileLabel">파일선택</label>';
+			html += '			<input type="hidden" name="imgPath" value=""/>';
+			html += '			<input type="hidden" name="newImgFile" value="" />';
+			html += '		</div>';
+			html += '	<div id="imgViewPop_0" class=';
+			if(src!=''){
+				html += '"on">';
+			}else{
+				html += '"off">';
+			}
+			html += '		<img id="bannerPreViewUrlPop_0" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
+			html += '	</div></td>';
+			html += '</tr>';
+
+			html += '<tr name="imgPopRow" id="openBanner1">';
+			html += '	<th>오픈배너<br>이미지</th>';
+			html += '	<td><div class="uFile w300">';
+			html += '			<input id="filePop_1" name="file" type="file" class="uFileInput w300" onchange="fnPopFileUpload(this, 1)"/>';
+			html += '			<label for="filePop_1" class="uFileLabel">파일선택</label>';
+			html += '			<input type="hidden" name="imgPath" value=""/>';
+			html += '			<input type="hidden" name="newImgFile" value="" />';
+			html += '		</div>';
+			html += '	<div id="imgViewPop_1" class=';
+			if(src!=''){
+				html += '"on">';
+			}else{
+				html += '"off">';
+			}
+			html += '		<img id="bannerPreViewUrlPop_1" src="'+src+'" style="height:100px; max-width:500px;"  onclick="cfnOpenImagePreViewPopup(\'bannerPreimgViewPop\',$(this).attr(\'src\'));"/>';
+			html += '	</div></td>';
+			html += '</tr>';
+
 			html += '	<tr name="tabBgColorRow'+dataIdx+'">';
 			html += '		<th>배경 RGB코드</th>';
 			html += '		<td><input name="gnbBgColor'+dataIdx+'" type="text" maxlength="200" data-valid-name="배경 RGB코드" value=""/></td>';
 			html += '	</tr>';
-			html += '	<tr name="tabTextColorRow'+dataIdx+'" style="display:none;">';
-			html += '		<th>텍스트 RGB코드</th>';
-			html += '		<td><input name="gnbTextColor'+dataIdx+'" type="text" maxlength="200" data-valid-name="텍스트 RGB코드" value=""/></td>';
-			html += '	</tr>';
 			html += '	<tr name="tabShowYnRow'+dataIdx+'">';
 			html += '		<th>오늘하루 보지않기<br>노출여부</th>';
 			html += '		<td>';