|
|
@@ -111,11 +111,9 @@
|
|
|
</div>
|
|
|
<div class="popup_con">
|
|
|
<div class="button_list clear">
|
|
|
- <button type="button" class="on"><span>구매성별 전체</span></button>
|
|
|
- <button type="button"><span>구매성별1</span></button>
|
|
|
- <button type="button"><span>구매성별2</span></button>
|
|
|
- <button type="button"><span>구매성별3</span></button>
|
|
|
- <button type="button"><span>구매성별4</span></button>
|
|
|
+ <button type="button" class="on" onclick="fnGetEigenD002(this, 'gender');" data-id="" ><span>구매성별 전체</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="A" ><span>남성</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'gender');" data-id="B" ><span>여성</span></button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -128,11 +126,12 @@
|
|
|
</div>
|
|
|
<div class="popup_con">
|
|
|
<div class="button_list clear">
|
|
|
- <button type="button" class="on"><span>구매연령 전체</span></button>
|
|
|
- <button type="button"><span>구매연령1</span></button>
|
|
|
- <button type="button"><span>구매연령2</span></button>
|
|
|
- <button type="button"><span>구매연령3</span></button>
|
|
|
- <button type="button"><span>구매연령4</span></button>
|
|
|
+ <button type="button" class="on" onclick="fnGetEigenD002(this, 'age');" data-id="" ><span>구매연령 전체</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="10" ><span>10대</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="20" ><span>20대</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="30" ><span>30대</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="40" ><span>40대</span></button>
|
|
|
+ <button type="button" onclick="fnGetEigenD002(this, 'age');" data-id="50" ><span>50대 이상</span></button>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -247,7 +246,7 @@
|
|
|
|
|
|
$.getJSON('/display/realtime/best/list' , data, function (result, status){
|
|
|
$("#itemViewArea").html('');
|
|
|
- console.log(result);
|
|
|
+ // console.log(result);
|
|
|
if(result.length > 0){
|
|
|
$.each(result, function (idx, item){
|
|
|
// 2021.08.30 이미지 null 처리
|
|
|
@@ -306,9 +305,15 @@
|
|
|
gagajf.ajaxFormSubmit("/display/best/main/goods/list", document.bestGoodsForm, fnCallbackBestTop100);
|
|
|
}
|
|
|
|
|
|
+ let bestCnt = 0;
|
|
|
+ let eigenBestCnt = 0;
|
|
|
+
|
|
|
var fnCallbackBestTop100 = function (result){
|
|
|
$("#prodArea").html('');
|
|
|
var tag = '';
|
|
|
+
|
|
|
+ bestCnt = result.dataList.length;
|
|
|
+
|
|
|
if(result.dataList.length > 0){
|
|
|
$.each(result.dataList, function (idx, item){
|
|
|
tag += '<div class="item_prod">\n';
|
|
|
@@ -381,6 +386,128 @@
|
|
|
|
|
|
$("#prodArea").append(tag);
|
|
|
}
|
|
|
+
|
|
|
+ // 수동설정이 100미만이면 추천솔루션 데이터 추가 조회
|
|
|
+ if(bestCnt < 100){
|
|
|
+ eigenBestCnt = 100 - bestCnt;
|
|
|
+ fnGetEigenBestData(eigenBestCnt);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ // 추천솔루션 데이터 추가 조회
|
|
|
+ var fnGetEigenBestData = function (cnt){
|
|
|
+ var eigenUrl = '';
|
|
|
+ var selectCateNo = $("#bestGoodsForm input[name=cateNo]").val();
|
|
|
+
|
|
|
+ if(gagajf.isNull(selectCateNo)){
|
|
|
+ /* cateNo 전체 일 때 */
|
|
|
+ eigenUrl = 'https://api.eigene.io/rec/m061?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4';
|
|
|
+ }else{
|
|
|
+ eigenUrl = 'https://api.eigene.io/rec/m060?size='+cnt+'&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&incids='+selectCateNo;
|
|
|
+ }
|
|
|
+ var tag = '';
|
|
|
+
|
|
|
+ $.getJSON(eigenUrl, function (result, status){
|
|
|
+ if (status === 'success') {
|
|
|
+ if (!gagajf.isNull(result.results)) {
|
|
|
+ $.each(result.results, function (idx, item) {
|
|
|
+ tag += '<div class="item_prod">\n';
|
|
|
+ tag += ' <div class="item_state">\n';
|
|
|
+ tag += ' <button type="button" class="itemLike" onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\')">\n';
|
|
|
+ tag += '<div class="shape ';
|
|
|
+ if(cnt == 100 && idx==0){
|
|
|
+ tag += ' ranker';
|
|
|
+ }
|
|
|
+ tag += '"><span>'+(idx+1)+'</span></div>\n';
|
|
|
+ tag += ' <div class="itemPic">\n';
|
|
|
+ tag += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += ' <p class="itemBrand">'+item.product.brandName+'</p>\n';
|
|
|
+ tag += ' <div class="itemName">'+item.product.itemName+'</div>\n';
|
|
|
+ tag += ' <p class="itemPrice">';
|
|
|
+ if (item.product.originalPrice != item.product.salePrice) {
|
|
|
+ tag += ' <span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
|
|
|
+ }
|
|
|
+ tag += item.product.salePrice.addComma();
|
|
|
+ if (item.product.originalPrice != item.product.salePrice) {
|
|
|
+ tag+=' <span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
|
|
|
+ }
|
|
|
+ tag += ' </p>\n';
|
|
|
+ tag += ' </a>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += '</div>\n';
|
|
|
+ });
|
|
|
+ $("#prodArea").append(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ // 구매 성별/연령 별 베스트 상품 추천
|
|
|
+ var fnGetEigenD002 = function (obj, key){
|
|
|
+ var gender = '';
|
|
|
+ var age = '';
|
|
|
+
|
|
|
+ if(key == 'gender'){
|
|
|
+ gender = $(obj).attr("data-id");
|
|
|
+ $("#odDatePop2").find(".popup_con .button_list").find("button").each(function (){
|
|
|
+ if($(this).hasClass("on")){
|
|
|
+ age = $(this).attr("data-id");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ age = $(obj).attr("data-id");
|
|
|
+ $("#odDatePop1").find(".popup_con .button_list").find("button").each(function (){
|
|
|
+ if($(this).hasClass("on")){
|
|
|
+ gender = $(this).attr("data-id");
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ if(gagajf.isNull(gender) && gagajf.isNull(age)){
|
|
|
+ $("#prodArea").html('');
|
|
|
+ fnGetEigenBestData(100);
|
|
|
+ }else{
|
|
|
+ $("#prodArea").html('');
|
|
|
+ var eigenUrl = 'https://api.eigene.io/rec/d002?size=100&cuid=1252aed4-78dc-46e8-b784-94ac42e86dd4&gender='+gender+'&age='+age;
|
|
|
+ var tag = '';
|
|
|
+ $.getJSON(eigenUrl, function (result, status){
|
|
|
+ if (status === 'success') {
|
|
|
+ if (!gagajf.isNull(result.results)) {
|
|
|
+ $.each(result.results, function (idx, item) {
|
|
|
+ tag += '<div class="item_prod">\n';
|
|
|
+ tag += ' <div class="item_state">\n';
|
|
|
+ tag += ' <button type="button" class="itemLike" onclick="wishlistDelete(this)" goodsCd="'+item.product.itemId+'" goodsNm="'+ item.product.itemName+'" ithrCd="" contentsLoc="IN10_01" planDtlSq="">관심상품 추가</button>\n';
|
|
|
+ tag += ' <a href="javascript:void(0);" class="itemLink" onclick="cfnGoToGoodsDetail(\''+item.product.itemId+'\', \'\')">\n';
|
|
|
+ tag += '<div class="shape ';
|
|
|
+ if(idx==0){
|
|
|
+ tag += ' ranker';
|
|
|
+ }
|
|
|
+ tag += '"><span>'+(idx+1)+'</span></div>\n';
|
|
|
+ tag += ' <div class="itemPic">\n';
|
|
|
+ tag += ' <img alt="BLUE-a" class=" vLHTC pd_img" src="'+ item.product.itemImage +'">\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += ' <p class="itemBrand">'+item.product.brandName+'</p>\n';
|
|
|
+ tag += ' <div class="itemName">'+item.product.itemName+'</div>\n';
|
|
|
+ tag += ' <p class="itemPrice">';
|
|
|
+ if (item.product.originalPrice != item.product.salePrice) {
|
|
|
+ tag += ' <span class="itemPrice_original">' + item.product.originalPrice.addComma() + '</span>\n';
|
|
|
+ }
|
|
|
+ tag += item.product.salePrice.addComma();
|
|
|
+ if (item.product.originalPrice != item.product.salePrice) {
|
|
|
+ tag+=' <span class=" itemPercent">'+ Math.round((item.product.originalPrice - item.product.salePrice) / (item.product.originalPrice * 1.0) * 100) +'%</span>\n';
|
|
|
+ }
|
|
|
+ tag += ' </p>\n';
|
|
|
+ tag += ' </a>\n';
|
|
|
+ tag += ' </div>\n';
|
|
|
+ tag += '</div>\n';
|
|
|
+ });
|
|
|
+ $("#prodArea").append(tag);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
$(document).ready(function() {
|