Browse Source

상품상세 - 쇼핑혜택(쿠폰,즉시포인트) 적용

eskim 5 years ago
parent
commit
da0f2891ed

+ 8 - 4
src/main/java/com/style24/front/biz/web/TsfGoodsController.java

@@ -196,8 +196,6 @@ public class TsfGoodsController extends TsfBaseController {
 		mav.addObject("cardInfoList", goodsService.getCardPromotionList(cardPromotion));
 
 		// 쇼핑 혜택
-		// 할인혜택
-
 		// 다다익선
 
 		// 사은품
@@ -466,9 +464,15 @@ public class TsfGoodsController extends TsfBaseController {
 		setGoods(paramsGoods);
 		Goods goods = goodsService.getGoodsInfo(paramsGoods);
 
-		// 상품 기본정보
-		mav.addObject("goodsInfo", goods);
+		// 쿠폰정보
+		paramsGoods.setMaxRownum(1);
+		mav.addObject("goodsCouponList", couponService.getGoodsCouponList(paramsGoods));
+		// 다다익선
+
+		// 사은품
 
+		// 상품 기본정보 --즉시할인정보
+		mav.addObject("goodsInfo", goods);
 		mav.setViewName(super.getDeviceViewName("goods/GoodsShopBenefitForm"));
 		return mav;
 	}

+ 12 - 4
src/main/webapp/WEB-INF/views/web/goods/GoodsDetailFormWeb.html

@@ -129,13 +129,21 @@
 									<p>예약판매 상품 - <th:block th:text="${goodsInfo.delvResDt}"></th:block> 출고예정</p>
 								</div>
 							</div>
-							<div class="benefit_box" th:if="${cardInfoList != null and !cardInfoList.empty}" >
+							<div class="benefit_box" th:if="${(cardInfoList != null and !cardInfoList.empty) or
+																(goodsCouponList != null and !goodsCouponList.empty)
+															}" >
 								<dl>
-									<div class="bnf_shopping">
+									<div class="bnf_shopping" th:if="${goodsCouponList != null and !goodsCouponList.empty}">
 										<dt>쇼핑혜택</dt>
-											<!------------ 색상 강조 텍스트 영역 <em class="c_primary"></em> 사용요청 ------------>
 											<dd>
-												<span>최대 <em class="c_primary">15%</em> 쿠폰 할인</span> 
+												<span th:if="${goodsCouponList != null and !goodsCouponList.empty}">
+												<th:block th:each="goodsCoupon, status : ${goodsCouponList}" th:if="${status.first}">
+												최대 <em class="c_primary" >
+													<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
+													<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
+												</em> 쿠폰 할인
+												</th:block>
+												</span> 
 												<span><em class="c_primary">99개</em> 이상 구매 시 <em class="c_primary">9,999,999원</em> 할인</span>
 												<span>미니언즈 우산 증정</span>
 												<button type="button" id="btn_bnfShopping_pop" class="btn_popup" th:onclick="cfGoodsShopBenefitInfo([[${goodsInfo.goodsCd}]])"><span>자세히</span></button>

+ 8 - 5
src/main/webapp/WEB-INF/views/web/goods/GoodsShopBenefitFormWeb.html

@@ -21,7 +21,7 @@
 		</div>
 		<div class="modal-body">
 			<div class="pop_cont">
-				<div class="benefit_blk">
+				<div class="benefit_blk" th:if="${(goodsCouponList != null and !goodsCouponList.empty) or (goodsInfo.prePntUsableYn == 'Y')}">
 					<h6>할인혜택</h6>
 					<div class="tbl type1">
 						<table>
@@ -30,13 +30,16 @@
 								<col width="*">
 							</colgroup>
 							<tbody>
-								<tr>
+								<tr th:if="${(goodsInfo.prePntUsableYn == 'Y')}">
 									<th>즉시 할인</th>
-									<td>50% 할인</td>
+									<td th:text="|${#numbers.formatInteger(goodsInfo.pntAmt, 0,'COMMA')}원 할인|">50% 할인</td>
 								</tr>
-								<tr>
+								<tr th:if="${(goodsCouponList != null and !goodsCouponList.empty)}">
 									<th>쿠폰할인</th>
-									<td>최대 10% 할인</td>
+									<td th:each="goodsCoupon, status : ${goodsCouponList}" th:if="${status.first}">최대
+									<th:block th:if="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${#numbers.formatInteger(goodsCoupon.dcVal, 0,'COMMA')}원|"></th:block>
+									<th:block th:unless="${goodsCoupon.dcWay == 'G240_10'}" th:text="|${goodsCoupon.dcVal}%|"></th:block>
+									 할인</td>
 								</tr>
 							</tbody>
 						</table>