2 Star 1 Fork 2

徐子玉 / 品贷网

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
store-2.html 37.88 KB
一键复制 编辑 原始数据 按行查看 历史
徐子玉 提交于 2017-07-05 11:21 . + pdw
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>品代网(www.pdw123.com)--国内首家建材行业供应链交易平台,F2B2C运营模式开创网络建材市场新纪元</title>
<meta name="keywords" content="代理,加盟,招商,批发,零售,掌上建材,PPR,PVC,PE,管材,管件,波纹管,缠绕管,卫浴,陶瓷,龙头,浴缸,地漏,吊顶,灯具,开关,插线板,插座,电线,电缆,水暖五金,地板,油漆,地暖,太阳能,净水器,装修材料" />
<meta name="description" content="品代网(www.pwd123.com)是中国首家采用云管理系统,互联网加实体营销管理为一体的交易平台。专业的建材行业综合网上购物平台,销售管材管件,水暖卫浴,厨卫洁具,灯具开关,板材五金,油漆涂料,电线电缆,家装材料,建筑材料,五金配件,防水等。正品低价,品质保证,便捷操作,诚信服务">
<link rel="shortcut icon" href="favicon.ico" />
<meta name="author" content="Administrator">
<!--<meta name="viewport" content="width=device-width; initial-scale=1.0">-->
<meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=yes">
<link rel="stylesheet" href="css/head.css" />
<link rel="stylesheet" href="css/index2.css" />
<link rel="stylesheet" href="css/topbannerSecond.css" />
<link rel="stylesheet" href="css/indent.css" />
<link rel="stylesheet" href="css/add.css" />
<link rel="stylesheet" href="css/shopListing.css" />
<link rel="stylesheet" href="css/footercom.css" />
<link rel="stylesheet" href="css/ProductListing.css" />
<link rel="stylesheet" href="css/factory_listing.css" />
<link rel="stylesheet" href="css/flickerplate1.css" />
<link rel="stylesheet" href="css/page.css" />
<link rel="stylesheet" href="css/jPages.css" />
<!--轮播插件-->
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<script src="js/jquery-1.7.2.min.js"></script>
<script src="js/jPages.js"></script>
</head>
<body>
<!-- gg_top -->
{$ad_head_html}
<!-- top_header 顶部 -->
{$user_head_html}
<!-- top-main-->
{$search_head_html}
<!--商城头部-->
<div id="topbannerThird">
<div id="shop_header" class="wrap_1200 clearfix">
<div class="shop_logo" id="logo">
<!-- <a href="javascript:;"><img src="images/images/images/ruihe01.jpg" /></a>-->
</div>
<div class="shop_search">
<input class="shop_search_input" type="text" value="店铺产品搜索" onfocus="if (value == '店铺产品搜索') {value = ''}" onblur="if (value == '') {value = '店铺产品搜索'}" />
<a href="javascript:;" class="shop_search_inputBtn">&nbsp;&nbsp;</a>
</div>
<div class="shop_button">
<div class="shop_button1">申请代理</div>
<ul class="shop_button2" style="display: none;">
<li id="btn1" proxyLv="1">申请总代理</li>
<li id="btn2" proxyLv="2">申请区域代理</li>
<li id="btn3" proxyLv="3">申请乡镇代理</li>
</ul>
</div>
<div class="shop_collert">
<img src="images/images/shoucangShop.jpg" />
<div class="shop_guanzhu" cs="0">
<i class="guanzhu_xin"></i>
<span>收藏</span>
</div>
<div class="shop_guanzhu1" cs="1" style="display:none ;">
<i class="guanzhu_hongxin"></i>
<span>收藏</span>
</div>
</div>
</div>
</div>
<!--商城主页-->
<div id="shopMain">
<div class="shopNavigation">
<div class="shopMiddleNav wrap_1200 clearfix">
<ul class="nav">
<li><a href="index.php">首页</a></li>
<li><a id="about_product" href="">产品中心</a></li>
<li><a id="about_href" href="">关于厂家</a></li>
</ul>
</div>
</div>
<div class="carousel">
<ul>
<li data-background="img/carousel_bgf.jpg"></li>
<!--<li data-background="img/carousel_bg2.jpg"></li>
<li data-background="img/carousel_bg3.jpg"></li>
<li data-background="img/carousel_bg4.jpg"></li>-->
</ul>
</div>
<div class="shopList_Main wrap_1200 clearfix" style="margin-top:35px">
<div class="shopList_left">
<div id="p_name" class="shopCase_service">
</div>
<div class="shopCase_sort">
<div class="shopCase_shopSearch">
<i class="icon_search"></i>
<span>宝贝分类</span>
</div>
<div class="shopCase_shangpin">
<div class="shopCase_chakan">
<i class="icon_Sort"></i>
<i class="icon_allSort" style="display: none;"></i>
<span>查看所有宝贝</span>
</div>
</div>
<div class="shopCase_detail clearfix">
<ul id="p_factory">
</ul>
</div>
</div>
<div class="shopCase_search">
<div class="shopCase_shopSearch shopListing_box">
<i class="icon_search"></i>
<span>本店搜索</span>
</div>
<div class="shopCase_keyWord">
<div class="keyWord_text">
<span class="keyWord_text1">关键字:</span><input type="text" class="keyWord" />
</div>
<div class="search_btn">搜索</div>
</div>
</div>
<div class="shopCase_recommendation">
<div class="shopCase_shopSearch">
<i class="icon_search"></i>
<span>产品推荐</span>
</div>
<div class="shopCase_picWall">
</div>
</div>
</div>
<div class="shopList_right clearfix">
<div class="shopCase_listing clearfix" id="itemContainer" fst="0">
</div>
<div class="holder">
</div>
</div>
</div>
</div>
<!--sidebar-->
{$sidebar_html}
<!--footer-->
<div class="comfooter">
{$foot_html}
</div>
<!-- <script src="js/jquery-1.8.3.min.js"></script>-->
<script src="js/flickerplate.min.js"></script>
<script src="js/modernizr-custom-v2.7.1.min.js"></script>
<!--lunbo-->
<script>
var per_page = 16; //每页16条
$(document).ready(function() {
$('.carousel').flicker({
arrows: true,
arrows_constraint: false,
auto_flick: false,
auto_flick_delay: 3,
block_text: true,
dot_navigation: true,
dot_alignment: 'center',
flick_animation: 'transition-slide',
flick_position: 1,
inner_width: false,
theme: 'light'
});
});
</script>
<script type="text/javascript">
$(document).bind('click', function(e) {
var target = $(e.target);
if (target.closest(".MidCasePullDown,.MidCase_ProSel").length == 0) {
$(".MidCasePullDown").hide();
}
e.stopPropagation();
});
$(document).ready(function() {
(function($) {
$.getUrlParam = function(name) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
var r = window.location.search.substr(1).match(reg);
if (r != null)
return unescape(r[2]);
return null;
};
})(jQuery);
var factoryId = $.getUrlParam('id');
var factoryIds = $.getUrlParam('id');
var seriesId = $.getUrlParam('seriesId');
$("#about_href").attr("href", "store_info.php?id=" + factoryId);
$("#about_product").attr("href", "store.php?id=" + factoryId);
//厂家导航
nav(factoryId);
logo(factoryId);
RecommendProduct(factoryId);
factoryName(factoryId);
loadData(1,0);
var recordCount = $('#itemContainer').attr("recordCount");
if (recordCount > per_page) {
pagination(recordCount);
}
//页数的变化
$('.FinalCase_Text').click(function() {
$(this).addClass('active').siblings().removeClass('active');
});
//点击收藏
$('#btn').click(function() {
$.post("api.php?act=collectState", {
factoryId: factoryId,
userProxyId: userProxyId
}, function(data) {
if (data == 1) {
alert('您已经该厂家,请不要重复收藏!');
}
else {
if (userId != 0) {
var state = 0;
$('.shop_guanzhu').hide();
$('.shop_guanzhu1').show();
$.post("api.php?act=collect", {
factoryId: factoryId,
status: state
}, function(data) {});
alert('厂家收藏成功');
}
else {
alert('请您先登录再收藏厂家');
}
}
});
});
$('.shop_button1').click(function() {
$('.shop_button2').show();
});
//点击关注
var userId = {$userId};
$('.shop_guanzhu').click(function() {
$.post("api.php?act=collectState", {
factoryId: factoryId,
userProxyId: userProxyId
}, function(data) {
if (data == 1) {
alert('您已经该厂家,请不要重复收藏!');
} else {
if (userId != 0) {
var state = 0;
$('.shop_guanzhu').hide();
$('.shop_guanzhu1').show();
$.post("api.php?act=collect", {
factoryId: factoryId,
status: state
}, function(data) {});
alert('厂家收藏成功');
} else {
alert('请您先登录再收藏厂家');
}
}
});
});
$('.shop_guanzhu1').click(function() {
if (userId != 0) {
var state = 1;
$('.shop_guanzhu1').hide();
$('.shop_guanzhu').show();
$.post("api.php?act=collect", {
factoryId: factoryId,
status: state
}, function(data) {});
alert('已取消收藏');
}
else {
alert('请您先登录再收藏厂家');
}
});
$('.shopCase_chakan').toggle(function() {
$('.icon_allSort').hide();
$('.icon_Sort').show();
$('.shopCase_detail').show();
}, function() {
$('.icon_allSort').show();
$('.icon_Sort').hide();
$('.shopCase_detail').hide();
});
// 宝贝分类,点击查看更多宝贝
$('.shopCase_detail ul li').click(function() {
var detailLi = $('.shopCase_detail ul li');
if (!$(this).hasClass('liac')) {
detailLi.removeClass('liac').find('i').removeClass('yellowchencked').addClass('chencked').end().find('span').removeClass('active');
$(this).addClass('liac');
$(this).find('i').removeClass('chencked').addClass('yellowchencked');
$(this).find('span').addClass('active');
loadData(1,1);
$('#itemContainer').attr("fst", "0");
var recordCount = $('#itemContainer').attr("recordCount");
if (recordCount > per_page) {
pagination(recordCount);
$(".holder").show();
} else {
$(".holder").hide();
}
} else {
$(this).removeClass('liac');
$(this).find('i').removeClass('yellowchencked').addClass('chencked');
$(this).find('span').removeClass('active');
}
});
//厂家名称
function factoryName(factoryId) {
$.ajax({
type: "post",
url: "api.php?act=factoryLogo",
async: false,
data: {
factoryId: factoryId,
},
success: function(data) {
if (data != "") {
data = $.parseJSON(data);
var html = '';
$.each(data, function(n, value) {
//console.info(value);
if (n < 1) {
html += '<div class="shopCase_text" name="searchPoint">' + value.Abbreviation + '</div>';
html += '<div class = "shopCase_text1" >';
//html += '<div class = "shopCase_textTop"><span> 品代客服 </span><i class="icon_checke"></i></a></div>';
html += '<div class = "shopCase_button">';
html += '<div class = "shopCase_btn active"> <a href="quickorder.php?factoryId=' + factoryId + '">快速下单</a> </div>';
html += '<div id="btn" class = "shopCase_btn"> 收藏厂家 </div>';
html += '</div>';
html += '</div>';
}
});
$('#p_name').html(html);
}
}
});
}
//产品列表
function productLists(searchText, factoryIds, seriesId, typeId, subTypeId, userProxyId, pageIndex, pageSize) {
$.ajax({
type: "post",
url: "api.php?act=product",
async: false,
data: {
searchText: searchText,
factoryIds: factoryIds,
seriesId: seriesId,
typeId: typeId,
subTypeId: subTypeId,
userProxyId: userProxyId,
pageIndex: pageIndex,
pageSize: pageSize
},
success: function(data) {
if (data != "") {
data = $.parseJSON(data);
var userId = {$userId};
var html = '';
var c_price = '';
var c_originalPrice = '';
var originalPrice = '';
var c_discount = '';
$.each(data, function(n, value) {
html += '<div class="shopCase_ProBox">';
html += '<div class="shopPicTop"><a target="_blank" class="pic" nid="' + value.FactoryName + '" pid="' + value.productId + '" cid="' + value.FactoryId + '" href="product.php?factoryId=' + value.FactoryId + '&productId=' + value.productId + '"><img src="' + value.picUrl + '" class="shopCase_ProPic" /></a></div>';
html += '<div class="shopCase_ProGroup">';
html += '<div class="shopCase_Protext"><span class="shopNameTil">' + value.FactoryName + '</span><span class="title">' + value.productName + '</span></div>';
html += '<div class="MidCase_Protext1"><span>' + value.Type + '</span></div>';
var count_nn = 1;
var unitoption = '';
var standardHtml = '';
var coloroption = '';
var fstStandard = "";
var unitArr = new Array();
var colorArr = new Array();
if (value.productStandard != null) {
$.each(value.productStandard, function(m, l) {
$('#itemContainer').attr("recordCount", value.recordCount);
if (m == 0) {
fstStandard = l.Standard;
}
if ($.inArray(l.Unit, unitArr) < 0) {
unitArr.push(l.Unit)
}
if ($.inArray(l.ColorName, colorArr)) {
colorArr.push(l.ColorName)
}
if (l.Unit == unitArr[0]) {
standardHtml += '<li color="' + l.ColorName + '" unit="' + l.Unit + '"originalPrice ="' + l.originalPrice + '" price="' + l.price + '">' + l.Standard + '</li>';
} else {
standardHtml += '<li style="display:none;" unit="' + l.Unit + '"originalPrice ="' + l.originalPrice + '" price="' + l.price + '"color="' + l.ColorName + '">' + l.Standard + '</li>';
}
if (count_nn == 1) {
c_price = l.price;
c_originalPrice = l.originalPrice;
c_discount = Number(l.discount);
}
count_nn++;
});
}
html += '<div id="color" class="MidCase_choose clearfix">';
html += '<span>颜色:</span>';
html += '<div class="chooseMidCase">';
html += '<div class="MidCase_ProSel">';
html += '<p id="selectedColor">' + colorArr[0] + '</p>';
html += '<i class="yelloSanjiao"></i>';
html += '</div>';
html += '<ul class="MidCasePullDown" style="display:none ;">';
$.each(colorArr, function(y, c) {
html += '<li>' + c + '</li>';
});
html += '</ul>';
html += '</div>';
html += '</div>';
html += '<div id="unit" class="MidCase_choose clearfix">';
html += '<span>单位:</span>';
html += '<div class="chooseMidCase">';
html += '<div class="MidCase_ProSel">';
html += '<p id=selectedUnit>' + unitArr[0] + '</p>';
html += '<i class="yelloSanjiao"></i>';
html += '</div>';
html += '<ul class="MidCasePullDown" style="display:none ;">';
$.each(unitArr, function(x, u) {
html += '<li>' + u + '</li>';
});
html += '</ul>';
html += '</div>';
html += '</div>';
html += '<div id="size" class="MidCase_choose clearfix">';
html += '<span>规格:</span>';
html += '<div class="chooseMidCase">';
html += '<div class="MidCase_ProSel">';
html += '<p id="selectedStandard">' + fstStandard + '</p>';
html += '<i class="yelloSanjiao"></i>';
html += '</div>';
html += '<ul class="MidCasePullDown listStandard" style="display:none ;">';
html += standardHtml;
html += '</ul>';
html += '</div>';
html += '</div>';
html += '<div id="divPrice" class="MidCase_Protext2">单价:<span id="price" class="MidCase_Protext3">' + c_price + '</span><span id="originalPrice" class="MidCase_Protext4">' + c_originalPrice + '</span></div>';
html += '<div id="number" class="MidCase_Protext2">数量:<div class="detailsMid_btn">-</div><input id="MidCase_text_box" name="goodnum" class="num" type="text" value="1" style="width:60px;text-align: center;" /><div class="detailsMid_btn1">+</div></div>';
if (userId > 0) {
if (c_discount == 10) {
html += '<div class="MidCase_Protext2">折扣:无折扣</div>';
} else {
html += '<div class="MidCase_Protext2">折扣:' + c_discount + '折</div>';
}
} else {
html += '<div class="MidCase_Protext2">折扣:注册会员享受优惠!</div>';
}
html += '<div class="MidCase_Protext5">';
html += '<div class="MidCase_Protext6">立即结算</div>';
html += ' <div class="MidCase_Protext7">加入购物车</div>';
html += '</div>';
html += '</div>'
html += '</div>';
html += '</div>';
html += '</div>';
});
$('.shopCase_listing').html(html);
$(function() {
$('.shopCase_ProPic').each(function() {
var shopWidth = $(this).width();
var shopHeight = $(this).height();
if (shopWidth > shopHeight) {
$(this).css({
"max-width": "238px",
"width": "auto",
"height": "156px"
});
} else if ((shopWidth <= shopHeight)) {
$(this).css({
"max-height": "156px",
"width": "238px",
"height": "156px"
});
};
});
});
//下拉框点击事件
$('.MidCase_ProSel').on('click', function() {
$(this).parents('.MidCase_choose').siblings('.MidCase_choose').find('ul').hide();
$(this).siblings('.MidCasePullDown').find('ul').hide();
if ($(this).parent('.chooseMidCase').find('ul').is(":hidden")) {
$(this).parent('.chooseMidCase').find('ul').show();
} else {
$(this).parent('.chooseMidCase').find('ul').hide();
}
});
$('.MidCasePullDown li').click(function() {
var till = $(this).html();
$(this).parents('.chooseMidCase').find('.MidCase_ProSel p').html(till);
$('.MidCasePullDown').hide();
var selectedColor = $(this).parents('.shopCase_ProGroup').find('#selectedColor').html();
var selectedUnit = $(this).parents('.shopCase_ProGroup').find('#selectedUnit').html();
$(this).parents('.shopCase_ProGroup').find('.listStandard li').each(function() {
if (!($(this).attr('unit') == selectedUnit)) {
$(this).hide();
// var originalprice = $(this).attr('originalprice');
// console.info(originalprice);
//$('#divPrice').find('#originalprice').html(originalprice);
} else {
$(this).show();
//alert(originalprice);
}
});
if (!$(this).parents('.MidCasePullDown').hasClass('listStandard')) {
$(this).parents('.shopCase_ProGroup').find('.listStandard').show();
$(this).parents('.shopCase_ProGroup').find('#selectedStandard').html($(this).parents('.shopCase_ProGroup').find('.listStandard li:visible:first').html());
$(this).parents('.MidCase_choose').siblings('#divPrice').find('#price').html($(this).parents('.shopCase_ProGroup').find('.listStandard li:visible:first').attr('price'));
$(this).parents('.MidCase_choose').siblings('#divPrice').find('#originalPrice').html($(this).parents('.shopCase_ProGroup').find('.listStandard li:visible:first').attr('originalPrice'));
$(this).parents('.shopCase_ProGroup').find('.listStandard').hide();
} else {
$(this).parents('.MidCase_choose').siblings('#divPrice').find('#price').html($(this).attr('price'));
$(this).parents('.MidCase_choose').siblings('#divPrice').find('#originalPrice').html($(this).attr('originalprice'));
}
});
//数量加
$(".detailsMid_btn1").click(function() {
var num = $(this).siblings(".num");
if (num.val() < 999) {
num.val(parseInt(num.val()) + 1); //数量框+1
$(".detailsMid_btn1").attr("enabled", "true");
} else {
num.val(999);
$(".detailsMid_btn1").attr({
"border-color": "#000",
"color": "#ccc"
});
$(".detailsMid_btn1").attr("enabled", "false");
}
});
//数量减
$(".detailsMid_btn").click(function() {
var num = $(this).siblings(".num");
if (num.val() > 1) {
num.val(parseInt(num.val()) - 1);
$(".detailsMid_btn").attr("enabled", "true");
} else {
num.val(1);
$(".detailsMid_btn").attr({
"border-color": "#000",
"color": "#ccc"
});
$(".detailsMid_btn").attr("enabled", "false");
}
});
var userId = {$userId};
//加入购物车
$('.MidCase_Protext7').bind('click', function() {
if (userId > 0) {
var cartId = $(this).parents('.shopCase_ProBox').find('.shopPicTop a').attr('cid');
var itemId = $(this).parents('.shopCase_ProBox').find('.shopPicTop a').attr('pid') //商品ID
var title = $(this).parents('.MidCase_Protext5').siblings('.shopCase_Protext').find('.title').text(); //获取名称
var specUnit = $(this).parents('.MidCase_Protext5').siblings('#unit').children('.chooseMidCase').children('.MidCase_ProSel').find('#selectedUnit').text(); //获取颜色
var spec = $(this).parents('.MidCase_Protext5').siblings('#size').children('.chooseMidCase').children('.MidCase_ProSel').find('#selectedStandard').text(); //获取规格
var specPrices = $(this).parents('.MidCase_Protext5').siblings('#divPrice').find('#price').text(); //规格单价
var specOriginalPrices = $(this).parents('.MidCase_Protext5').siblings('#divPrice').find('#originalPrice').text(); //规格原价
var count = $(this).parents('.MidCase_Protext5').siblings('#number').find('#MidCase_text_box').val(); //获取数量
var showPic = $(this).parents('.MidCase_Protext5').parents('.shopCase_ProGroup').siblings('.shopPicTop').children('.pic').find(".shopCase_ProPic").attr('src'); //商品图片
var factory = $(this).parents('.MidCase_Protext5').parents('.shopCase_ProGroup').siblings('.shopPicTop').find('.pic').attr('nid'); //厂家名称
var color = $(this).parents('.MidCase_Protext5').siblings('#color').children('.chooseMidCase').children('.MidCase_ProSel').find('#selectedColor').text(); //颜色
if (count.match(/(^\d{1,3}$)/)) {
var val = parseInt(count);
if (val > 999 || val < 1) {
alert('每件商品一次下单只允许1-999件。');
} else {
var cartHelper = new ShoppingCartHelper(userId, cartId, factory);
cartHelper.Init();
cartHelper.Addnew(itemId, title, count, specOriginalPrices, specPrices, specUnit, spec, showPic, color);
//console.info(itemId, title, count, specOriginalPrices, specPrices, specUnit, spec, showPic, color);
//加入购物车效果
alert('添加成功');
var flyElm = $(this).parents('.shopCase_ProGroup').siblings('.shopPicTop').children('.pic').find('.shopCase_ProPic').clone().css('opacity', '0.7').addClass('cancelimg');
flyElm.css({
'z-index': 9000,
'display': 'block',
'position': 'absolute',
'top': $(this).offset().top + 'px',
'left': $(this).offset().left + 'px',
'width': 50 + 'px',
'height': 50 + 'px',
'border-radius': 25 + 'px',
});
$('body').append(flyElm);
flyElm.animate({
top: $('.mycart').offset().top,
left: $('.mycart').offset().left,
width: 0,
height: 0,
}, 'slow');
var user_id = {$userId};
if (user_id > 0) {
var shopping = new ShoppingCartList(user_id);
var list = shopping.Read();
var goods_count = 0;
$.each(list, function(n, id) {
var store = new ShoppingCartHelper(user_id, id);
if (store.Count() > 0) {
var cart = store.Read();
$.each(cart.Items, function(n, item) {
goods_count++;
});
}
});
$('.shoppingText').text(goods_count);
}
}
}
else {
alert('请重新输入一个有效的正整数。');
}
}
else {
alert('要加入购物车?请先登录品代网!');
var url = window.location.href;
var path = url.substr(url.lastIndexOf('/'), url.length - url.lastIndexOf('/'));
window.location.href = 'login.html?path=' + path;
}
});
//立即结算
$('.MidCase_Protext6').bind('click', function() {
if (userId > 0) {
var cartId = $(this).parents('.shopCase_ProBox').find('.shopPicTop a').attr('cid');
var itemId = $(this).parents('.shopCase_ProBox').find('.shopPicTop a').attr('pid') //商品ID
var title = $(this).parents('.MidCase_Protext5').siblings('.shopCase_Protext').find('.title').text(); //获取名称
var specUnit = $(this).parents('.MidCase_Protext5').siblings('#unit').children('.chooseMidCase').children('.MidCase_ProSel').find('#selectedUnit').text(); //获取颜色
//alert(specUnit);
var spec = $(this).parents('.MidCase_Protext5').siblings('#size').children('.chooseMidCase').children('.MidCase_ProSel').find('#selectedStandard').text(); //获取规格
var specPrices = $(this).parents('.MidCase_Protext5').siblings('#divPrice').find('#price').text(); //规格单价
var specOriginalPrices = $(this).parents('.MidCase_Protext5').siblings('#divPrice').find('#originalPrice').text(); //规格原价
var count = $(this).parents('.MidCase_Protext5').siblings('#number').find('#MidCase_text_box').val(); //获取数量
// alert(count);
var showPic = $(this).parents('.MidCase_Protext5').parents('.shopCase_ProGroup').siblings('.shopPicTop').children('.pic').find(".shopCase_ProPic").attr('src'); //商品图片
// console.info($(this));
var factory = $(this).parents('.MidCase_Protext5').parents('.shopCase_ProGroup').siblings('.shopPicTop').find('.pic').attr('nid'); //厂家名称
var color = $('#selectedColor').text(); //颜色
if (count.match(/(^\d{1,3}$)/)) {
var val = parseInt(count);
// alert(val);
if (val > 999 || val < 1) {
alert('每件商品一次下单只允许1-999件。');
} else {
var cartHelper = new ShoppingCartHelper(userId, cartId, factory);
cartHelper.Init();
cartHelper.Addnew(itemId, title, count, specOriginalPrices, specPrices, specUnit, spec, showPic, color);
//console.info(itemId, title, count, specOriginalPrices, specPrices, specUnit, spec, showPic, color);
location.href = "cart.php";
}
} else {
alert('请重新输入一个有效的正整数。');
}
} else {
alert('要下单?请先登录品代网!');
var url = window.location.href;
var path = url.substr(url.lastIndexOf('/'), url.length - url.lastIndexOf('/'));
window.location.href = 'login.html?path=' + path;
}
});
} else {
$('#ownerList').attr("recordCount", "0");
//alert('你搜索的产品不存在,请重新输入');
}
}
})
}
//获取厂家logo
function logo(factoryId) {
$.ajax({
type: "post",
url: "api.php?act=factoryLogo",
async: false,
data: {
factoryId: factoryId,
},
success: function(data) {
if (data != "") {
data = $.parseJSON(data);
var html = '';
$.each(data, function(n, value) {
html += '<a href="store.php?seriesId=' + seriesId + '&id=' + factoryId + '"><img src="' + value.Logo + '" /></a>';
});
$('.shop_logo').html(html);
}
}
});
}
//分页
function pagination(recordCount) {
$(".holder").jPages({
containerID: "itemContainer",
first: '首页',
last: '尾页',
previous: '上页',
next: '下页',
totalItemCount: recordCount,
perPage: per_page,
startPage: 1,
startRange: 1,
midRange: 5,
endRange: 1,
keyBrowse: true,
callback: function(pages, items) {
if ($('#itemContainer').attr("fst") == '0') {
$('#itemContainer').attr("fst", "1");
} else {
$('.cancelimg').remove();
loadData(pages.current,1);
}
}
});
}
function loadData(pageIndex,type) {
var searchText = $('.keyWord').val();
var factoryId = $.getUrlParam('id');
var factoryIds = $.getUrlParam('id');
var seriesId = $.getUrlParam('seriesId');
var out_flag = $.getUrlParam('outFlag');
var subTypeId = 0;
if (type == 0) {
var typeId = $.getUrlParam('typeId');
$('#p_factory li').each(function() {
if ($(this).find("span").attr("tid") == typeId) {
$(this).addClass('liac');
$(this).find('i').removeClass('chencked').addClass('yellowchencked');
$(this).find('span').addClass('active');
}
});
} else {
var typeId = $('.shopCase_detail').children('#p_factory').children('.liac').find('.active').attr('tid');
seriesId = 0;
}
var userProxyId = {$userId};
productLists(searchText, factoryId, seriesId, typeId, subTypeId, userProxyId, pageIndex, per_page);
}
function RecommendProduct(factoryId) {
$.ajax({
type: "post",
url: "api.php?act=Recommend",
async: false,
data: {
factoryId: factoryId,
},
success: function(data) {
if (data != "") {
data = $.parseJSON(data);
var html = '';
$.each(data, function(n, value) {
html += '<div class="shopCase_Wall">';
html += '<div class="shopCase_pic">';
html += '<a href ="product.php?factoryId=' + factoryId + '&productId=' + value.ProductId + '"><img src="' + value.picUrl + '" /></a>';
html += '</div>';
html += '<div class="shopCase_textWall">';
html += '<p class="shopCase_WallText" title="">' + value.ProductName + '</p>'
html += '</div>';
html += '</div>';
});
$('.shopCase_picWall').html(html);
}
}
});
}
//获取厂家导航
function nav(factoryId) {
$.ajax({
type: "post",
url: "api.php?act=getShopInfo",
async: false,
data: {
factoryId: factoryId,
},
success: function(data) {
if (data != "") {
data = $.parseJSON(data);
var html = '';
$.each(data, function(n, value) {
html += '<li></i><span tid="' + value.typeId + '">' + value.typeName + '</span></li>';
});
$('#p_factory').html(html);
}
}
});
}
var userProxyId = {$userId};
//申请乡代
$('#btn1').on('click', function() {
if (userProxyId > 0) {
//console.info($(this).attr('proxylv'));
var lv = 1;
if (confirm('确定申请?')) {
$.post("api.php?act=proxyApply", {
lv: lv,
factoryId: factoryId,
userProxyId: userProxyId
}, function(data) {
if (data == "success") {
alert('申请提交成功,请等待审核,可拨打400-6249-123咨询');
} else {
data = $.parseJSON(data);
if (data == '注册账号必须为公司才能申请代理!') {
alert(data);
} else if (data == '该地区已存在总(市)级代理') {
alert(data);
} else if (data == '请勿重复申请代理,您可以申请更高级别的代理,可拨打400热线咨询') {
alert('请勿重复申请代理,您可以申请更高级别的代理,可拨打400-6249-123咨询');
} else if (data == '该地区已存在县(区)级代理') {
alert(data);
} else if (data == '该地区已存在乡(街道)级代理') {
alert(data);
} else {
alert(data);
window.location.href = 'certification.php';
}
}
});
}
} else {
alert('请先登录再申请代理');
var url = window.location.href;
var path = url.substr(url.lastIndexOf('/'), url.length - url.lastIndexOf('/'));
window.location.href = 'login.html?path=' + path;
}
});
//申请乡代
$('#btn2').on('click', function() {
if (userProxyId > 0) {
//console.info($(this).attr('proxylv'));
var lv = 2;
if (confirm('确定申请?')) {
$.post("api.php?act=proxyApply", {
factoryId: factoryId,
lv: lv,
userProxyId: userProxyId
}, function(data) {
if (data == "success") {
alert('申请提交成功,请等待审核!可拨打400-6249-123咨询');
} else {
data = $.parseJSON(data);
if (data == '注册账号必须为公司才能申请代理!') {
alert(data);
} else if (data == '该地区已存在总(市)级代理') {
alert(data);
} else if (data == '请勿重复申请代理,您可以申请更高级别的代理,可拨打400热线咨询') {
alert('请勿重复申请代理,您可以申请更高级别的代理,可拨打400-6249-123咨询');
} else if (data == '该地区已存在县(区)级代理') {
alert(data);
} else if (data == '该地区已存在乡(街道)级代理') {
alert(data);
} else {
alert(data);
window.location.href = 'certification.php';
}
}
});
}
} else {
alert('请先登录再申请代理');
var url = window.location.href;
var path = url.substr(url.lastIndexOf('/'), url.length - url.lastIndexOf('/'));
window.location.href = 'login.html?path=' + path;
}
});
//申请乡镇代理
$('#btn3').on('click', function() {
if (userProxyId > 0) {
//console.info($(this).attr('proxylv'));
var lv = 3;
if (confirm('确定申请?')) {
$.post("api.php?act=proxyApply", {
factoryId: factoryId,
lv: lv,
userProxyId: userProxyId
}, function(data) {
if (data == "success") {
alert('申请成功,请等待审核');
} else {
data = $.parseJSON(data);
if (data == "申请代理前,请先通过企业实名认证!") {
window.location.href = 'certification.php';
} else {
if (data == '注册账号必须为公司才能申请代理!') {
alert(data);
}
else if (data == '该地区已存在总(市)级代理') {
alert(data);
}
else if (data == '请勿重复申请代理,您可以申请更高级别的代理,可拨打400热线咨询') {
alert('请勿重复申请代理,您可以申请更高级别的代理,可拨打400-6249-123咨询');
}
else if (data == '该地区已存在乡(街道)级代理') {
alert(data);
}
else if (data == '该地区已存在县(区)级代理') {
alert(data);
} else {
alert(data);
window.location.href = 'certification.php';
}
}
}
});
}
}
else {
alert('请先登录再申请代理');
var url = window.location.href;
var path = url.substr(url.lastIndexOf('/'), url.length - url.lastIndexOf('/'));
window.location.href = 'login.html?path=' + path;
}
});
$('.shop_button2').mouseleave(function() {
$('.shop_button2').hide();
});
//厂家产品搜索
$('.search_btn').live('click', function() {
var searchText = $('.keyWord').val();
if (searchText == '') {
alert('请输入搜索关键字');
} else {
loadData(1,1);
$('#itemContainer').attr("fst", "0");
var recordCount = $('#itemContainer').attr("recordCount");
if (recordCount > per_page) {
pagination(recordCount);
$(".holder").show();
} else {
$(".holder").hide();
}
}
});
//搜索厂家
$('.shop_search_inputBtn').live('click', function() {
var searchText = $('.shop_search_input').val();
var empty_txt = $('.hd_search_input').attr('empty_value');
if (searchText == '' || searchText == empty_txt || searchText == '店铺产品搜索') {
alert('请输入搜索关键字');
}
else {
var searchText = $('.shop_search_input').val();
var factoryId = '';
var per_page = 16;
var factoryIds = $.getUrlParam('id');
var seriesId = '';
var subTypeId = '';
var typeId = '';
var userProxyId = {$userId};
var pageIndex = 1;
$('#itemContainer').attr("fst", "0");
productLists(searchText, factoryIds, seriesId, typeId, subTypeId, userProxyId, pageIndex, per_page);
mao();
var recordCount = $('#itemContainer').attr("recordCount");
if (recordCount > per_page) {
pagination(recordCount);
$(".holder").show();
} else {
$(".holder").hide();
}
}
});
});
function mao() {
var t = $(".shopList_Main").offset().top - 100;
$(window).scrollTop(t); //滚动到锚点位置
}
</script>
</body>
</html>
1
https://gitee.com/xuqipeter/pdw.git
git@gitee.com:xuqipeter/pdw.git
xuqipeter
pdw
品贷网
master

搜索帮助