jsh77b 5 anni fa
parent
commit
05d5714fd7

+ 1 - 1
src/main/java/com/style24/front/biz/web/TsfOrderController.java

@@ -168,7 +168,7 @@ public class TsfOrderController extends TsfBaseController {
 		GagaMap delvOrderMap = coreOrderService.getCartDelvGoodsCntList(tmtbGoodsApplyList);
 
 		// 3. 할인구간정보조회
-		// 3.2 장바구니상품 상품쿠폰, 장바구니쿠폰 정보 조회
+		// 3.2 상품쿠폰, 장바구니쿠폰 목록 조회
 		GagaMap goodsCartCpnMap = coreOrderService.getGoodsCartCpnApplyGoodsList(order);
 		
 		Collection<Order> goodsCpnList 	= (Collection<Order>) goodsCartCpnMap.get("goodsCpnList");

+ 61 - 39
src/main/webapp/WEB-INF/views/web/order/OrderFormWeb.html

@@ -360,43 +360,44 @@
 																		<!--  상품쿠폰 -->
 																		<th:block th:each="goods, i : ${goodsApplyCpnList}">
 																			<th:block th:if="${goods.goodsCpnList.size() > 0}">
-																			<li>
-																				<div class="coupon">
-																					<div class="item_gd">
-																						<figure>
-																							<span class="thumb"><img src="/images/pc/thumb/tmp_odSide1.jpg" alt=""></span>
-																							<figcaption>
-																								<div class="brand" th:text="${goods.brandEnm}+' '+${goods.brandKnm}"></div>
-																								<div class="name" th:text="${goods.goodsNm}"></div>
-																								<div class="price">
-																									<th:block th:if="${goods.tmtbDcAmt} > 0">
-																										<span class="selling_price"  th:text="${#numbers.formatInteger(goods.tmtbDcAmt, 1, 'COMMA')}"></span>
-																									</th:block>
-																									<th:block th:if="${goods.tmtbDcAmt} < 1">
-																										<span class="selling_price"  th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></span>
-																									</th:block>
-																								</div>
-																							</figcaption>
-																						</figure>
-																					</div>
-																					
-																					<div class="form_field">
-																						<select id="" class="select_hidden">
-																							<option value="">선택안함</option>
-																							<th:block th:each="goodsCpn, k : ${goods.goodsCpnList}">
-																								<option th:value="${goodsCpn.cpnId}" th:text="${goodsCpn.cpnId}+'|'+${goodsCpn.cpnNm}+'|'+${goodsCpn.cpnDcAmt}"></option>
-																							</th:block>
-																						</select>
-																					</div>
-
-																					<div class="cp_discount">
-																						<span class="cp_amount">-10,000원 할인적용</span>
-																						<button type="button" class="btn_del_coupon" id="">
-																							<span>쿠폰적용해제</span>
-																						</button>
+																				<li>
+																					<div class="coupon">
+																						<div class="item_gd">
+																							<figure>
+																								<span class="thumb"><img src="/images/pc/thumb/tmp_odSide1.jpg" alt=""></span>
+																								<figcaption>
+																									<div class="brand" th:text="${goods.brandEnm}+' '+${goods.brandKnm}"></div>
+																									<div class="name" th:text="${goods.goodsNm}"></div>
+																									<div class="price">
+																										<span th:text="${goods.goodsCd}"></span>
+																										<th:block th:if="${goods.tmtbDcAmt} > 0">
+																											<span class="selling_price"  th:text="${#numbers.formatInteger(goods.tmtbDcAmt, 1, 'COMMA')}"></span>
+																										</th:block>
+																										<th:block th:if="${goods.tmtbDcAmt} < 1">
+																											<span class="selling_price"  th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></span>
+																										</th:block>
+																									</div>
+																								</figcaption>
+																							</figure>
+																						</div>
+																						
+																						<div class="form_field">
+																							<select id="" class="select_hidden cpnSelect">
+																								<option value="">선택안함</option>
+																								<th:block th:each="goodsCpn, k : ${goods.goodsCpnList}">
+																									<option th:value="${goodsCpn.cpnId}" th:text="${goodsCpn.cpnId}+'|'+${goodsCpn.cpnNm}+'|'+${goodsCpn.cpnDcAmt}"></option>
+																								</th:block>
+																							</select>
+																						</div>
+	
+																						<div class="cp_discount">
+																							<span class="cp_amount">-10,000원 할인적용</span>
+																							<button type="button" class="btn_del_coupon" id="">
+																								<span>쿠폰적용해제</span>
+																							</button>
+																						</div>
 																					</div>
-																				</div>
-																			</li>
+																				</li>
 																			</th:block>
 																		</th:block>
 																		<!--  상품쿠폰 -->
@@ -806,7 +807,12 @@
 																	<span>수량:<em th:text="${goods.goodsQty}"></em>개</span>
 																</div>
 																<div class="price">
-																	<span class="selling_price" th:text="|${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')} 원|"></span>
+																	<th:block th:if="${goods.tmtbDcAmt} > 0">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.tmtbDcAmt, 1, 'COMMA')}"></span>
+																	</th:block>
+																	<th:block th:if="${goods.tmtbDcAmt} < 1">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></span>
+																	</th:block>
 																</div>
 															</figcaption>
 														</figure>
@@ -834,7 +840,12 @@
 																	<span>수량:<em th:text="${goods.goodsQty}"></em>개</span>
 																</div>
 																<div class="price">
-																	<span class="selling_price" th:text="|${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')} 원|"></span>
+																	<th:block th:if="${goods.tmtbDcAmt} > 0">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.tmtbDcAmt, 1, 'COMMA')}"></span>
+																	</th:block>
+																	<th:block th:if="${goods.tmtbDcAmt} < 1">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></span>
+																	</th:block>
 																</div>
 															</figcaption>
 														</figure>
@@ -862,7 +873,12 @@
 																	<span>수량:<em th:text="${goods.goodsQty}"></em>개</span>
 																</div>
 																<div class="price">
-																	<span class="selling_price" th:text="${goods.currPrice}"></span>
+																	<th:block th:if="${goods.tmtbDcAmt} > 0">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.tmtbDcAmt, 1, 'COMMA')}"></span>
+																	</th:block>
+																	<th:block th:if="${goods.tmtbDcAmt} < 1">
+																		<span class="selling_price"  th:text="${#numbers.formatInteger(goods.currPrice, 1, 'COMMA')}"></span>
+																	</th:block>
 																</div>
 															</figcaption>
 														</figure>
@@ -1221,6 +1237,12 @@ $(document).ready( function() {
 		if (resCnt > 0) {
 			$("#resDelvArea").css("display", "block");
 		}
+		
+		// 3. 최적의 할인으로 쿠폰 설정
+		//$(".cpnSelect option:eq(1)").attr("selected", "selected");
+		$(".cpnSelect").each(function(i){
+			$(this).find("option:eq(1)").attr("selected", "selected");
+		});
 	});
 	
 	// 사은품선택 라디오 버튼 기능