';
buyHtml +='
';
buyHtml +='
'+data[i].name+' ';
buyHtml +='
';
buyHtml +='
';
buyHtml +='
';
buyHtml +='
加入购物车 ';
buyHtml +='
';
}
$("#lessulikeul").html(buyHtml);
$("#lessulike").show();
getProductActClubPrice(proIds.join(','),'handleBuyClubPrice');
}catch(e){
$("#lessulike").hide();
}
try{
/*
此处请添加展示推荐栏的回调方法,
参数data为我们返回的商品信息数组
烦请加上判断,如果没有返回值的话隐藏推荐栏,或者展示您之前自己的推荐栏
请在推荐栏中加入百分点的中文logo,具体实例请参考http://www.baifendian.com/service/logo.html
*/
_BFD.bind(data,"sryRecCAC",req_id,banner_id,true)//此处是推荐返回时百分点绑定事件的方法,请不要修改。
//参数Onshow 为boolean类型,取值为true 或者 false 。取值为true的时候,展示的是百分点的推荐栏。取值为false的时候,展示的是百分点的推荐栏。
}catch(e2){}
}
// 等待3秒如果百分点没有回调数据,显示我们自己的数据
// setTimeout("if(!"+DAD+"){$('#lessulikeul').show();}",3000);
}
//搜索页-猜你喜欢 no
function searchnoulike(){
var srnRec = false;
_BFD.srnRec = function(data,bid,req_id){
srnRec = true;
try{
var srcs = ["5894","5895","5896","5897","5898","5899","5900","5901","5902","5903","6188","6189","6190","6191","6192"];
//此处请添加推荐栏的回调方法,参数data为我们返回的商品信息数组
//如果只返回商品ID,data格式为["item1","item2","item3"]这样的数组。
//如果商品信息全返回,data格式为[{"iid":"item1","img":"http://images.*.com/**.jpg","name":"商品1","price":10.0,"url":"http://**"},{"iid":"item2","img":"http://images.*.com/**.jpg","name":"商品2","price":120.0,"url":"http://**"}]
//推荐栏请添加百分点的logo,详见:http://www.baifendian.com/service/logo.html
var indexTabConHtml = '';
for(var i=0;i
'+data[i].name+'
';
}
$('#noulikeul').html(indexTabConHtml);
handleListTabBox();
}catch(e){
srnRec = false;
}
try{
_BFD.bind(data,"srnRec",bid,req_id,true);//此处是推荐返回时百分点绑定事件的方法,请不要修改。
}catch(e2){
}
}
setTimeout("if(!"+srnRec+"){handleListTabBox();}",3000);
}
//搜索页-新品推荐
function searchnew(){
//搜索有结果页的“新品推荐”的推荐栏调用下面的这个方法
var EAE = false;
_BFD.sryRecN = function(data,req_id,banner_id){
EAE = true;
try{
var srcs = ["7105","7106","7107","7108","7109","7110","7111","7112","7113","7114","7115","7116","7117","7118","7119","7120","7121","7122","7123","7124"];
var buyHtml = '';
var proIds=[];
for(var i=0;i';
}
$("#morenewul").html(buyHtml);
getProductActClubPrice(proIds.join(','),'handleBuyClubPrice');
}catch(e){
$("#morenew").hide();
}
try{
/*
此处请添加展示推荐栏的回调方法,
参数data为我们返回的商品信息数组
烦请加上判断,如果没有返回值的话隐藏推荐栏,或者展示您之前自己的推荐栏
请在推荐栏中加入百分点的中文logo,具体实例请参考http://www.baifendian.com/service/logo.html
*/
_BFD.bind(data,"sryRecN",req_id,banner_id,true)//此处是推荐返回时百分点绑定事件的方法,请不要修改。
//参数Onshow 为boolean类型,取值为true 或者 false 。取值为true的时候,展示的是百分点的推荐栏。取值为false的时候,展示的是百分点的推荐栏。
}catch(e2){}
}
// 等待3秒如果百分点没有回调数据,显示我们自己的数据
// setTimeout("if(!"+EAE+"){$('#morenew').show();}",3000);
}
/**
* 处理详情页猜你喜欢价格
*/
function handleDetailGuessPrice(priceData){
priceData=eval("("+priceData+")");
//priceData=priceData.data;
for ( var proId in priceData) {
var proPrices = priceData[proId];
jQuery("[goodId='" + proId + "']").html('¥' + parseFloat(proPrices.promoPrice).toFixed(2));
if(proPrices.clubPrice !=undefined && proPrices.clubPrice!=null && proPrices.clubPrice!='null') {
jQuery("[goodId='" + proId + "']").siblings('span').find('em').html('¥' + parseFloat(proPrices.clubPrice).toFixed(2));
jQuery("[goodId='" + proId + "']").siblings('span').css('display','inline-block');
}
}
}
//处理首页推荐价格
function handleIndexTabBox() {
var proIds=[];
$('.indexTabBox [goodId]').each(function(i){
var id=$(this).attr("goodId");
proIds.push(id);
});
getProductActPrice(proIds.join(','),'handleSpiritHomePagePrice');
}
//处理首页优惠推荐
function handleYouHuiBoxLoop(){
var loadFirstHtml = $('.loadFirst').html();
if(loadFirstHtml == ''){
setTimeout("handleYouHuiBoxLoop()",100);
}else{
if($('.loadFirst .receBoxs') != null && typeof($('.loadFirst .receBoxs')) !='undefined'){
$('.loadFirst .receBoxs').html(hpRechuiHtml);
handleIndexYouHuiBox();
}
}
}
//处理首页优惠推荐价格
function handleIndexYouHuiBox() {
var proIds=[];
$('.raceList [goodId]').each(function(i){
var id=$(this).attr("goodId");
proIds.push(id);
});
getProductActPrice(proIds.join(','),'handleSpiritHomePagePrice');
}
//处理搜索列表页 推荐价格
function handleListTabBox() {
var proIds=[];
$('.indexTabPrice [goodId]').each(function(i){
var id=$(this).attr("goodId");
proIds.push(id);
});
// getProductActPrice(proIds.join(','),'handleListPrice');
getProductActClubPrice(proIds.join(','),'handleBuyClubPrice');
}
function handleIndexTabBoxLoop(){
// 回调成功或者回调后报错加载价格
if((showRecVAV && hpRecVAV)){
$('.indexTabCon').eq(0).show();
handleIndexTabBox();
}else{
setTimeout("handleIndexTabBoxLoop()",50);
}
}
// 处理列表页最终购买推荐价格
function handleBuyPrice(priceData) {
priceData =eval("("+priceData+")");
//priceData =priceData.data;
for (var proId in priceData) {
var proPrices = priceData[proId];
$("#buy_"+proId).text("¥" + proPrices);
}
}
//处理列表页最终购买推荐价格
function handleBuyClubPrice(priceData) {
priceData =eval("("+priceData+")");
for (var proId in priceData) {
var proPrices = priceData[proId];
$("#buy_"+proId).text("¥" + proPrices.promoPrice);
if(proPrices.clubPrice && proPrices.clubPrice!='null') {
$("#buy_"+proId).siblings('span').html("¥"+ proPrices.clubPrice+" ");
}
}
}
//处理列表页热卖推荐价格
function handleRecommendPrice(priceData) {
priceData =eval("("+priceData+")");
//priceData =priceData.data;
for (var proId in priceData) {
var proPrices = priceData[proId];
$("#recommend_"+proId).text("¥" + proPrices);
}
}
//处理列表页热卖推荐评论数
function handleRecommendComments(ids) {
try{
jQuery.ajax({
type:"get",url:"/proComments.htm?t="+new Date().getTime(),
data:{"ids":ids},
dataType:"json",
success:function(data){
var idsArray = ids.split(",");
for(var i=0;i');
}
}
}
function handleCartComment(idsStr) {
$.get("/getComment.htm",{idsStr:idsStr},function(data){
data =eval("("+data+")");
if(data.suc) {
for (var key in data.body) {
$("#comment_"+key).text(data.body[key] + "人已评价");
}
}
});
}
//处理会员首页推荐价格
function handleUserCenterPagePrice(priceData) {
priceData=eval("("+priceData+")");
//priceData=priceData.data;
for ( var proId in priceData) {
var proPrices = priceData[proId];
$(".userCenter_nowPrice_" + proId).text("¥" + proPrices);
$(".userCenter_marketPrice_" + proId).text("¥" + proPrices);
}
};
// 执行百分点推送与回调数据代码
function loadBFD(){
bfd_client_id = bfd_client_id || "Ctest_jiuxian";
if(_BFD.BFD_INFO && _BFD.BFD_INFO.id != null){
window["_BFD"] = window["_BFD"] || {};
_BFD.client_id = bfd_client_id;
if(window.getWareIdByRgnId){
_BFD.city=getWareIdByRgnId();
}
_BFD.script = document.createElement("script");
_BFD.script.type = "text/javascript";
_BFD.script.async = true;
_BFD.script.charset = "utf-8";
_BFD.script.src = (('https:' == document.location.protocol?'https://ssl-static1':'http://static1')+'.bfdcdn.com/service/jiuxianwang/jiuxianwang.js');
document.getElementsByTagName("head")[0].appendChild(_BFD.script);
}else{
setTimeout("loadBFD();",200);
}
}
function getPriceAndRespSals4Clear(proIds,flag,type){
var proNum = 0;
jQuery.ajax({
url : "/getPriceAndRespSals.htm?t=" +new Date().getTime() + "&proIds=" + proIds,
dataType : "json",
success : function(data) {
for ( var pId in data) {
var rep = data[pId]["respNum"];
var nowPrice = data[pId]["price"];
$("#rep" + pId).html(rep);
if(nowPrice.toString().indexOf(".") > -1){
$("#nowPrice" + pId).html(nowPrice+"0");
}else{
$("#nowPrice" + pId).html(nowPrice + ".00");
}
if(rep<1){
var $target = $("#nowPrice" + pId).parents("li");
var dataUnit={"goodId":"","src":"","url":"","goodName":"","goodPrice":"","goodSale":""}
dataUnit["goodId"] = pId;
dataUnit["goodPrice"] = $("#nowPrice" + pId).text();
dataUnit["goodSale"] = $target.find(".goodSale").text();
$target.remove();
}
}
}
});
}
/*
function getPriceAndRespSals4MP(proIds,flag,type){
var proNum = 0;
jQuery.ajax({
url : "http://clear.jiuxian.com/getPriceAndRespSals.htm?t=" +new Date().getTime() + "&proIds=" + proIds,
dataType : "json",
success : function(data) {
for ( var pId in data) {
var rep = data[pId]["respNum"];
var nowPrice = data[pId]["price"];
$("#rep" + pId).html(rep);
if(nowPrice.toString().indexOf(".") > -1){
jQuery("span[goodId='"+pId+"']").html(nowPrice+"0");
}else{
jQuery("span[goodId='"+pId+"']").html(nowPrice+".00");
}
}
}
});
}
*/
function getPriceAndRespSals4MP(proIds,flag,type){
var proNum = 0;
var target_url = "http://clear.jiuxian.com/getPriceAndRespSals.htm?t=" +new Date().getTime() + "&proIds=" + proIds;
jQuery.ajax({
type: "GET",
url: "/httpProxyAccess.htm?t=" + new Date().getTime(),
data: {
target: target_url
},
dataType : "json",
success : function(data) {
for ( var pId in data) {
var rep = data[pId]["respNum"];
var nowPrice = data[pId]["price"];
$("#rep" + pId).html(rep);
if(nowPrice.toString().indexOf(".") > -1){
jQuery("span[goodId='"+pId+"']").html(nowPrice+"0");
}else{
jQuery("span[goodId='"+pId+"']").html(nowPrice+".00");
}
}
}
});
}
function emptyFunction(data){
var length = data.length;
var i = 0;
//$("#no_product_buy").empty();
for(i=0; i '+
'
';
var $li = $(li);
$li.find("a").attr("href",data[i]["url"]);
$li.find(".item_img").attr("src",data[i]["src"]);
$li.find(".goodName").text(data[i]["goodName"]);
$li.find(".goodPrice").text(data[i]["goodPrice"]);
$li.find(".goodSale").text(data[i]["goodSale"]);
$("#no_product_buy").append($li);
}
}