微信扫一扫
' + j.text + '
'); j.html && that.tipDom.append(j.html); wsf.pDom.bodyDom.append(that.tipDom); that.tipDom.css({ display: 'block', opacity: 0, left: getOffset.left - (that.tipDom.outerWidth() - getWidth) / 2 + 'px' }); if(getOffset.top - $(document).scrollTop() > that.tipDom.outerHeight()){ top = getOffset.top - that.tipDom.outerHeight(); movetop = -30; that.tipDom.removeClass('bottom').addClass('top'); }else{ top = getOffset.top + getHeigght; movetop = 30; that.tipDom.removeClass('top').addClass('bottom'); } that.tipDom.css({ top: (top + movetop) + 'px' }).animate({ top: top + 'px', opacity: 1 }); } }, delTip: function(j){ var that = this; that.tipDom && that.tipDom.remove(); j.getDom.removeData('tip'); } }, upJsFun: function (curDom) { var getDom = null; switch(true){ case curDom.hasClass('customModule'): getDom = curDom.find('.MoBodyC > div'); break; case curDom.hasClass('ev-module-edit'): getDom = curDom.find('.ev-module-edit-box > div'); break; } if(getDom && getDom.length){ switch(true){ // newMo case getDom.hasClass('ev-pic'): case getDom.hasClass('ev-icon-pic'): wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('ev-banner-module'): wsf.banner3D.init(getDom); break; case getDom.hasClass('ev-albums-module'): wsf.textListModule(getDom); wsf.albums(getDom); wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('ev-search-module'): wsf.evSearch.load(getDom); break; case getDom.hasClass('ev-audio-module'): wsf.audioModule.load(getDom); break; case getDom.hasClass('ev-custom-video'): wsf.videoModule.load(getDom); break; case getDom.hasClass('ev-sphere-module'): wsf.sphereModule.load(getDom); break; // oldmo case getDom.hasClass('text-list-module'): setTimeout(function () { wsf.textListModule(getDom); wsf.moveModule(getDom); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('pic-text-module'): wsf.f.imgLazyLoading(curDom); break; case getDom.hasClass('focus-pic-module'): wsf.focusPicModule(curDom.find('.mo').attr('id')); break; case getDom.hasClass('pic-text-list-module'): setTimeout(function () { wsf.textListModule(getDom); wsf.moveModule(getDom); wsf.sysDoc(curDom.find('.ev-sys-doc-module')); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('form-module'): if(arguments[1]){ wsf.formModule.submit_verify(curDom.find('form'), arguments[1]); wsf.formModule.defaultValVerify(getDom); } break; case getDom.hasClass('video-module'): setTimeout(function () { wsf.videoModule.load(getDom); }, 100); break; case getDom.hasClass('catalogList'): setTimeout(function () { wsf.catalogList(getDom); }, 100); break; case getDom.hasClass('menu-catalog-module'): setTimeout(function () { wsf.menuCatalogModule(getDom); wsf.f.imgLazyLoading(curDom); }, 100); break; case getDom.hasClass('pic-module'): wsf.f.imgLazyLoading(curDom); break; } } }, animationLoadMo: function (dom) { if (dom.attr('data-loadanimate') != 1) { dom.attr('data-loadanimate', 1); var v = { 'dom': dom, 'st': dom.attr('style') || '', 'aName': dom.data('animate-name'), 'aDelay': dom.data('animate-delay'), 'aDuration': dom.data('animate-duration') }; if (v.aName) { v.dom.addClass('animated ' + v.aName).css({ 'animation-delay': v.aDelay, 'animation-duration': v.aDuration }); setTimeout(function () { v.dom.removeClass('load-animate'); }, v.aDelay.slice(0, v.aDelay.length - 1) * 1000 + 30); setTimeout(function () { v.dom.attr('style', v.st).removeClass('animated ' + v.aName); dom.hasClass('ev-module-edit-box') && (function(){ var videoModule = dom.find('div.ev-custom-video'); if(videoModule.length){ wsf.videoModule.load(videoModule); } var audioModule = dom.find('div.ev-audio-module'); if(videoModule.length){ wsf.audioModule.load(audioModule); } var progressModule = dom.find('div.ev-progress-module'); if(progressModule.length){ wsf.f.progressLoading(progressModule); } }()); // 关于视频的加载 dom.hasClass('customModule') && (function(){ var videoModule = dom.find('div.video-module'); if(videoModule.length){ wsf.videoModule.load(videoModule); } })(); wsf.f.imgLazyLoading(v.dom); v.dom.find('.ev-module-edit-box,.customModule').each(function (i, dom) { dom = $(dom); dom.hasClass('ev-module-edit-box') && (function(){ var videoModule = dom.find('div.ev-custom-video'); if(videoModule.length){ wsf.videoModule.load(videoModule); } var audioModule = dom.find('div.ev-audio-module'); if(videoModule.length){ wsf.audioModule.load(audioModule); } var progressModule = dom.find('div.ev-progress-module'); if(progressModule.length){ wsf.f.progressLoading(progressModule); } }()); // 关于视频的加载 dom.hasClass('customModule') && (function(){ var videoModule = dom.find('div.video-module'); if(videoModule.length){ wsf.videoModule.load(videoModule); } })(); wsf.f.animationLoadMo(dom); }); }, v.aDelay.slice(0, v.aDelay.length - 1) * 1000 + v.aDuration.slice(0, v.aDuration.length - 1) * 1000 + 1); } } }, imgLazyLoading: function(curDom){ curDom.find('.lazy-loading').each(function(i, dom){ dom = $(dom); var oImage = new Image(); oImage.onload = function () { dom.attr('src', this.src).addClass('lazy-loading-animate'); setTimeout(function(){ dom.removeClass('lazy-loading lazy-loading-animate'); }, 1000); }; oImage.src = dom.attr('data-original-src'); }); }, progressLoading: function(curDom){ wsf.progress.load(curDom.eq(0)); }, positionShow: function (curDom, pos) { // 计算模块的九个位置 var domW = curDom.width(), domH = curDom.height(), posArray = [ [0, 'auto', 'auto', 0, 0, 0], [0, 'auto', 'auto', '50%', 0, '-' + domW/2 + 'px'], [0, 0, 'auto', 'auto', 0, '-' + domW], ['50%', 'auto', 'auto', 0, '-' + domH/2 + 'px', 0], ['50%', 'auto', 'auto', '50%', '-' + domH/2 + 'px', '-' + domW/2 + 'px'], ['50%', 0, 'auto', 'auto', '-' + domH/2 + 'px', 0], ['auto', 'auto', 0, 0, 0, 0], ['auto', 'auto', 0, '50%', 0, '-' + domW/2 + 'px'], ['auto', 0, 0, 'auto', 0, 0] ]; curDom.css({ 'top': posArray[pos][0], 'right': posArray[pos][1], 'bottom': posArray[pos][2], 'left': posArray[pos][3], 'margin-top': posArray[pos][4], 'margin-left': posArray[pos][5] }); }, mCScrollbar: function (obj, j) { if (!obj.data('cscroll')) { var j_ = { scrollInertia: 50, scrollbarPosition: 'outside', theme: "dark-3", autoHideScrollbar: false, mouseWheel: {preventDefault: true}, scrollButtons: { enable: false }, callbacks: { onScrollStart: function(){ }, onScroll: function(){ var $this = $(this); if(this.mcs.topPct === 100){ $.scrollify.next(); }else if(this.mcs.topPct === 0){ $.scrollify.previous(); } }, onTotalScroll: function(){ $.scrollify.next(); }, onTotalScrollBack:function(){ $.scrollify.previous(); } } }; if (j) { j_ = $.extend(j_, j); } obj.mCustomScrollbar(j_); obj.data('cscroll', 1); } else { obj.mCustomScrollbar("update"); } } }; //分享 wsf.share = { shareLayerDom :null, wechatCode : null, setwin: function (w, d) { var iWidth = w; //弹出窗口的宽度; var iHeight = d; //弹出窗口的高度; var iTop = (window.screen.availHeight - 30 - iHeight) / 2; //获得窗口的垂直位置; var iLeft = (window.screen.availWidth - 10 - iWidth) / 2; //获得窗口的水平位置; return { iTop: iTop, iLeft: iLeft } }, openWindow: function(getData){ var that = this; var win = window.open(getData.url, "newwindow", "width=" + getData.width + ",height=" + getData.height + ", toolbar=no, menubar=no, scrollbars=no, resizable=no, location=no, status=no,top=" + that.setwin(getData.width, getData.height).iTop + ",left=" + that.setwin(getData.width, getData.height).iLeft ); /* var loop = setInterval(function() {//监听子页面关闭事件,轮询时间1000毫秒 if(win.closed) { clearInterval(loop); alert('子页面已关闭'); } }, 1000); */ if(is_auto_parts_user && (getData.type == 'weibo' || getData.type == 'qzone')){ $.ajax({ 'url':'/dom/AutoParts/share.php', 'type':'post', 'data':{username:user_name,ajax:1,user_user_id:readCookie('zz_userid'),type:getData.type == 'weibo' ? 2 : 4}, 'success':function(res){ var newRes = $.parseJSON(res); if(newRes.code == 200){ if(newRes.data.resCnt > 0){ alert('恭喜您,获得1个抵扣金。今天还可以分享'+newRes.data.resCnt+'次!'); }else{ alert('恭喜您,已分享3次,获得抽奖机会!'); } } } }) } }, bindEvent: function(){ var that = this; wsf.pDom.bodyDom.on({ 'mouseenter.share': function(){ var $this = $(this); if($this.hasClass('evIcon')){ var type = $this.data('type'), data = $this.closest('.share-list').data(); switch (type) { case 'wechat': if(!$this.data('mouseenter')){ $this.data('mouseenter',1); var hostName = location.protocol + '//' + GData.wapDomain, geturl = (data.url && ((data.url).indexOf('vip_') != -1)) ? (data.url).replace(/vip_/, 'wap_') : data.url, div = $('打开微信扫一扫
'); wsf.f.tip.addTip({getDom: $this.closest('li'), html: div}); } break; } } }, 'mouseleave.share': function(){ var $this = $(this); if($this.hasClass('evIcon')) { var type = $this.data('type'); switch (type) { case 'wechat': if($this.data('mouseenter')){ wsf.f.tip.delTip({getDom:$this.closest('li')}); $this.removeData('mouseenter'); } break; } } }, 'click.share': function(){ var $this = $(this); var type = $this.data('type'), data = $this.closest('.share-list').data(), url = encodeURIComponent(data.url ? (data.url.indexOf('http') != -1 ? data.url : (location.origin + data.url)) : location.href), title = encodeURIComponent(data.title || document.title), summary = encodeURIComponent(data.summary || $('meta[name="keywords"]').attr('content')), pic = encodeURIComponent(data.pic || ''); switch(type){ case 'weibo': that.openWindow({ url : 'http://service.weibo.com/share/share.php?url='+url+'&title='+title+'&count='+summary+'&pic='+pic+'&searchPic=true', width: 650, height: 534, type:'weibo' }); break; case 'qzone': that.openWindow({ url : 'http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?url='+url+'&title='+title+'&site='+url+'&summary='+summary+'&desc='+title+'&pics='+pic, width: 650, height: 534, type:'qzone' }); break; case 'qq': if(is_auto_parts_user){ url+='?autoPartsShare=2|'+readCookie('zz_userid'); } that.openWindow({ url : 'http://connect.qq.com/widget/shareqq/index.html?url='+url+'&title='+title+'&site='+url+'&summary='+summary+'&desc='+title+'&pics='+pic, width: 800, height: 680, type:'qq' }); break; case 'douban': that.openWindow({ url : 'http://www.douban.com/recommend/?url='+url+'&title='+title+'&sel='+summary, width: 800, height: 680, type:'douban' }); break; case 'baidu': that.openWindow({ url : 'http://tieba.baidu.com/f/commit/share/openShareApi?url='+url+'&title='+title+'&desc='+summary+'&comment=&pic='+pic, width: 630, height: 640, type:'baidu' }); break; } } }, '.share-list .evIcon'); }, createShareLayer : function(clickDom){ var that = this; that.body = $('body'); if(!that.body.data('sharelayer')){ var listArray = [ ['weibo-3', 'wechat-1', 'qq-9', 'qzone-1', 'baidu-3', 'douban-2'], [['微博', 'weibo'], ['微信', 'wechat'], ['QQ好友', 'qq'], ['QQ空间', 'qzone'], ['百度', 'baidu'], ['豆瓣', 'douban']] ],liArray = []; $.each(listArray[0], function(i, v){ var txtarr = listArray[1][i]; liArray.push('' + nintro + '
" + con + "
"; } //创建检索信息窗口对象 var searchInfoWindow = new BMapLib.SearchInfoWindow(map, con, { title : '', //标题 width : 290, //宽度 panel : "panel", //检索结果面板 enableAutoPan : true, //自动平移 enableSendTophones: false, //是否显示发送到手机按钮 searchTypes :[ // BMAPLIB_TAB_SEARCH, //周边检索 // BMAPLIB_TAB_TO_HERE, //到这里去 // BMAPLIB_TAB_FROM_HERE //从这里出发 ] }); if (wsf.baiduAlter === false) { wsf.baiduAlter = true; searchInfoWindow.open(marker); } marker.addEventListener('click', function () { searchInfoWindow.open(marker); }); }; /** * chart init * * @param type * @param id * @param start * @param end * @param step */ wsf.chartInit = function (type, id, start, end, step, data) { var chartDiv = $('#chartDiv' + id); if(chartDiv.is(':visible') && !chartDiv.data('loaddata')){ chartDiv.html(''); var chart = {}; type = parseInt(type); if (type === 3) { chart = new dhtmlXChart({ view: "line", container: "chartDiv" + id, value: "#value#", item: { borderColor: "#1293f8", color: "#ffffff" }, line: { color: "#1293f8", width: 3 }, xAxis: { template: "#title#" }, offset: 0, yAxis: { start: start, end: end, step: step, template: function (obj) { return obj; } } }); } else if (type === 2) { chart = new dhtmlXChart({ view: "pie", container: "chartDiv" + id, value: "#value#", label: "#title#", pieInnerText: "#value#", shadow: 0, legend: { width: 75, align: "right", valign: "middle", template: "#title#" } }); } else { chart = new dhtmlXChart({ view: "bar", container: "chartDiv" + id, value: "#value#", radius: 0, border: true, xAxis: { template: "#title#" }, yAxis: { start: start, end: end, step: step, template: function (obj) { return obj; } } }); } chart.parse(data, "json"); chartDiv.data('loaddata',1); } }; /* row-classify-module createDate:2015/08/16 横向产品分类列表模块的方法 */ wsf.classifyModule = function () { var classifyModule = $("div.classify-module"); if(classifyModule.length){ var classList = ['classify-hover','pic-classify-hover']; classifyModule.on({ 'mouseenter mouseleave': function (ev) { var $this = $(this),curClass = ''; switch(true){ case $this.hasClass('big-classify'): case $this.hasClass('small-classify'): curClass = classList[0]; break; case $this.hasClass('small-pic-classify'): curClass = classList[1]; break; } ev.type === 'mouseenter' ? $this.addClass(curClass) : $this.removeClass(curClass); } }, ".big-classify,.small-classify,.small-pic-classify"); classifyModule.on('click', '.open-close-btn', function(){ var $this = $(this), action = $this.data('action'); if(action === 'open'){ $this.closest('.small-classify-wrap').addClass('open-state'); $this.data('action', 'close'); }else{ $this.closest('.small-classify-wrap').removeClass('open-state'); $this.data('action', 'open'); } }); } }; /*选择列表*/ wsf.selectState = function () { $("#filterSort").on({ mouseenter: function () { $(this).addClass("select-state-hover"); }, mouseleave: function () { $(this).removeClass('select-state-hover'); } }, ".select-state"); }; /* manual-move-module createDate:2017/08/16 手动移动模块 */ wsf.manualMoveModule = function (obj) { var manual; manual = obj ? obj : $("div.manual-move-module"); manual.each(function () { var t = $(this), li = t.find('li'), liNum = li.length, liW = li.outerWidth(), ulP = t.find(".pic-text-list-module"); li.width(liW); ulP.width(liW * liNum).height(li.outerHeight()); }); manual.on({ click: function () { var t = $(this), id = t.data('id'), obj = t.parent(); moveFun(id, obj); } }, 'em.prev-move,em.next-move'); manual.on({ mouseenter: function () { var t = $(this); if(t.width() < t.find(".pic-text-list-module").width()){ t.find('em.prev-move,em.next-move').css('visibility', 'visible'); } }, mouseleave: function () { var t = $(this); t.find('em.prev-move,em.next-move').css('visibility', 'hidden'); } }); var moveFun = function (dir, obj) { var curManual = obj, list = curManual.find('.manual-move-body'), ulP = curManual.find(".pic-text-list-module"), li = ulP.find('li'), liNum = li.length, liWidth = li.outerWidth(), showNum = Math.floor((list.width()) / liWidth), ulPW = ulP.width(), ulPLeft = Math.abs(parseInt(ulP.css('margin-left'))), move = showNum * liWidth, newMove = ulPW - (ulPLeft + move), nowMove; if (curManual.data('move') == 1) return false; curManual.data('move', 1); if (dir == 'next') { if (newMove > 0 && newMove > move) { nowMove = move; } else { nowMove = newMove; } if (ulPW > move) { ulP.animate({ "marginLeft": "-=" + nowMove }, 500, function () { curManual.removeData('move'); }); } } else { nowMove = ulPLeft > move ? move : ulPLeft; ulP.animate({ "marginLeft": "+=" + nowMove }, 500, function () { curManual.removeData('move'); }); } }; }; /* absolute-menu-catalog createDate:2016/08/16 商城分类模块 */ wsf.absoluteModuleWrapBind = function () { var absMoInner = $("#absolute_module_inner"); absMoInner.on({ mouseenter: function () { var t = $(this); if (t.hasClass('absolute-menu-catalog')) { wsf.absoluteMenuCatalog(); } } }, '.absolute-module'); }; wsf.absoluteMenuCatalog = function () { var menuCatalog = $('div.absolute-menu-catalog'); if (menuCatalog.length > 0) { menuCatalog.each(function () { var t = $(this); if (!t.data('bindevent')) { var open = t.data('open'), amc = t.find('.a-m-c'), mch = t.find('.m-c-h'), mcb = t.find('.m-c-b'), mcm = t.find('.m-c-m'), gap = mcm.find('.gap'); t.on({ mouseleave: function () { if (!open) { amc.removeClass('a-m-c-open'); mch.removeClass('m-c-h-open'); } if (mcm.data('open')) { mcm.data('open', 0).css({ display: 'none' }); } mcb.find('.o-l-e').each(function () { var ot = $(this); if (ot.data('open')) { ot.removeClass('o-l-e-open').data('open', 0); var tNimg = ot.find('.o-l-h-n img'); tNimg.attr('src', tNimg.data('src')); } }); } }); t.on({ mouseenter: function () { if (!open) { amc.addClass('a-m-c-open'); mch.addClass('m-c-h-open'); } } }, '.m-c-h-i'); t.on({ mouseenter: function () { var that = $(this), o_openId = that.data('id'), tagOpen = 0; if (!that.data('open')) { /*更换小图标地址*/ that.addClass('o-l-e-open').data('open', 1); var tNimg = that.find('.o-l-h-n img'), thatSib = that.siblings('.o-l-e-open'), sibNimg = thatSib.find('.o-l-h-n img'); tNimg.attr('src', tNimg.data('hsrc')); thatSib.removeClass('o-l-e-open').data('open', 0); sibNimg.attr('src', sibNimg.data('src')); var oleiBTW = parseInt(that.find('.o-l-e-i').css('borderTopWidth')), tHeight = that.find('.o-l-e-i').height(), mcmiBTW = parseInt(mcm.find('.m-c-m-i').css('borderTopWidth')), tTop = that.position().top - mch.height(); oleiBTW = (isNaN(oleiBTW) ? 0 : oleiBTW); mcmiBTW = (isNaN(mcmiBTW) ? 0 : mcmiBTW); gap.css({ height: tHeight + 'px', top: (tTop + oleiBTW) + 'px' }); if (t.data('mcmfixed')) { mcm.find('.m-c-m-i').css({ 'margin-top': (tTop - mcmiBTW) + 'px' }); } mcm.find('.m-c-m-e').each(function () { var iThis = $(this), m_openId = iThis.data('id'); if (m_openId == o_openId) { iThis.addClass('m-c-m-e-open'); tagOpen = 1; } else { iThis.removeClass('m-c-m-e-open'); } }); if (tagOpen == 1) { if (mcm.data('open') != 1) { mcm.css({ display: 'block', visibility: 'hidden' }); var macT = mch.height(), mcmW = mcm.width(), mcbiBRW = parseInt(mcb.find('.m-c-b-i').css('border-right-width')), mcmiBRW = parseInt(mcm.find('.m-c-m-i').css('border-left-width')), mcmL = mcb.width() - (isNaN(mcbiBRW) ? 0 : mcbiBRW) - (isNaN(mcmiBRW) ? 0 : mcmiBRW); mcm.css({ visibility: 'visible', width: 0, left: mcmL + 'px', top: macT + 'px' }); mcm.animate({ width: mcmW }, 200).data('open', 1); } } else { mcm.css({ display: 'none' }).data('open', 0); } } } }, '.o-l-e'); t.data('bindevent', 1); } }); } }; /* ev-tab-container createDate:2017/09/24 新模块标签项切换功能 */ wsf.evTabContent = { swtichFun: function (targetDom, targetData) { var that = this, CModulePA = targetDom.closest('.CModulePA'), evModuleEditBox = targetDom.find('.ev-module-edit-box:first'); if (!evModuleEditBox.hasClass('ev-tab-active')) { var groupmark = targetDom.attr('data-groupmark'), tabmark = targetDom.attr('data-tabmark'); evModuleEditBox.addClass('ev-tab-active'); var oneClass = '.ev-module-edit'; var twoClass = '.ev-tab-container-two'; switch(targetData.big*1){ case 9: oneClass = '.ev-module-edit.ev-tab-container-one'; twoClass = '.ev-module-edit.ev-tab-container-two'; break; case 26: oneClass = '.ev-module-edit.ev-interact-container-one'; twoClass = '.ev-module-edit.ev-interact-container-two'; console.log(targetData.triggerShow, 'targetData.triggerShow'); if(targetData.small == 2){ if(targetData.triggerShow == 0){ targetDom.addClass('edit-hidden').find('.ev-module-edit-box:first').attr('data-loadanimate', 0); } } break; } CModulePA.children(oneClass).not(targetDom).each(function (i, curDom) { curDom = $(curDom); if(curDom.attr('data-groupmark') === groupmark){ curDom.find('.ev-module-edit-box:first').removeClass('ev-tab-active'); } }); CModulePA.children(twoClass).each(function (i, curDom) { curDom = $(curDom); if (curDom.attr('data-groupmark') === groupmark) { if(curDom.hasClass('ev-tab-active')){ curDom.addClass('none').removeClass('ev-tab-active').find('.ev-module-edit-box:first').attr('data-loadanimate', 0); curDom.find('.video-module, .ev-custom-video').each(function(i, dom){ var video = $(dom).find('video'); video.length && video[0].pause(); }); curDom.find('.ev-audio-module').each(function(i, dom){ dom = $(dom); if(dom.find('.playing').length){ dom.find('.playing').trigger('click'); } }); } if (curDom.attr('data-tabmark') === tabmark) { curDom.removeClass('none').addClass('ev-tab-active'); var dom = curDom.find('.ev-module-edit-box:first'); if (dom.data('animate-name')) { wsf.f.animationLoadMo(dom); }else{ dom.find('.ev-module-edit-box,.customModule').each(function (i, dom) { dom = $(dom); if(dom.hasClass('ev-module-edit-box')){ var videoModule = dom.find('div.ev-custom-video'); if(videoModule.length && !videoModule.data('loaded')){ videoModule.data('loaded', 1) wsf.videoModule.load(videoModule); } var audioModule = dom.find('div.ev-audio-module'); if(videoModule.length && !audioModule.data('loaded')){ audioModule.data('loaded', 1) wsf.audioModule.load(audioModule); } var progressModule = dom.find('div.ev-progress-module'); if(progressModule.length && !progressModule.data('loaded')){ progressModule.data('loaded', 1) wsf.f.progressLoading(progressModule); } } // 关于视频的加载 dom.hasClass('customModule') && (function(){ var videoModule = dom.find('div.video-module'); if(videoModule.length){ wsf.videoModule.load(videoModule); } })(); if(dom.data('animate-name')){ wsf.f.animationLoadMo(dom); }else{ wsf.f.imgLazyLoading(dom); } }); } } } }); } }, hideFun: function(targetDom, targetData){ var one, two; var CModulePA = targetDom.closest('.CModulePA'); var classMark = ''; switch(targetData.big*1){ case 9: classMark = 'tab'; break; case 26: classMark = 'interact'; break; } switch(targetData.threetype){ case 1: one = targetDom; two = CModulePA.children('.ev-'+ classMark +'-container-two[data-groupmark="'+ targetData.groupmark +'"][data-tabmark="'+ targetData.tabmark +'"]'); break; case 2: two = targetDom; one = CModulePA.children('.ev-'+ classMark +'-container-one[data-groupmark="'+ targetData.groupmark +'"][data-tabmark="'+ targetData.tabmark +'"]'); break; } var hideTime = setTimeout(function(){ one.find('.ev-module-edit-box').removeClass('ev-tab-active'); two.addClass('none').removeClass('ev-tab-active'); if(targetData.big * 1 == 26){ two.children('.ev-module-edit-box').attr('data-loadanimate', 0); if(targetData.small == 2 && one.data('triggerShow') == 0){ one.removeClass('edit-hidden'); if (one.children('.ev-module-edit-box').data('animate-name')) { wsf.f.animationLoadMo(one.children('.ev-module-edit-box')); } } } }, 80); one.data('hide-time', hideTime); }, loadBind: function(){ var that = this; wsf.pDom.bodyDom.on( 'mouseenter.tabSwitch click.tabSwitch mouseleave.tabSwitch', '.ev-tab-container-one, .ev-tab-container-two, .ev-interact-container-one, .ev-interact-container-two', function (e) { var $this = $(this); var $thisData = $this.data(); var events = e; var CModulePA = $this.closest('.CModulePA'); var oneDom = null; if($thisData.threetype == 1 && $thisData.trigger == events.type && (($thisData.big == 26 && !is_action) || $thisData.big != 26)){ that.swtichFun($this, $thisData); return; } if(($thisData.big == 26 && !is_action) || ($thisData.big == 9 && $thisData.small == 3) && events.type == "mouseenter"){ if($thisData.threetype == 1){ clearTimeout($this.data('hide-time')); }else{ if($thisData.big == 26){ oneDom = CModulePA.children('.ev-interact-container-one[data-groupmark="'+ $thisData.groupmark +'"][data-tabmark="'+ $thisData.tabmark +'"]'); }else if($thisData.big == 9){ oneDom = CModulePA.children('.ev-tab-container-one[data-groupmark="'+ $thisData.groupmark +'"][data-tabmark="'+ $thisData.tabmark +'"]'); } clearTimeout(oneDom.data('hide-time')); } } if(events.type == "mouseleave" && ($thisData.small == 3 || $thisData.big == 26)){ !is_action && that.hideFun($this, $thisData); } } ); } }; /*弹出层行的js*/ wsf.evAlertRow = { rowDom: null, writeStyle: function (cSId, styleArray) { var cSh = ""; $.each(styleArray, function(i, v){ $.each(v, function(key, v_){ v_ = v_.replace(/\\\'/g, "'"); cSh += v_; }); }); $("head").append(""); }, alertJson: {}, upMocon: function(curAlertDom, data){ if(data.SMModuleConfigJson){ $.each(data.SMModuleConfigJson, function(k, v){ moduleConfig[k] = v; }); } curAlertDom.find('.ev-module-edit,.customModule').each(function (i, dom) { dom = $(dom); var id = null, z = null; if (dom.hasClass('customModule')) { //收藏点赞绑定事件功能 id = dom.children('.Mo').attr('id'); z = wsf.f.s_j(dom.attr('data-attr')).z; var moduleData = wsf.f.s_j(dom.attr('data-attr')); (function () { if (moduleData.mt == 21) { CatalogMore = 1; var menuCatalogMoreModule = $('#menuCatalogMoreModule'); !menuCatalogMoreModule.length && (menuCatalogMoreModule = $('').appendTo($('body'))); menuCatalogMoreModule.append(data.typeOtherHtml); } if(moduleData.mt == 8){ userUserLoginInfo(); } })(); if(moduleData.mt == 7){ wsf.f.upJsFun(dom, data.MFormData); }else{ wsf.f.upJsFun(dom); } } else { wsf.f.upJsFun(dom); } if (data.jsData) { wsf.queryMJsEffect(data.jsData); } }); }, showAlert: function (alertId, openType) {//显示弹窗函数 var that = this, jsonCurDom = null, url = null, parWin = window.parent || null; that.rowDom.is(':hidden') && that.rowDom.show(); jsonCurDom = that.alertJson[alertId]; var setTimFun = function(jsonCurDom){//延迟动画加载函数 setTimeout(function () { var curDom = jsonCurDom[0], curDomEditBox = curDom.find('div.ev-module-edit-box:first'), aDelay = 0,aDuration = 0, timeout; that.rowDom.is(':hidden') && that.rowDom.show(); jsonCurDom[0].removeClass('none'); that.rowDom.append(jsonCurDom[1].removeClass('none')); if (curDomEditBox.data('animate-name')) { wsf.f.animationLoadMo(curDomEditBox); }else{ curDomEditBox.find('.ev-module-edit,.customModule').each(function (i, dom) { dom = $(dom); if(dom.hasClass('customModule')){ wsf.f.animationLoadMo(dom); }else{ var curDomEditBox = dom.find('div.ev-module-edit-box:first'); if(curDomEditBox.data('animate-name')){ wsf.f.animationLoadMo(curDomEditBox); } } wsf.f.imgLazyLoading(dom); }); } }, openType === 'load' ? jsonCurDom[0].attr('data-opendelay') * 1000 : 0); }; if (!jsonCurDom) { $.get('/Ajax/TJIndex.php?type=8&username=' + user_name + '&tab_id=' + alertId + '&ch_id=' + GData.allChId + (is_action ? '&is_design=1' : ''), function (data) { if(data.success * 1){ var loadFun = function(){ jsonCurDom = that.alertJson[alertId] = [$(data.html.replace(/\\'/g,"'")), $('')]; that.rowDom.find('.CModulePA').append(jsonCurDom[0]); //回显点赞,收藏方法 if(data.docSysIds || data.SMAlbumSysIds || data.SMAlbumIds){ GData.docSysIds = GData.SMAlbumSysIds = GData.SMAlbumIds = ''; data.docSysIds && (GData.docSysIds = data.docSysIds); data.SMAlbumSysIds && (GData.SMAlbumSysIds = data.SMAlbumSysIds); data.SMAlbumIds && (GData.SMAlbumIds = data.SMAlbumIds); wsf.albumsDataLoad(); } if(jsonCurDom[0].attr('data-positiontype') * 1){ wsf.f.positionShow(jsonCurDom[0], jsonCurDom[0].attr('data-position') - 1); }else{ jsonCurDom[0].css({ left: Math.floor(jsonCurDom[0].attr('data-lshifting') * 1 + (wsf.pDom.bodyDom.width() - userSiteWidth) / 2) + 'px', top: jsonCurDom[0].attr('data-tshifting') + 'px' }); } that.upMocon(jsonCurDom[0], data); setTimFun(jsonCurDom); if(!is_action){ wsf.evAlertRow.writeStyle(alertId, [data.Mstyle, data.SMstyle]); } }; if(data.MShowStyleList[13] || data.MShowStyleList[12] || data.MShowStyleList[9] || data.MShowStyleList[7]){ var whenArray = []; if(data.MShowStyleList[12] && typeof(BMap) === 'undefined'){ /* whenArray.push($.ajax({ dataType:'script', scriptCharset:'utf-8', url:'//api.map.baidu.com/getscript?v=2.0&ak='+ GData.BAI_DU_MAP_AK+'&services=&t=20180823194355' })); */ // console.log(88888); // $( "