+ '
' + '' + '
'+ data.Spslgn +'
' + '
'+ data.Dsr +'
' + '
' + '
' + '特價' + '$'+ data.Lowestpr + '
' + '
' + '搶購' + '
' + '
'; document.getElementById('Prods_ERAlsoBuyTop').innerHTML = topProdHtml; $('#Prods_ERAlsoBuyTop').show(); }else{ prodHtml = '
  • ' + '
    ' + ''+ data.Dsr +'' + '
    ' + '
    ' + '' + '
    '+ data.Spslgn +'
    ' + '
    '+ data.Dsr +'
    ' + '
    ' + '
    ' + '特價' + '$'+ data.Lowestpr + '
    ' + '
    ' + '搶購' + '
    ' + '
    ' + '
  • '; } return prodHtml; } function getRelateEtuProds(prods,recoType,relatedInnerHtmlId,htmlType,relkdid,eturec,etuPam,queryName,excludeQueryName){ var relkdid = ""; if("etuD05ContentRel" == relatedInnerHtmlId){ relkdid = "pD05dEtu"; } getEtuProds(prods,recoType,relatedInnerHtmlId,htmlType,relkdid,eturec,etuPam,queryName,excludeQueryName,"","","","",""); } function getEtuProds(prods,recoType,innerHtmlId,htmlType,kdid,eturec,etuPam,queryName,excludeQueryName,etuProdsCallBackFun,relatedInnerHtmlId,firstProdXuid,firstProdCate,getGAProds,etulogic){ if(innerHtmlId.indexOf("Rel") < 0){ if(!document.getElementById(queryName+"_prodxuid")) { var prodXuidDiv = document.createElement('div'); prodXuidDiv.setAttribute("id", queryName+"_prodxuid"); var textNode = document.createTextNode(prods); prodXuidDiv.appendChild(textNode); document.getElementById('recoProdXuidHtml').appendChild(prodXuidDiv); }else{ document.getElementById(queryName+"_prodxuid").innerHTML += ","+prods; } if(excludeQueryName != null && excludeQueryName.length > 0 && excludeQueryName != 'undefined'){ if(document.getElementById(excludeQueryName+"_prodxuid")) { var excludeProd = document.getElementById(excludeQueryName+"_prodxuid").innerHTML; for(var i=0; i=0){ prods.splice(i, 1); i--; } } } } } //若是遞補邏輯,數量為需補足數量 if($('#' + innerHtmlId + ' li').length > 0){ etuPam += '¤tNumber=' + $('#' + innerHtmlId + ' li').length; }else if($('#' + innerHtmlId + ' div.thumbnail').length > 0){ etuPam += '¤tNumber=' + $('#' + innerHtmlId + ' div.thumbnail').length; } if(firstProdXuid != null && firstProdXuid.length > 0){ prods = firstProdXuid + ',' + prods; etuPam += '&pricate=' + firstProdCate; } $.ajax({ type: 'post', url: '/mall/cus/cat/Cc1c04.do?dc_btn_0=Func_Etu_RecoProd', data: 'dc_prods_0='+prods+'&type='+recoType+etuPam+'&keepKdid='+kdid, dataType: 'json', success: function(data) { var popHtml = ''; if(data!=null && data.length>0){ //組頁面 for(var i=0; i -1){ }else{ $(window).resize(); } if ("R" == htmlType && $('#'+innerHtmlId+'>li').length <= 1) { }else{ //顯示該區塊 displayArea(innerHtmlId); } } if (data!=null && ("H" == htmlType || "J" == htmlType)) { var btn_param = ''; if("J" == htmlType) btn_param = kdid; //建立看更多按鈕 buildBtnMoreProduct(innerHtmlId, btn_param); } if (data!=null && "K" == htmlType) { var backupProdXuid = ""; if(firstProdXuid != null && firstProdXuid.length > 0){ if(data.length > 0 && data[0].Fxuid == firstProdXuid){ backupProdXuid = data[0].Fxuid; }else{ backupProdXuid = firstProdXuid; } } var newProdHtmlId = backupProdXuid+'_'+kdid+'_reco_html'; backupHtmlById(newProdHtmlId, innerHtmlId); reBuildCurrentSlick(backupProdXuid, kdid); $('#'+innerHtmlId).parent().parent().find('.ht_loading').hide(); //GAP埋碼 gaDelaySet($('#'+innerHtmlId).find('li.slick-active').not("a.galoaded").find('a[data-prod]')); } if (typeof(eval(etuProdsCallBackFun))=='function') { eval(etuProdsCallBackFun)(data, queryName); }; return; }, error: function(xhr, ajaxOptions, thrownError) { //alert("取得推薦商品失敗!!"); } }); if(relatedInnerHtmlId != null && relatedInnerHtmlId.length > 0 && relatedInnerHtmlId != 'undefined'){ getRelateEtuProds(prods,recoType,relatedInnerHtmlId,htmlType,kdid,eturec,etuPam,queryName,excludeQueryName); } } function doEtuQuery() { // 統一補上group if ( typeof _qqueryList != 'undefined' ) { $.each(_qqueryList, function(keys,value){ $.each(value, function(keys2,value2){ value2['group'] = 'shopping'; }); }); } var er = document.createElement('script'); er.type = 'text/javascript'; er.async = true; er.src = erUrlPrefix+'er.js?'+(new Date().getDate()); var currentJs=document.getElementById('etu-recommender'); currentJs.parentNode.insertBefore(er,currentJs); }