2 Star 1 Fork 2

徐子玉 / 品贷网

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
store.html 44.80 KB
一键复制 编辑 原始数据 按行查看 历史
徐子玉 提交于 2017-07-05 11:21 . + pdw
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title>{$SEO_Title_html}</title>
<meta name="keywords" content="{$SEO_Keywords_html}" />
<meta name="description" content="{$SEO_Description_html}">
<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/style_1200.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-->
<div id="store_topbanner">
<div class="wrap_1200 clearfix">
<div class="hd_logo">
<a href="index.php"><img src="images/head/logo.png"></a>
</div>
<div class="store_hd_search">
<div class="hd_search_div clearfix">
<div id="type_input" class="hd_search_input1 clearfix"><span class="hd_search_input1span" id="3">厂家</span><i class="icon_caret"></i>
</div>
<div class="store_searchdropdown" style="display:none;">
<div class="searchdropdown_til" id="1">厂家</div>
<div class="searchdropdown_til" id="2">产品</div>
</div>
<input class="store_search_input" type="text"/>
<a href="javascript:;" class="hd_search_inputBtn">搜品代网</a>
</div>
</div>
</div>
</div>
<!--商城头部-->
<div id="topbannerThird" >
<div id="shop_header" class="wrap_1200 clearfix">
<div class="shop_logo" id="logo">
</div>
<div id="p_name" class="shopCase_service">
</div>
<div class="shop_collert">
</div>
<div class="shop_choose_tab">
<ul>
<li class="shop_active"><a class="shop_choose_tab_li">产品中心</a></li>
<li><a>关于厂家</a></li>
</ul>
</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"><i class="search_icon_btn"></i></a>
</div>
</div>
</div>
<!--商城主页-->
<div id="shopMain" class="shopMain">
<div class="shopList_Main wrap_1200 clearfix" >
<div class="shopList_left">
<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="shopCase_detail clearfix">
<ul id="p_factory">
</ul>
</div>
<div class="shopList_right clearfix">
<div class="shopCase_listing clearfix" id="itemContainer" fst="0">
</div>
<div class="holder">
</div>
</div>
</div>
</div>
<!--关于厂家-->
<div class="shopMain" style="display: none;">
<div class="wrap_1200 clearfix">
<!-- 商铺 banner-->
<div id="dp-banner" >
{$factoryInfoBannerhtml}
</div>
<!-- 地址电话 -->
<div id="addressphone">
<div class="bge5 clearfix">
{$factoryInfohtml}
<div class="dp-apply">
</div>
</div>
</div>
<!-- 内容 -->
<div id="dp-main" >
<!-- 左侧边 -->
<div class="dp-main-left" id="here">
<ul class="accordion">
<li id="one"> <a href="#one">{$factoryAbbreviation}</a>
<ul class="sub-menu">
<li id="aboutfactory1"><a href="#here">厂家简介</a></li>
<li id="aboutfactory3"><a href="#here">厂商展示</a></li>
<li id="aboutfactory2"><a href="#here">荣誉资质</a></li>
<li id="aboutfactory4"><a href="#here">新闻资讯</a></li>
<li id="aboutfactory5"><a href="#here">联系我们</a></li>
</ul>
</li>
</ul>
</div>
<!-- 右侧 -->
<div class="dp-main-right">
<div id="aboutfactoryCon1" class="factory_word">
{$factoryInfoMemohtml}
</div>
<div id="aboutfactoryCon2" class="factory_qualification" style="display: none">
<ul>
{$factoryCartificatehtml}
<div class="clear"> </div>
</ul>
</div>
<!-- 厂商展示 -->
<div id="aboutfactoryCon3" class="factory_picshow" style="display: none">
<ul>
{$factoryShowhtml}
</ul>
</div>
<!--新闻列表-->
<div id="aboutfactoryCon4" class="xinwenBox" style="display: none">
<div class="xinwenBoxtil">
新闻资讯
</div>
<div class="xinwenBoxcon">
{$getFactoryInfohtml}
</div>
</div>
<!--联系我们-->
<div id="aboutfactoryCon5" class="xinwenBox" style="display: none">
<div class="xinwenBoxtil">
联系我们
</div>
<div class="xinwenBoxcon">
<ul id="fcontact">
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<!--sidebar-->
{$sidebar_html}
<!--footer-->
<div class="comfooter">
{$foot_html}
</div>
<script src="js/flickerplate.min.js"></script>
<script src="js/modernizr-custom-v2.7.1.min.js"></script>
<script>
//滚动到头部
$.fn.smartFloat = function () {
var position = function (element) {
$(window).scroll(function () {
var scrolls = $(this).scrollTop();
if (scrolls > 560 && scrolls < 2020) {
element.show();
if (window.XMLHttpRequest) {
element.css({
position: "fixed",
top: "0px",
left: "50%",
marginLeft : "392px"
});
} else {
element.css({
top: scrolls
});
}
} else {
element.show();
element.css({
position: "absolute",
top: top,
left: "50%",
marginLeft : "392px"
});
}
if(scrolls >2020){
$('.shopCase_recommendation').unbind('scroll');
}
});
};
return $(this).each(function () {
position($(this));
});
}
</script>
<!--分页-->
<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">
var userId = {$userId};
$(document).bind('click', function(e) {
var target = $(e.target);
if (target.closest(".MidCasePullDown,.MidCase_ProSel").length == 0) {
$(".MidCasePullDown").hide();
}
e.stopPropagation();
});
$(document).keydown(function(event){
if(event.keyCode==13){
$(".shop_search_inputBtn").click();
}
});
$(document).ready(function() {
// 右侧悬浮
$(".shopCase_recommendation").smartFloat();
// 厂家中心 关于厂家选择
$('.shop_choose_tab ul li').click(function(){
$(this).addClass('shop_active').siblings().removeClass('shop_active');
var abc = $(this).index();
$('.shopMain').eq(abc).show().siblings('.shopMain').hide();
});
(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);
}
if(getCollectState() == 1){
$('.guanzhu_xin').css('background-position','-210px 0');
$('.shop_guanzhu span').text('已收藏');
}
//页数的变化
$('.FinalCase_Text').click(function() {
$(this).addClass('active').siblings().removeClass('active');
});
$('.shop_button1').click(function() {
$('.shop_button2').show();
});
//点击关注
$('.shop_guanzhu').click(function() {
if (getCollectState() == 1) {
alert('您已经该厂家,请不要重复收藏!');
} else {
if (userId != 0) {
var state = 0;
$('.guanzhu_xin').css('background-position','-210px 0');
$('.shop_guanzhu span').text('已收藏');
$.post("api.php?act=collect", {
factoryId: factoryId,
status: state
}, function(data) {});
alert('厂家收藏成功');
} else {
alert('请您先登录再收藏厂家');
}
}
});
function getCollectState(){
var result = 0;
$.ajax({
type:"post",
url:"api.php?act=collectState",
data:{
factoryId: factoryId,
userProxyId: userId
},
async:false,
success:function(data){
result = data;
}
});
return result;
}
$('.shop_guanzhu1').click(function() {
if (userId != 0) {
var state = 1;
$('.guanzhu_xin').css('background-position','-240px 0');
$('.shop_guanzhu span').text('收藏');
$.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="shop_guanzhu" cs="0">';
html += '<i class="guanzhu_xin"></i>';
html += '<span>收藏</span></div>';
//需要加一下公司简介
// html += '<div class="shopCase_abstract_line1"><i class="abstract_icon1"></i><span>555</span></div>';
// html += '<div class="shopCase_abstract_line2"><i class="abstract_icon2"></i><span>555</span></div>';
html += '<div class="shop_button">';
html += '<div class="shop_button1">申请代理</div>';
html += '<ul class="shop_button2" style="display:none ;">';
html += '<li id="btn1" proxyLv="1">申请总代理</li>';
html += '<li id="btn2" proxyLv="2">申请区域代理</li>';
html += '<li id="btn3" proxyLv="3">申请乡镇代理</li>';
html += '</ul></div>';
html += '<div class = "shopCase_button">';
html += '<div class = "shopCase_btn active"> <a href="quickorder.php?factoryId=' + factoryId + '">快速下单</a> </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) < 0) {
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).attr('color') == selectedColor) {
$(this).show();
} else {
$(this).hide();
}
});
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 {
$('.shopCase_listing').html("");
$('#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 = $('.shop_search_input').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};
if(searchText == "店铺产品搜索"){
searchText = "";
}
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 = '<li><span tid="0">全部</span><li>';
$.each(data, function(n, value) {
html += '<li><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 = "";
}
else{
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>
<!--关于厂家-->
<script>
$(document).ready(function() {
//关于厂家 厂家介绍,荣誉资质切换
$('#aboutfactory1').live('click', function(){
$("#aboutfactoryCon1").show();
$("#aboutfactoryCon2").hide();
$("#aboutfactoryCon3").hide();
$("#aboutfactoryCon4").hide();
$("#aboutfactoryCon5").hide();
if($(this).attr('class')!= 'cur'){
$(this).addClass('cur');
$(this).siblings().removeClass('cur');
}
});
$('#aboutfactory2').live('click', function(){
$("#aboutfactoryCon2").show();
$("#aboutfactoryCon1").hide();
$("#aboutfactoryCon3").hide();
$("#aboutfactoryCon4").hide();
$("#aboutfactoryCon5").hide();
if($(this).attr('class')!= 'cur'){
$(this).addClass('cur');
$(this).siblings().removeClass('cur');
}
});
$('#aboutfactory3').live('click', function(){
$("#aboutfactoryCon3").show();
$("#aboutfactoryCon2").hide();
$("#aboutfactoryCon1").hide();
$("#aboutfactoryCon4").hide();
$("#aboutfactoryCon5").hide();
if($(this).attr('class')!= 'cur'){
$(this).addClass('cur');
$(this).siblings().removeClass('cur');
}
});
$('#aboutfactory4').live('click', function(){
$("#aboutfactoryCon4").show();
$("#aboutfactoryCon1").hide();
$("#aboutfactoryCon2").hide();
$("#aboutfactoryCon3").hide();
$("#aboutfactoryCon5").hide();
if($(this).attr('class')!= 'cur'){
$(this).addClass('cur');
$(this).siblings().removeClass('cur');
}
});
$('#aboutfactory5').live('click', function(){
$("#aboutfactoryCon5").show();
$("#aboutfactoryCon1").hide();
$("#aboutfactoryCon2").hide();
$("#aboutfactoryCon3").hide();
$("#aboutfactoryCon4").hide();
if($(this).attr('class')!= 'cur'){
$(this).addClass('cur');
$(this).siblings().removeClass('cur');
}
});
var accordion_head = $('.accordion > li > a');
accordion_body = $('.accordion li > .sub-menu');
accordion_li_first = $('.sub-menu li:first-child');
//一开始显示第一个accordion_body
accordion_head.first().addClass('active').next().slideDown('normal');
//一开始显示第一个sub-menu li
accordion_li_first.addClass('cur');
accordion_head.on('click', function(event) {
// Disable header links
event.preventDefault();
// Show and hide the tabs on click
if ($(this).attr('class') != 'active'){
accordion_body.slideUp('normal');
$(this).next().stop(true,true).slideToggle('normal');
accordion_head.removeClass('active');
$(this).addClass('active');
}
});
});
$(function () {
$(".hd_search_input").keyup(function (e) {
if (e.keyCode == 13) {
$(".hd_search_inputBtn").click();//模拟button的click事件
}
});
//搜索厂家
$('.hd_search_inputBtn').live('click', function () {
var search_txt = $('.hd_search_input').val();
var type = $('#type_input').find('span').html();
if (search_txt == '')
{
alert('请输入搜索关键字');
}
else if(type == '厂家')
{
var search_txt = $('.hd_search_input').val();
var city = $('.now_province').html();
city = escape(city);
var url = "search.php?keys=" + search_txt + "&city=" + city;
window.open(url);
}
else if( type == '产品'){
var search_txt = $('.hd_search_input').val();
search_txt = escape(search_txt);
var city = $('.now_province').html();
city = escape(city);
var url = "productList.php?keys=" + search_txt + "&city=" + city;
window.open(url);
}
});
});
$(function(){
//厂家或者产品选择
var hd_search_input1 = $('.hd_search_input1');
var store_searchdropdown = $('.store_searchdropdown');
hd_search_input1.click(function(){
$('.store_searchdropdown').show();
});
$('.store_searchdropdown').mouseleave(function(){
$('.store_searchdropdown').hide();
});
$('.searchdropdown_til').click(function(){
var til1 = $(this).html();
$('.hd_search_input1 span').html(til1);
$('.store_searchdropdown').hide();
if($(this).html()=="产品"){
$('.hd_search_input').attr('placeholder','请输入您需要的产品');
}
else if($(this).html()=="厂家"){
$('.hd_search_input').attr('placeholder','请输入您需要的厂家');
}
});
});
</script>
</body>
</html>
1
https://gitee.com/xuqipeter/pdw.git
git@gitee.com:xuqipeter/pdw.git
xuqipeter
pdw
品贷网
master

搜索帮助