Przeglądaj źródła

위시리스트 [mo], 이스케이프

sowon4187 5 lat temu
rodzic
commit
a67218561a

+ 2 - 0
src/main/java/com/style24/front/biz/web/TsfMypageController.java

@@ -1556,6 +1556,8 @@ public class TsfMypageController extends TsfBaseController {
 			result.set("message", "쿠폰이 발급되었습니다.");
 		}
 		result.set("status", "200");
+		
+		result.set("couponList", couponService.getQuickCouponDownList(coupon));
 		return result;
 	}
 

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

@@ -1289,6 +1289,7 @@
 		      ,C.CUST_PUB_LIMIT_QTY 
 		      ,C.TOT_PUB_LIMIT_QTY
 		      ,C.MAX_DC_AMT 
+		      , IFNULL((SELECT COUNT(1) FROM TB_CUST_COUPON WHERE CPN_ID = C.CPN_ID AND CUST_NO = #{custNo}),0) AS CUST_COUPON_CNT
 		      , CONCAT(CASE WHEN C.BUY_LIMIT_AMT = 0 THEN ''
 		                   ELSE CONCAT(FORMAT(C.BUY_LIMIT_AMT , 0),'원 이상 구매 시 ')
 		              END
@@ -1335,8 +1336,7 @@
 		     WHERE CPN_ID = C.CPN_ID
 		     AND USABLE_CUST_GRADE IN (#{custGrade})              -- 사용가능고객구분
 		     ) <![CDATA[>=]]> 1
-		ORDER BY  C.AVAIL_EDDT,
-		CASE WHEN DC_WAY LIKE '%' THEN DC_VAL END DESC LIMIT 10
+		ORDER BY  C.REG_DT DESC ,C.AVAIL_EDDT ASC LIMIT 10
 	</select>
 	
 </mapper>

+ 1 - 1
src/main/webapp/WEB-INF/views/mob/mypage/MypageReviewCreateFormMob.html

@@ -490,7 +490,7 @@ $(function(){
 		 rating(reviewScore);
 		$("#reviewForm input[name=height]").val(reviewList.height);
 		$("#reviewForm input[name=weight]").val(reviewList.weight);
-		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent);
+		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());
 		if(reviewList.scoreSize == "1"){
 			$('#reviewForm input:radio[name=scoreSize]:radio[value="1"]').prop('checked', true);
 		}else if(reviewList.scoreSize == "2"){

+ 2 - 2
src/main/webapp/WEB-INF/views/mob/mypage/MypageReviewFormMob.html

@@ -363,7 +363,7 @@
 						html += '		</div>';
 					}
 					html += '		<div class="txt_review_box" id="admin_'+item.reviewSq+'">';
-					html += '			<p>'+item.reviewContent+'</p>';
+					html += '			<p>'+item.reviewContent.escapeHtml()+'</p>';
 					html += '		</div>';
 					html += '		<div  class="response_box2">';
 					html += '			<div>';
@@ -409,7 +409,7 @@
 						html += '					<span class="wr_date">'+item.admRplDt+'</span>';
 						html += '				</div>';
 						html += '				<div class="reply_txt">';
-						html += '					<p>'+item.admRpl+'</p>';
+						html += '					<p>'+item.admRpl.escapeHtml()+'</p>';
 						html += '				</div>';
 						html += '			</div>';
 						html += '		</div>';

+ 86 - 54
src/main/webapp/WEB-INF/views/mob/mypage/MypageWishListFormMob.html

@@ -32,14 +32,9 @@
 let month = [[${wishMonth}]];
 
 var wishlistDelete = function(obj) {
-	mcxDialog.confirm("위시리스트를 해제하시겠습니까?", {
-		cancelBtnText : "취소",
-		sureBtnText : "확인",
-		sureBtnClick : function() {
-			cfnPutWishList(obj);
-			ajaxWishList();
-		}
-	});
+	cfnPutWishList(obj);
+
+	ajaxWishList();
 }	
 //마이페이지 위시리스트 
 var ajaxWishList = function () {
@@ -47,56 +42,93 @@ var ajaxWishList = function () {
 		if (status == 'success') {
 			$('#wishList').html('');
 			html = '';
-			for (var i = 0; i < month.length; i++) {
-				html += '<div class="monthly_wish_wrap">\n';
-				html += '	<div class="date">\n';
-				html += '		<span>'+month[i].regDt+'</span>\n';
-				html += '	</div>\n';
-				html += '	<div class="itemsGrp">\n';
-				
-				$.each(result, function (idx, item) {
-					if (item.regDtMonth == month[i].regDt) {
-						html += '		<div class="item_prod">\n';
-						html += '			<div class="item_state">\n';
-						html += '				<button type="button" class="itemLike likeit" goodsCd="'+item.goodsCd+'" onclick="wishlistDelete(this)">관심상품 추가</button>\n';
-						html += '				<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail('+item.goodsCd+')">\n';
-						html += '					<div class="itemPic">\n';
-						html += '						<img class="vLHTC pd_img"  src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">\n';
-						html += '					</div>\n';
-						html += '					<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
-						html += '					<div class="itemName">'+item.goodsNm+'</div>\n';
-						html += '					<p class="itemPrice">\n';
-						
-						if (item.currPrice != item.listPrice) {
-							html+='						<span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
-						}
-						html += item.currPrice.addComma();
-						if (item.dcRate>0) {
-							html+='						<span class=" itemPercent">'+item.dcRate+'%</span>\n';
+			if (result.length>0) {
+				for (var i = 0; i < month.length; i++) {
+					html += '<div class="monthly_wish_wrap">\n';
+					html += '	<div class="date">\n';
+					html += '		<span>'+month[i].regDt+'</span>\n';
+					html += '	</div>\n';
+					html += '	<div class="itemsGrp">\n';
+					
+					$.each(result, function (idx, item) {
+						if (item.regDtMonth == month[i].regDt) {
+							html += '		<div class="item_prod">\n';
+							html += '			<div class="item_state">\n';
+							html += '				<button type="button" class="itemLike active likeit" goodsCd=\''+item.goodsCd+'\' onclick="wishlistDelete(this)">관심상품 추가</button>\n';
+							html += '				<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')">\n';
+							html += '					<div class="itemPic">\n';
+							html += '						<img class="vLHTC pd_img"  src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">\n';
+							html += '					</div>\n';
+							html += '					<p class="itemBrand">'+item.brandGroupNm+'</p>\n';
+							html += '					<div class="itemName">'+item.goodsNm+'</div>\n';
+							html += '					<p class="itemPrice">\n';
+							
+							if (item.currPrice != item.listPrice) {
+								html+='						<span class="itemPrice_original">'+item.listPrice.addComma()+'</span>\n';
+							}
+							html += item.currPrice.addComma();
+							if (item.dcRate>0) {
+								html+='						<span class=" itemPercent">'+item.dcRate+'%</span>\n';
+							}
+							html += '					</p>\n';
+							html += '					<div class="itemcolorchip">\n';
+							if(!gagajf.isNull(item.colorChips)){
+								var colorArr = item.colorChips.split(",");
+								var colorCd = '';
+								var rgbColor = '';
+								for(let i=0; i<colorArr.length; i++){
+									var colorInfo = colorArr[i].split(":");
+									colorCd = colorInfo[0];
+									rgbColor = colorInfo[1];
+									if(rgbColor=='#FFFFFF'){
+										html += '	<span class="chip_color" style="background-color: '+rgbColor+';border:1px solid #aaa;" value="'+colorCd+'">'+colorCd+'</span>';
+									}else{
+										html += '	<span class="chip_color" style="background-color: '+rgbColor+'" value="'+colorCd+'">'+colorCd+'</span>';
+									}
+								}
+							}
+							html += '					</div>\n';
+							if(!gagajf.isNull(item.icon)){
+								var iconArr = item.icon.split(",");
+								var iconGb = '';
+								var iconNm = '';
+								html += '	<p class="itemBadge">';
+								for(let i=0; i<iconArr.length; i++){
+									var iconInfo = iconArr[i].split(":");
+									iconGb = iconInfo[0];
+									iconNm = iconInfo[1];
+									html += '	<span class="badge13" value="'+iconGb+'">'+iconNm+' </span>';
+								}
+								html += '	</p>';
+							}
+							if (item.goodsTnm != null && item.goodsTnm != '') {
+								html+='					<div class="itemComment">'+item.goodsTnm+'</div>\n';
+							}
+							html += '				</a>\n';
+							html += '			</div>\n';
+							html += '		</div>\n';
+							
 						}
-						html += '					</p>\n';
-						html += '					<div class="itemcolorchip">\n';
-						html += '						<span class="chip_color35" value="ABM">BEIGE</span>\n';
-						html += '						<span class="chip_color54" value="BDS">BLACK</span>\n';
-						html += '						<span class="chip_color40" value="YBR">WHITE</span>\n';
-						html += '					</div>\n';
-						html += '					<p class="itemBadge">\n';
-						html += '						<span class="badge13">베스트 </span>\n';
-						html += '					</p>\n';
-						if (item.goodsTnm != null && item.goodsTnm != '') {
-							html+='					<div class="itemComment">'+item.goodsTnm+'</div>\n';
-						}
-						html += '				</a>\n';
-						html += '			</div>\n';
-						html += '		</div>\n';
-						
-					}
-				});
+					});
+					
+					html += '	</div>\n';
+					html += '</div>\n';
+					$('#wishList').html(html);
+				}
+			}
+			else{
+				html += ' <div class="nodata">';
+				html += '	<div class="txt_box">';
+				html += '		<p>';
+				html += '			등록된 위시리스트가 없습니다.<br>';
+				html += '			';
+				html += '		</p>';
+				html += '	</div>';
+				html += '</div>';
 				
-				html += '	</div>\n';
-				html += '</div>\n';
 				$('#wishList').html(html);
 			}
+			
 		}
 	});
 }

+ 14 - 4
src/main/webapp/WEB-INF/views/web/common/fragments/FooterWeb.html

@@ -603,7 +603,7 @@
 								</li>
 							</ul> -->
 						</div>
-						<a href="javascript:void(0);" class="more_btn" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">더 보기</a>_
+						<a href="javascript:void(0);" class="more_btn" onclick="cfnGoToPage(_PAGE_EVENT_MAIN);">더 보기</a>
 					</div>
 					
 					<div id="coupon_type02" class="coupon_area">
@@ -1280,7 +1280,7 @@
 									
 									tag += '				</p>';
 									tag += '			</div>';
-									tag += '			<button type="button" class="btn btn_dark btn_block btn_coupon_down" onclick="fnQuickCouponDown('+item.cpnId+')"><span>쿠폰받기</span></button>';
+									tag += '			<button type="button" id="coupon_'+item.cpnId+'" class="btn btn_dark btn_block btn_coupon_down" onclick="fnQuickCouponDown('+item.cpnId+')"><span>쿠폰받기</span></button>';
 									tag += '		</div>';
 									tag += '	</li>';
 								});
@@ -1356,9 +1356,19 @@
 	// 쿠폰다운로드 콜백
 	var fnQuickCouponCallBack = function(result){
 		if (result.status == "200"){
-			//mcxDialog.alert(result.message);
+			let list = result.couonList;
+
+			list.forEach(function(coupon){
+				if (Number(coupon.custPubLimitQty) > 0){
+					if (Number(coupon.custPubLimitQty) <= Number(coupon.custCouponCnt)){
+						$('#coupon_'+ coupon.cpnId).html('<span>받기완료</span>');
+						$('#coupon_'+ coupon.cpnId).attr('disabled', true);
+					}
+				}
+			});
+			
 		}			
-		issueCouponBtn();
+		//issueCouponBtn();
 		
 	}
 

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

@@ -642,7 +642,7 @@ $(document).ready(function() {
 		 rating(reviewScore);
 		$("#reviewForm input[name=height]").val(reviewList.height);
 		$("#reviewForm input[name=weight]").val(reviewList.weight);
-		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent);
+		$("#reviewForm textarea[name=reviewContent]").val(reviewList.reviewContent.escapeHtml());
 		if(reviewList.scoreSize == "1"){
 			$('#reviewForm input:radio[name=scoreSize]:radio[value="1"]').prop('checked', true);
 		}else if(reviewList.scoreSize == "2"){

+ 2 - 2
src/main/webapp/WEB-INF/views/web/mypage/MypageReviewFormWeb.html

@@ -334,7 +334,7 @@
 					
 				}
 				html+='						<div class="txt_review_box"  id="admin_'+item.reviewSq+'">';
-				html+='							<p>'+item.reviewContent+'</p>';
+				html+='							<p>'+item.reviewContent.escapeHtml()+'</p>';
 				html+='						</div>';
 				
 				if (item.admRpl != null && item.admRpl != '') {
@@ -345,7 +345,7 @@
 					html+='									<span class="wr_date">'+item.admRplDt+'</span>';
 					html+='								</div>';
 					html+='								<div class="reply_txt">';
-					html+='									<p>'+item.admRpl+'</p>';
+					html+='									<p>'+item.admRpl.escapeHtml()+'</p>';
 					html+='								</div>';
 					html+='							</div>';
 					html+='						</div>';

+ 1 - 1
src/main/webapp/WEB-INF/views/web/mypage/MypageWishListFormWeb.html

@@ -76,7 +76,7 @@ var ajaxWishList = function () {
 						if (item.regDtMonth == month[i].regDt) {
 							html+='		<div class="item_prod">';
 							html+='			<div class="item_state">';
-							html+='				<button type="button" class="itemLike active" goodsCd="'+item.goodsCd+'" onclick="wishlistDelete(this)">관심상품 추가</button>';
+							html+='				<button type="button" class="itemLike active" goodsCd=\''+item.goodsCd+'\' onclick="wishlistDelete(this)">관심상품 추가</button>';
 							html+='				<a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\'' + item.goodsCd + '\')">';
 							html+='					<div class="itemPic">';
 							html+='						<img alt="" class=" vLHTC pd_img" src="' + _uploadGoodsUrl + '/' + item.sysImgNm + '">';