';
}
for(var i in data.data){
hotkeywords +=''+data.data[i]+'';
}
hotkeywords+='
';
$('#searchts').prepend(hotkeywords);
}});
if(window.localStorage){
var historysearch=window.localStorage.getItem('searchq');
if(historysearch!=undefined&&historysearch!=''){
historysearch=historysearch.split(',');
var historyhtml='
历史记录
';
for(var i in historysearch){
if(historysearch[i]!=''){
historyhtml +=''+historysearch[i]+'';
}
}
historyhtml+='
';
}
}
if ($('#searchhistory').length<1) {
var data='';
$('#searchts').html(data);
}
$('#searchts').find('.searchxgkeywords').html(historyhtml);
$('#searchts').show();
}
function shousuoclear(e){
$(this).parents('.searchts').html('');
window.localStorage.removeItem('searchq');
}
function goback(){
if(window.history.length<=1){
window.location.href='/';
}else{
window.history.back();
}
}
/*history*/
function addHistory(){
var historydata=$.cookie('history');
historydata=historydata!=undefined?historydata.split(','):[];
brandid>0?historydata[historydata.length]='bid:'+brandid:'';
brandid<=0&&catid>0?historydata[historydata.length]='cid:'+catid:'';
historydata=unique(historydata);
historydata.length>10?historydata.splice(0,1):'';/*cookie最多存10条记录*/
historydata.length>0?$.cookie('history',historydata.join(','),{expires:365,path:'/'}):'';
if(window.localStorage&&pac!='user'&&pac!='search'&&pdo!='search'){
var date =Math.round(new Date().getTime()/1000).toString();
var time=date;
var historypagestr=window.localStorage.getItem('history2019');
var list=pac + ':' + pdo + ':' + pid + ':' + time;
var historypage=historypagestr!=undefined&&historypagestr!=''?historypagestr.split(','):[];
/*已存在,更新最后访问时间*/
if(historypagestr&&historypagestr.indexOf(pac + ':' + pdo + ':' + pid)!=-1){
for(var i in historypage){
if(historypage[i].indexOf(pac + ':' + pdo + ':' + pid)!=-1){
historypage.splice(i,1);
}
}
historypage.unshift(list);
window.localStorage.setItem('history2019',historypage.join(','));
return;
}
historypage[historypage.length]=list;
historypage=unique(historypage);
historypage.length>50?historypage.splice(0,1):'';/*cookie最多存50条记录*/
historypage.length>0?window.localStorage.setItem('history2019',historypage.join(',')):'';
}
}
/*行业品牌缓存*/
function addCatlist(){
var catlistblock=['brand10','mingren','goodbest','product','shenghuo','zq','shop','webshop','zhishi','merchants','zq'];
if((in_array(pac,catlistblock)&&pdo=='list') || catid>0){
var catcacheid=catid?catid:pid;
if(window.localStorage){;
var catpagestr=window.localStorage.getItem('catpage');
var catpagestr=catpagestr!=undefined&&catpagestr!=''?catpagestr.split(','):[];
/*已存在,更新最后访问时间*/
if(catpagestr){
for(var i in catpagestr){
if(catpagestr[i]==pid){
catpagestr.splice(i,1);
}
}
catpagestr.unshift(pid);
window.localStorage.setItem('catpage',catpagestr.join(','));
return;
}
catpagestr[catpagestr.length]=pid;
catpagestr=unique(catpagestr);
catpagestr.length>50?catpagestr.splice(0,1):'';/*cookie最多存50条记录*/
catpagestr.length>0?window.localStorage.setItem('catpage',catpagestr.join(',')):'';
}
}
}
function addBrandlist(){
if(window.localStorage){
if(pac!='brand'&&pdo!='show'){
return false;
}
var brandcacheid=brandid?brandid:pid;
var brandpagestr=window.localStorage.getItem('brandpage');
var brandpagestr=brandpagestr!=undefined&&brandpagestr!=''?brandpagestr.split(','):[];
/*已存在,更新最后访问时间*/
if(brandpagestr){
for(var i in brandpagestr){
if(brandpagestr[i]==brandcacheid){
brandpagestr.splice(i,1);
}
}
brandpagestr.unshift(brandcacheid);
window.localStorage.setItem('brandpage',brandpagestr.join(','));
return;
}
brandpagestr[brandpagestr.length]=pid;
brandpagestr=unique(brandpagestr);
brandpagestr.length>50?brandpagestr.splice(0,1):'';/*cookie最多存50条记录*/
brandpagestr.length>0?window.localStorage.setItem('brandpage',brandpagestr.join(',')):'';
}
}
function loadswipe(obj){
obj.each(function(){
var isrun=false;
var swipeobj=$(this).parent();
var _this=$(this);
var thisheight=Math.ceil(_this.height());
_this.css({'width':_this.width(),'height':thisheight});
_this.find('li .slice').css({'width':_this.width(),'height':thisheight});
_this.find('li').css({'display':'table-cell','vertical-align':'middle'});
/*自动高度*/
if(_this.attr('autoheight')==1){
_this.css({'height':'auto'});
_this.find('li .slice').css({'height':'auto'});
}
/*显示当前位置*/
if(_this.attr('perview')==1){
_this.find('.perview').length<=0?swipeobj.append(''):'';
_this.find('li').each(function(){
swipeobj.find('.perview').append('');
});
swipeobj.find('.perview i').click(function(){
var pos=_this.width()*$(this).index();
$(this).parent().find('i.active').removeClass('active');
$(this).addClass('active');
_this.animate({'scrollLeft':pos},{duration:300});
isrun=true;
setTimeout(function(){
isrun=false
},3000);
});
}
/*自动播放*/
if(_this.attr('autorun')>0){
var loadsobj = setInterval(function(){
startpos=_this.scrollLeft();
startx=11;
endx=0;
_this.trigger('touchend');
},_this.attr('autorun'));
_this.hover(function(){
isrun=true;
},function(){
isrun=false;
});
}
/*阻止blockmenu滑动导致页面切换*/
var startx=0,starty=0,endx=0,endy=0,startpos=0;
_this.bind('touchstart',function(){
if(isrun){return;}
var touch = event.targetTouches[0];
startx=touch.pageX;
starty=touch.pageY;
endx=touch.pageX;
endy=touch.pageY;
startpos=_this.scrollLeft();
}).bind('touchmove',function(){
if(isrun){return;}
var touch = event.targetTouches[0];
endx=touch.pageX;
endy=touch.pageY;
_this.scrollLeft(startpos-endx+startx);
var xpos=endx>startx?endx-startx:startx-endx;
var ypos=endy>starty?endy-starty:starty-endy;
if(xpos>ypos){
event.preventDefault(); //阻止触摸事件的默认行为,即阻止滚屏
}
}).bind('touchend',function(){
if(isrun){return;}
var xpos=endx>startx?endx-startx:startx-endx;
var ypos=endy>starty?endy-starty:starty-endy;
if(xpos<10){return;}
_this.find('li img').each(function(i) {
if($(this).attr('height')&&$(this).attr('width')){
$(this).height($(this).attr('height')*$(this).width()/$(this).attr('width'));
}
});
/*自动高度*/
if(_this.attr('autoheight')==1){
_this.css({'height':'auto'});
_this.find('li .slice').css({'height':'auto'});
}
isrun=true;
startpos=Math.round(parseInt(startpos)/parseInt(_this.width()))*_this.width();
var pos=startpos-(endx>startx?_this.width():-_this.width());
/*是否循环*/
if(_this.attr('autorun')>0||_this.attr('loop')){
if(pos>_this.width()*(_this.find('li').length-1)){
pos=0;
}
}
var _thiseq=Math.round(pos/_this.width());
_this.find('li.active').removeClass('active');
_this.find('li:eq('+_thiseq+')').addClass('active');
_this.animate({'scrollLeft':pos},{duration:300,complete:function(){
swipeobj.find('.perview').find('i.active').removeClass('active');
swipeobj.find('.perview').find('i:eq('+_thiseq+')').addClass('active');
isrun=false;
}});
});
if(_this.find('.sright').length>0){
var delayclick='';
_this.find('.sright').click(function(){
isrun=true;
clearTimeout(delayclick);
delayclick=setTimeout(function(){isrun=false},6000);
//if(isrun){return;}
startpos=_this.scrollLeft();
var ieq=Math.round(parseInt(startpos)/parseInt(_this.width()));
if(ieq==_this.find('li').length-1){
ieq=0;
}else{
ieq+=1;
}
_this.animate({'scrollLeft':ieq*_this.width()},{duration:300,complete:function(){
swipeobj.find('.perview').find('i.active').removeClass('active');
swipeobj.find('.perview').find('i:eq('+ieq+')').addClass('active');
isrun=false;
}});
});
}
if(_this.find('.sleft').length>0){
_this.find('.sleft').click(function(){
isrun=true;
clearTimeout(delayclick);
delayclick=setTimeout(function(){isrun=false},6000);
//if(isrun){return;}
startpos=_this.scrollLeft();
var ieq=Math.round(parseInt(startpos)/parseInt(_this.width()));
if(ieq==0){
ieq=_this.find('li').length-1;
}else{
ieq-=1;
}
_this.animate({'scrollLeft':ieq*_this.width()},{duration:300,complete:function(){
swipeobj.find('.perview').find('i.active').removeClass('active');
swipeobj.find('.perview').find('i:eq('+(Math.round(_this.scrollLeft()/_this.width()))+')').addClass('active');
isrun=false;
}});
});
}
});
}
function loadJS(uri,callback){
if(uri==''){return false;}
if($('script[src="'+uri+'"]').length<=0){
var script = document.createElement('script');
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
callback?callback():'';
}
};
} else {
script.onload = function(){callback?callback():'';};
}
script.src = uri;
script.type = 'text/javascript';
document.body.appendChild(script);
}else{
callback?callback():'';
}
return true;
}
function loadCSS(uri,callback){
if(uri==''){return false;}
if($('link[href="'+uri+'"]').length<=0){
var script = document.createElement('link');
if (script.readyState){ //IE
script.onreadystatechange = function(){
if (script.readyState == "loaded" || script.readyState == "complete"){
script.onreadystatechange = null;
callback?callback():'';
}
};
} else {
script.onload = function(){callback?callback():'';};
}
script.href = uri;
script.rel = 'stylesheet';
script.type = 'text/css';
document.body.appendChild(script);
}else{
callback?callback():'';
}
return true;
}
function isWeiXin(){
var ua = window.navigator.userAgent.toLowerCase();
if(ua.match(/MicroMessenger/i) == 'micromessenger'){
return true;
}else{
return false;
}
}
function loadswiper(obj){
loadCSS("/public/swiper/swiper.min.css",null);
loadJS("/public/swiper/swiper.min.js",function(){
try{
loadSwiperEvent(obj);
}catch(e){}
});
}
/*传参是swiper-container*/
function loadSwiperEvent(obj){
var swiperarr = Array();
var swipernum=0;
obj.each(function(){
var _this=$(this);
if(_this.find('.swiper-slide').length<=1){
return;
}
var num = parseInt(Math.random()*1000);
_this.attr('id','swiper'+num);
_this.parent().find('.pagination').attr('id','pagination'+num);
_this.parent().find('.arrow-right').attr('id','swiperright'+num);
_this.parent().find('.arrow-left').attr('id','swiperleft'+num);
_this.attr('autoheight',1);
var index=swipernum++;
swiperarr[index] = new Swiper('#swiper'+num, {
slidesPerView: _this.attr('slidesPerView')?_this.attr('slidesPerView'):1,
spaceBetween: 30,
autoplay: _this.attr('autosec')>0?{delay:_this.attr('autosec'),disableOnInteraction: false}:false,
loop: _this.attr('autosec')>0?true:false,
pagination: {el:'#pagination'+num,clickable: true},
navigation: {nextEl: '#swiperright'+num,prevEl: '#swiperleft'+num,},
on: {
slideChangeTransitionStart: function(){
}
}
});
});
}
/*数组去重*/
function unique(arr){
var res = [];
var json = {};
for(var i = 0; i < arr.length; i++){
if(!json[arr[i]]){
res.push(arr[i]);
json[arr[i]] = 1;
}
}
return res;
}
function collect(e){
if(userid<=0){
cnpplogin();
return false;
}
if($(e).hasClass('active')){
$(e).removeClass('active');
$.ajax({type:'POST',url:'/ajaxstream/dingzhi/',data:{action:'collect','pac':pac,'pdo':pdo,'pid':pid,'iscollect':0,'v':2019},success:function() {
loadCollect($(e),false);
}});
}else{
$(e).addClass('active');
$.ajax({type:'POST',url:'/ajaxstream/dingzhi/',data:{action:'collect','pac':pac,'pdo':pdo,'pid':pid,'iscollect':1,'v':2019},success:function () {
loadCollect($(e),true);
}});
}
}
function specsCollet(e,id){
if(userid<=0){
cnpplogin();
return false;
}
var productdo = pdo;
var productac = pac;
var productid = pid;
if (id){
productac = 'product';
productdo = 'show';
productid = id;
}
if($(e).hasClass('active')){
if (id){
$(e).removeClass('active');
$(e).find('span').text('(收藏商品)');
}else{
$('.currentpage').removeClass('active');
$('.currentpage').find('span').text('(收藏商品)');
$('#go_top').find('.collect').removeClass('active');
}
$.ajax({type:'POST',url:'/ajaxstream/dingzhi/',data:{action:'collect','pac':productac,'pdo':productdo,'pid':productid,'iscollect':0,'v':2019},success:function() {
loadSpecsCollect($(e),productac,productdo,productid,true);
}});
}else{
if (id){
$(e).addClass('active');
$(e).find('span').text('已收藏');
}else{
$('.currentpage').addClass('active');
$('.currentpage').find('span').text('已收藏');
$('#go_top').find('.collect').addClass('active');
}
$.ajax({type:'POST',url:'/ajaxstream/dingzhi/',data:{action:'collect','pac':productac,'pdo':productdo,'pid':productid,'iscollect':1,'v':2019},success:function () {
loadSpecsCollect($(e),productac,productdo,productid,true);
}});
}
}
function loadSpecsCollect(obj,productac,productdo,productid,reload){
/*绑定点击事件*/
if($('#collectbox').find('.collectlistresult').length<=0) {
$('#collectbox').html('
');
//加载css、js
var cssarr=$('#_ajaxdata').find('.pagecss').data('css');
if(cssarr){
var pagecssarr=$('.pagecss:first').data('css').split(',');
cssarr=cssarr.split(',');
for(var i in cssarr){
if(!in_array(cssarr[i],pagecssarr)){
$('.pagecss:first').data('css',$('.pagecss:first').data('css')+','+cssarr[i]);
$('head').append('');
}
}
}
var jsarr=$('#_ajaxdata').find('.pagejs').data('js');
if(jsarr){
var pagejsarr=$('.pagejs:first').data('js').split(',');
jsarr=jsarr.split(',');
for(var i in jsarr){
if(!in_array(jsarr[i],pagejsarr)){
$('.pagecss:first').data('js',$('.pagejs:first').data('js')+','+jsarr[i]);
$('head').append('');
}
}
}
$('#_ajaxdata').html('');
$(e).removeClass('loading');
}});
}
_itemobj.toggleClass('active');
}
/*js isset*/
function isset(variable){
return typeof(variable)=='undefined' ? false : true;
}
function SetHome(){
var title = '买购网';
var url = 'https://www.maigoo.com/';
var ua = navigator.userAgent.toLowerCase();console.log(ua);
if (ua.indexOf("360se") > -1) {
alert("由于360浏览器功能限制,请按 Ctrl+D 手动收藏!");
}else if (ua.indexOf("msie 8") > -1) {
window.external.AddToFavoritesBar(url, title); //IE8
}else {
try{
window.external.addFavorite(url,title);
}
catch(e){
try{
window.sidebar.addPanel(title,url,"");
}
catch(e){
alert('您的浏览器不支持,请按 Ctrl+D 手动收藏!');
}
}
}
}
function shareclick(e) {
var _url=arguments[1]?arguments[1]:window.location.href;
var _title=arguments[2]?arguments[2]:$('head title').text();
var _desc=arguments[3]?arguments[3]:$('head meta[name=description]').text();
var sharepath = $(e).attr('data-cmd');
if (sharepath == 'weixin') {
if ($('#bdshare_weixin_qrcode_dialog').length==1) {
$('#bdshare_weixin_qrcode_dialog').show();
} else {
var qrcode = 'https://www.maigoo.com/qrcode.php?url='+_url;
var div = '
';
}else{
var type=typeof($(this).text().replace(/\d+、/g,'').split('、')[0]);
var test=$(this).text().replace(/\d+、/g,'').split('、')[1]&&type!='string'?$(this).text().replace(/\d+、/g,'').split('、')[1]:$(this).text().replace(/\d+、/g,'');
str+='
'+test+'
';
}
if(k==len1-1||k%len==len-1){
str+="
";
}
});
$('.articlemulu .muluright').append(str+'');
if(false&&$('.rightlay').length>0){
$('.rightlay').find('.userinfo').before($('.articlemulu').clone());
$('.rightlay').find('.articlemulu .col:first').append($('.rightlay').find('.articlemulu .col:eq(1) li'));
$('.rightlay').find('.articlemulu .col:first').append($('.rightlay').find('.articlemulu .col:eq(2) li'));
$('.rightlay').find('.articlemulu').addClass('bg');
$('.rightlay').find('.mululeft').remove();
$('.rightlay').find('.muluright').append('');
$('.rightlay').find('.articlemulu').append('');
if($('.articletemplate1').find('h2').length==0){
$('.rightlay').find('.muluright').addClass('nomulu1');
}else{
$('.rightlay').find('.muluright').find('.mulu1').each(function(i) {
var pos=parseInt($(this).attr('position'));
if($('#leftlay').find('.muluright').find('[position='+(pos+2)+']').hasClass('mulu1')){
$(this).next('.mulu2').addClass('nonum');
}
});
}
}
$('.articlemulu').find('.mulu1,.mulu2').click(function(){
$("html, body").animate({
scrollTop: parseInt($('.articletemplate1').find('h2,h3').eq($(this).attr('position')).offset().top-60)
});
$(this).addClass('mulubgcolor');
return false;
});
var scrolldelayobj;
$(window).scroll(function(){
clearTimeout(scrolldelayobj);
scrolldelayobj=setTimeout(function(){
var scrolltop=$(window).scrollTop()+50;
var pos=0,isbreak=false;
$('.articletemplate1').find('h2,h3').each(function(k){
if(!isbreak){
pos=k;
var yuanshu=$(this).offset().top;
if(yuanshu>scrolltop&&yuanshuscrolltop+$(window).height()-50){
pos--;
isbreak=true;
}
}
});
$('#leftlay').find('.articlemulu').find('li').removeClass('mulubgcolor');
$('#leftlay').find('.articlemulu').find('li:eq('+pos+')').addClass('mulubgcolor');
var top=(pos)*$('#leftlay').find('.articlemulu').find('.mulu1,.mulu2').eq(1).height()+4;
$('#leftlay').find('.articlemulu').find('i').css('top',top+'px');
$('#leftlay').find('.muluright').animate({scrollTop: (top-120)+'px'},300);
},200);
});
}
function lazyPic(){
$("img.lazy").each(function(){
if($(this).offset().top>$(window).scrollTop()-$(this).height()-500&&$(this).offset().top<$(window).height()+$(window).scrollTop()+500&&$(this).parents('.dn').css('display')!='none'){
$(this).css('transition','opacity ease-in-out 300ms');
$(this).attr('src',$(this).data('src')).removeClass('lazy').removeAttr('data-src');
if($(this).hasClass('resize')&&$(this).attr('height')>0&&$(this).attr('width')>0){
$(this).removeClass('resize');
$(this).height($(this).attr('height')*$(this).width()/$(this).attr('width'));
}
}
});
}
/*滚动事件,可向上/向下/向左/向右,可设置标签forward=top/bottom/left/right*/
/*滚动效果*/
function Marquee_c(obj){
if(obj.find('.scrollbox').length==0){
return;
}
if(obj.find('.scrollbox').width()==0){
setTimeout(function(){Marquee_c(obj);},2000);
return false;
}
var stopscroll=false;
var _forward=obj.attr('forward')?obj.attr('forward'):'left';
var delay=obj.attr('delay')>0?obj.attr('delay'):30;
if(obj.find('.scrollbox ul').length>0){
var _scrollobj=obj.find('.scrollbox ul');
}else{
var _scrollobj=obj.find('.scrollbox table');
}
if((_forward=='left'||_forward=='right')&&_scrollobj.width()obj.find('.scrollbox').width()){
obj.find('.scrollbox').append(_scrollobj.clone());
}
}else{
if(_scrollobj.height()>obj.find('.scrollbox').height()){
obj.find('.scrollbox').append(_scrollobj.clone());
}
}
}
var scrollobj=setInterval(function(){
if(!stopscroll){
if(_forward=='left'){
if(obj.find('.scrollbox').scrollLeft()>=_scrollobj.width()){
obj.find('.scrollbox')[0].scrollLeft=0;
}else{
obj.find('.scrollbox')[0].scrollLeft++;
}
}else if(_forward=='top'){
if(obj.find('.scrollbox').scrollTop()>=_scrollobj.height()){
obj.find('.scrollbox')[0].scrollTop=0;
}else{
obj.find('.scrollbox')[0].scrollTop++;
}
}else if(_forward=='bottom'){
if(obj.find('.scrollbox').scrollTop()<=0){
obj.find('.scrollbox')[0].scrollTop=_scrollobj.height();
}else{
obj.find('.scrollbox')[0].scrollTop--;
}
}else{
if(obj.find('.scrollbox').scrollLeft()<=0){
obj.find('.scrollbox')[0].scrollLeft=_scrollobj.width();
}else{
obj.find('.scrollbox')[0].scrollLeft--;
}
}
}
},delay);
var touchstartx=0;
var touchendx=0;
_scrollobj.bind('touchstart',function(e){
touchstartx=e.originalEvent.targetTouches[0].pageX;
});
_scrollobj.bind('touchmove',function(e){
touchendx=e.originalEvent.targetTouches[0].pageX;
});
_scrollobj.bind('touchend',function(e){
if(touchendx-touchstartx>50||touchstartx-touchendx>50){
clearInterval(scrollobj);
}
});
_scrollobj.hover(function(){
stopscroll=true;
},function(){
stopscroll=false;
});
/*
_scrollobj.hover(function(){
stopscroll=true;
setTimeout(function(){
stopscroll=false;
},3000);
});*/
}
function getObjectHeight(obj){
return parseInt(obj.height())+parseInt(obj.css('padding-top'))+parseInt(obj.css('padding-bottom'))+parseInt(obj.css('border-top-width'))+parseInt(obj.css('border-bottom-width'));
}
function marqueebottom(obj,shounum){
if(obj.find('.bitem').length==0){
return;
}
obj.attr('isload',1);
var _this;
var delay=obj.attr('delay')?obj.attr('delay'):5000;
var num=obj.find('.bitem').length-shounum;
var objheight=0,showheight=0;
obj.find('.bitem').each(function(i){
if(i>=num){
$(this).css({'opacity':1});
showheight+=getObjectHeight($(this));
}else{
objheight+=getObjectHeight($(this));
$(this).hide();
}
});
obj.height(showheight);
var scrolltop=objheight;
obj.scrollTop(scrolltop);//先滚动到最底部
var cleardelay=setInterval(function(){
showheight-=getObjectHeight(obj.find('.bitem:eq('+(num+shounum-1)+')'));
obj.find('.bitem:eq('+(num+shounum-1)+')').hide();
num--;
_this=obj.find('.bitem:eq('+num+')');
scrolltop-=getObjectHeight(_this);
if(num>=0&&scrolltop>=0){
_this.css({'opacity':0});
obj.animate({'scrollTop':scrolltop},{duration:200,complete:function(){
_this.show().animate({'opacity':1},100);
showheight+=getObjectHeight(_this);
obj.height(showheight);
}});
}else{
scrolltop=objheight;
obj.animate({scrollTop: scrolltop+'px'},200);
num=obj.find('.bitem').length-shounum;
obj.find('.bitem').each(function(i){
if(i>=num){
$(this).css({'opacity':1});
$(this).show();
showheight+=getObjectHeight($(this));
}else{
objheight+=getObjectHeight($(this));
$(this).hide();
}
});
obj.height(showheight);
}
},delay);
}
function checkHash(){
if(window.location.href.indexOf('#pos')!=-1){
var posname=location.hash.replace('#pos','pos_');
if($('#'+posname).length>0){
var posname2=posname.replace('pos_','');
if($('#'+posname).find('.ajaxload').length>0){
$('.tabmenubox .item[action='+posname2+']').click();
}
if($('.swipehead').length>0){
setTimeout(function(){
if(!$('#'+posname).hasClass('slide')){
if(!$('.swipehead').hasClass('fixed')){
page=maxpage-1;
var classarr=$('#myswipe').find('.slide:last').attr('class').split(' ');
var styleclass=classarr[2]+(classarr[3]?' '+classarr[3]:'')+(classarr[4]?' '+classarr[4]:'');
$('.swipehead').attr('class','swipehead '+styleclass);
}
$('html,body').animate({scrollTop:$('#'+posname).offset().top-$('.swipehead').outerHeight()},{duration:300});
}else{
resetPage($('#'+posname).index());
$('html,body').animate({'scrollTop':$('#'+posname).index()*$(window).height()});
}
},100);
}else{
$('html,body').animate({scrollTop:$('#'+posname).offset().top-$('header').height()-10},{duration:300});
}
}else{
posname=location.hash.replace('#pos','');
if($('#'+posname).length>0){
$('html,body').animate({scrollTop:$('#'+posname).offset().top-$('header').height()-10},{duration:300});
}
}
}
}
function encode(str){
var configchars = "YG4CHo5Jyfg2b8FLpEvRr3WtVnlqMidu6cN";
var encodechars = "";
for(var i=0;i0){
$('[show_image_flag]').each(function(i) {
var show_image_flag;
var _this=$(this);
var delay=_this.attr('delay')?parseInt(_this.attr('delay')):3500;
_this.find('.imli').length>1?setInterval(function(){
show_image_flag=parseInt(_this.attr('show_image_flag'));
++show_image_flag;
show_image_flag>=_this.find('.imli').length?show_image_flag=0:'';
_this.find('.imli').css('display','none');
_this.find('.imli:eq('+(show_image_flag)+')').css('display','block');
_this.attr('show_image_flag',show_image_flag);
},delay):'';
});
}
}
function picViewer(){
loadCSS('https://s.maigoo.com/public/js/jquery/viewer.min.css?202007');
loadJS('https://s.maigoo.com/public/js/jquery/viewer-jquery.min.js?202007302',function(){
$('#pos_articleinfo img').each(function(){
if($(this).parents('a').length>0&&$(this).parents('.swiper-slide').length<=0){
var alink=$(this).parents('a').attr('href');
if(alink&&(alink.indexOf('.jpg')!=-1||alink.indexOf('.png')!=-1||alink.indexOf('.gif')!=-1)){
$(this).parents('a').click(function(){
if($(this).parents('.ctn_cont').length>0){
var _this=$(this);
setTimeout(function(){
_this.parents('.ctn_cont').css({'z-index':99});
},100);
$('.viewer-close').click(function(){
var _this2=$(this);
setTimeout(function(){
_this2.parents('.ctn_cont').removeAttr('style');
},200);
});
}
$(this).find('img').attr('src',alink);
return false;
});
$(this).viewer({
url: 'src',
title: false,
toolbar: false,
navbar: false
});
}
}
});
$('#pos_articleinfo a').each(function(){
var alink=$(this).attr('href');
if($(this).find('img').length<=0&&alink&&(alink.indexOf('.jpg')!=-1||alink.indexOf('.png')!=-1||alink.indexOf('.gif')!=-1)){
$(this).append('');
$(this).click(function(){
$(this).find('img')[0].click();
return false;
});
$(this).viewer({
url: 'src',
title: false,
toolbar: false,
navbar: false
});
}
});
});
}
/*/public/js/maigoo/v2022/weUI.js*/
function dialog(title,msg,callback){var btnname=arguments[3]?arguments[3]:'确定';var dialog1,dialog2;dialog1='