var _____WB$wombat$assign$function_____ = function(name) {return (self._wb_wombat && self._wb_wombat.local_init && self._wb_wombat.local_init(name)) || self[name]; };
if (!self.__WB_pmw) { self.__WB_pmw = function(obj) { this.__WB_source = obj; return this; } }
{
let window = _____WB$wombat$assign$function_____("window");
let self = _____WB$wombat$assign$function_____("self");
let document = _____WB$wombat$assign$function_____("document");
let location = _____WB$wombat$assign$function_____("location");
let top = _____WB$wombat$assign$function_____("top");
let parent = _____WB$wombat$assign$function_____("parent");
let frames = _____WB$wombat$assign$function_____("frames");
let opener = _____WB$wombat$assign$function_____("opener");
/**
* 实力商家旺铺头部
* @author qijun.weiqj
*/
define(['jQuery', 'AppContext', 'core.AppLoader', 'widget.PlaceHolder', 'core.StyleLoader', 'core.Component', 'core.Remote', 'lofty/alicn/aliuser/1.0/aliuser' , 'part.SiteAlitalk2'],
function($, AppContext, AppLoader, PlaceHolder, StyleLoader, Component, Remote, Aliuser, SiteAlitalk) {
var Topbar = {
init: function(div, config) {
this.div = div;
this.config = config;
this.initDesignBar(); //初始化designbar,在旺铺右侧浮动
this.initWW();
},
initDesignBar: function() {
var self = this,
designBar = $(''),
siteContent = $('div#site_content');
if (this.config.context.uid === Aliuser.getLastMemberId() && this.config.context.pageType === 'index') {
$(this.div).append(designBar);
if (siteContent.length > 0) {
$(window).resize(function () {
designBar.css({right: ($('body').width()-siteContent.width())/2 - 10 - designBar.width()});
});
$(window).resize();
}
designBar.show();
}
},
initWW : function(){
new SiteAlitalk($("a.wangwang", this.div));
}
};
AppContext.register('view', 'topbar', Topbar);
});
/**
* winport_banner
* @author moyan
*/
define(['jquery', 'AppContext'], function ($, AppContext) {
var Banner = {
name: 'winport_banner',
init: function (div, config) {
this.div = div;
this.config = config;
this.openSpeed = 800; // 打开banner的速度设定为800ms
this.closeSpeed = 500; // 关闭banner的速度设定为500ms
// target节点
this.$container = $('.container',this.div);
// 页面节点存在
if(this.$container){
// 显示banner广告位
this.$container.slideDown(this.openSpeed);
// 绑定版块事件
this.bindEvents();
}
},
bindEvents: function(){
var self = this;
self.div.on('click', '.operate .close', function(){
self.onClose();
});
},
onClose: function() {
var self = this;
self.$container.slideUp(this.closeSpeed, function(){
self.$container.remove();
});
}
};
AppContext.register('view', Banner.name, Banner);
});
define(["jquery","AppContext"],function(i,n){var e={name:"winport_promotion_banner",init:function(i,n){this.div=i,this.config=n,this.bindEvents()},bindEvents:function(){var i=this,n=this.div.find(".wp-credit-operate");n.slideDown(800),this.div.on("click",".operate .close",function(){i.div.slideUp(500,function(){n.remove()})})}};n.register("view",e.name,e)});/**
* @anchor han.hsh
* @date 2015.8.12
*/
define(['jQuery', 'AppContext', 'core.AppLoader2', 'widget.PlaceHolder', 'core.StyleLoader', 'core.Component', 'core.Remote', 'lofty/alicn/aliuser/1.0/aliuser'],
function($, AppContext, AppLoader, PlaceHolder, StyleLoader, Component, Remote, Aliuser) {
var TopBar = {
init: function(div, config) {
this.div = div;
this.config = config;
this.hasShopInfo = false;
MastHead.init(div, config);
this.cutString(div);
this.showMore(div);
this.initSearch(div);
this.fdOutQRcode(div);
},
cutString: function(div) {
var companyName = $('div.shop-info div.company-name', div),
brandName = $('div.shop-info div.brand-name', div),
superBrandName = $('div.shop-info div.superbrand-name', div);
if(companyName.length > 0) {
companyName.text(this.ellipsis(companyName.text(), 200, 14));
}
if(superBrandName.length > 0){
var brandNameInfo = superBrandName.data('brandname');
superBrandName.text('品牌:' + this.ellipsis(brandNameInfo, 160, 12));
}
if(brandName.length > 0) {
brandName.text(this.ellipsis(brandName.text(), 125, 14));
}
},
ellipsis: function(str, len, fs){
var el;
if(!str) return;
if (!el) {
el = $('
').appendTo(document.body);
}
var ret, i = 1, l = str.length;
while (i <= l) {
el.text( ret = str.substring(0, i++) );
if (el.width() > len) {
ret = ret.replace(/..$/, '...');
break;
}
}
return ret;
},
showMore: function(div) {
var self = this,
bsrSellerInfo = $('div.bsr-sellerinfo', div),
shopInfo = $('div.shop-info', bsrSellerInfo),
shopInfoMore = $('a.more', bsrSellerInfo),
sellerInfo = $('div.seller-info', bsrSellerInfo),
shopQRcode = $('i.thumbnail'),
shopQRcodeContainer = $('div.shop-qrcode', div),
personalized = self.config.personalized;
// var bsrSellerInfo = $('div.bsr-sellerinfo', div);
self.qrcode = $('div.qrcode', div);
if(shopInfoMore.length > 0) {
bsrSellerInfo.on('mouseenter', function(e) {
shopInfoMore.addClass('show-more');
if(!self.hasShopInfo) {
self.hasShopInfo = true;
aliclick(this,'?tracelog=wp_head_wp_infor');
AppLoader.load({
appName: 'sellerinfo',
appStyles: {
js: true,
css: true
},
data : {
_server_name : self.config.currentDomainUrl
},
csrf_token: true,
success: function(html) {
sellerInfo.html(html);
sellerInfo.slideUp(0);
setTimeout(function(){
sellerInfo.slideDown(200);
},100);
}
});
}
sellerInfo.slideDown(200);
});
bsrSellerInfo.on('mouseleave', function(e) {
shopInfoMore.removeClass('show-more');
sellerInfo.slideUp(0);
});
}
shopQRcode.hover(function(e) {
qrcodeImg = $('img', self.qrcode);
if(qrcodeImg.length > 0){
self.showQRcode();
return;
}
self.processQRcode();
},function(e) {
});
shopQRcodeContainer.on('mouseleave', function(e) {
self.qrcode.slideUp(0);
if(shopQRcode.length > 0) {
shopQRcode.removeClass('show-more');
}
});
},
processQRcode: function(){
var self = this,
eventUrl = Component.getGlobalViewConfig('eventUrl');
if(!self.qrloading){
self.qrloading = true;
}else{
return;
}
if(eventUrl){
var domainUrl = $('#content').data('viewConfig').domainUrl;
eventUrl += '/event/app/topbar/getQRcode.htm?_server_name=' + domainUrl;
$.ajax(eventUrl, {
dataType: 'jsonp',
success: function(result) {
if (result.isSuccess) {
var codeUrl = result.codeUrl;
self.showQRcode(codeUrl);
}
}
});
} else {
Remote.callEvent('topbar','getQRcode',{
pageAware: true,
type: 'post',
success: function(result) {
if (result.isSuccess) {
var codeUrl = result.result.codeUrl;
self.showQRcode(codeUrl);
}
}
});
}
},
showQRcode: function(codeUrl){
if(codeUrl){
this.qrcode.prepend('
');
}
this.qrcode.slideDown(200);
this.qrloading = false;
aliclick(this,'?tracelog=wp_head_wp_2dcode');
},
initSearch: function(div) {
var self = this,
wpSearch = $('div.wp-search', div);
if(!wpSearch.length) {
return;
}
var searchForm = $('form', wpSearch),
keywords = $('input.search-keywords', wpSearch),
searchWpBtn = $('button.search-wp-btn', div),
searchGlobalBtn = $('button.search-global-btn', div),
siteSearchUrl = '//web.archive.org/web/20190613194434/https://s.1688.com/selloffer/offer_search.htm',
importSearchUrl = '//web.archive.org/web/20190613194434/https://in.1688.com/import/offer_search.htm';
if(self.config.personalized){
siteSearchUrl = self.config.personalizedConfig.marketSearchUrl;
}
searchWpBtn.on('click', function(e) {
if(self.div.hasClass('brand-topbar')) {
aliclick(this,'?tracelog=wp_head_pp_searchwp');
} else {
aliclick(this,'?tracelog=wp_head_wp_searchwp');
}
});
searchGlobalBtn.on('click', function(e) {
e.preventDefault();
if(self.div.hasClass('brand-topbar')) {
aliclick(this,'?tracelog=wp_head_pp_search1688');
} else {
aliclick(this,'?tracelog=wp_head_wp_search1688');
}
if(keywords.val()!==''){
var origAction = searchForm.attr('action'),
origTarget = searchForm.attr('target');
if(searchGlobalBtn.hasClass('search-import-btn')){
searchForm.attr('action', importSearchUrl);
}else{
searchForm.attr('action', siteSearchUrl);
}
searchForm.attr('target', '_blank');
searchForm.trigger('submit');
keywords.val('');
searchForm.attr('action', origAction);
searchForm.attr('target', origTarget);
}
});
},
fdOutQRcode : function(div){
var self = this;
if(self.config.isOfferDetail){
return;
}
var shopQRcode = $('i.thumbnail');
shopQRcode.trigger('mouseenter')
setTimeout(function(){
shopQRcode.trigger('mouseleave');
}, 3000);
}
};
var MastHead = {
init: function(div, config) {
var lasyloadContainer = $('div.masthead-lasyload-container', div);
if (!lasyloadContainer.length || typeof iDetailConfig === 'undefined') {
return;
}
var container = $('div.masthead-lasyload-container', div),
url = container.data('cmstemplate'),
searchWpUrl = container.data('searchWpUrl');
$.ajax(url, {
data: {
searchWpUrl: searchWpUrl,
categoryId: iDetailConfig.catid
},
dataType: 'JSONP',
success: function(result) {
if (result.success) {
var html = $.util.unescapeHTML(result.data.content);
var $subLogo = $(html).find('div.sub-logo'),
$subCategory = $(html).find('div.sub-category');
container.find('#ali-masthead-v6').removeClass("standard").addClass("detail");
container.find('div.sub-logo').replaceWith($subLogo);
container.find('div.sub-category').replaceWith($subCategory);
}
}
});
}
};
AppContext.register('view', 'common_topbar', TopBar);
});define(["jquery","AppContext","Class","widget.VideoPlay","core.Remote","util.Util"],function(i,e,t,o,s,a){var l=new t({init:function(i,e){var t=this;t.config=e,t.div=i,s.callEvent("shopPropaganda","getPropaganda",{data:{memberId:t.config.context.uid,_csrf_token:t.config.context.csrfToken},type:"post",success:function(e){if(e.result){var s='';if(s+='
',s+='
',s+='
'+a.escape(e.result.name)+"
",s+='
',s+='
',s+="
",s+="
",s+="
",t.div.append(s),t.container=i.find(".video-container"),t.videoInfo=e.result||{},"online"===e.result.status){var l=t.options={width:250,height:250,autoplay:!0,loop:!1,controls:!0,poster:e.result&&e.result.extendInfo&&e.result.extendInfo.coverImg||"https://web.archive.org/web/20190613194434/https://img.alicdn.com/tfs/TB1RUrPaBTH8KJjy0FiXXcRsXXa-1125-618.png",adaptShape:!0};t.smallVideo=new o(t.container,t.videoInfo.address,l),t.addSmallBtnEvent(),t.addBigBtnEvent(),t.adaptVerticalVideoSize(),t.bindPlayStatus()}else t.div.remove()}},error:function(){}})},addSmallBtnEvent:function(){var i=this;this.container.find(".vjs-control-bar").append(''),this.container.find(".vjs-control-bar").append(''),this.container.find(".show-big-video").on("click",function(){i.smallVideo.getVideoEl().muted=!1,i.clickShowBig()}),this.container.find(".close").fadeIn().on("click",function(){i.smallVideo.destroy(),i.div.remove()})},clickShowBig:function(){var i=this;i.toggleShowArrow(),i.showBigShadow(),i.smallVideo.getVideoEl().volume=i.volume||.5,i.volume=i.smallVideo.getVideoEl().volume,i.smallVideo.play(),i.playStatus="play"},addBigBtnEvent:function(){var i=this;this.container.find(".big-close").on("click",function(){i.playStatus="pause",i.container.find(".show-small-video").trigger("click"),setTimeout(function(){i.container.find(".show-small-video").removeClass("show-table-cell")})}),this.container.find(".show-small-video").on("click",function(){i.toggleShowArrow(),i.hideBigShadow(),i.volume=i.smallVideo.getVideoEl().volume,i.smallVideo.play(),i.smallVideo.getVideoEl().muted="play"==i.playStatus?!1:!0})},toggleShowArrow:function(){this.container.find(".show-big-video, .show-small-video").toggleClass("show-table-cell"),this.container.find(".close, .big-close").toggle()},hideBigShadow:function(){var e=this;this.div.removeClass("is-big"),i(".video-player",this.container).css({"max-width":""+this.options.width+"px","max-height":""+this.options.height+"px"}),e.isVerticalVideo&&i(e.smallVideo.video).css("max-height",""+this.options.height+"px")},showBigShadow:function(){var e=this;e.div.addClass("is-big"),i(".video-player",this.container).css({"max-height":"600px","max-width":"1000px"}),e.isVerticalVideo&&i(e.smallVideo.video).css("max-height","600px")},bindPlayStatus:function(){var i=this;i.smallVideo.on("video:play",function(){i.playStatus="play"}),i.smallVideo.on("video:pause",function(){i.playStatus="pause"})},adaptVerticalVideoSize:function(){var e=this;this.smallVideo.on("video:play",function(){setTimeout(function(){var t=i(e.smallVideo.video),o=t.data("has-fixed");!o&&t.height()>=t.width()?(e.isVerticalVideo=!0,t.css({width:"auto","max-height":""+e.options.height+"px"}),t.data("has-fixed",!0),e.container.css("visibility","visible")):o||(t.data("has-fixed",!0),e.container.css("visibility","visible"))},1e3)})}});e.register("view","shopPropaganda",l)});define(["jquery","AppContext","core.AppLoader"],function(i,e){var n={init:function(i,e){this.div=i,this.config=e,console.log("...invite diaolog ....."),e.hasInviteResult&&this.bindMsgRecive()},bindMsgRecive:function(){var i=this;window.addEventListener("message",function(e){var n=e.data||{};"inviteDialog"===n.origin&&"close"===n.action&&i.div.remove()})}};e.register("view","invite_dialog",n)});define(["jquery","AppContext"],function(n,o){var i={init:function(n,o){this.div=n,this.config=o,o.requestFromSync||(this.bindMsgRecive(),this.monitorScroll(o))},bindMsgRecive:function(){var n=this;window.addEventListener("message",function(o){var i=o.data||{};if("winportIframe"===i.origin&&"open"===i.action&&n.div.show().css(i.style),"winportIframe"===i.origin&&"close"===i.action&&n.div.empty().hide(),"winportIframe"===i.origin&&"login"===i.action){const e=window.location.href,t="https://web.archive.org/web/20190613194434/https://login.1688.com/member/signin.htm?Done="+encodeURIComponent(e);window.location.href=t}})},monitorScroll:function(o){o&&o.context&&"merchants"===o.context.pageType&&n(window).on("scroll",function(){document.querySelector("#embed_iframe").contentWindow.postMessage({type:"daifa"},"https://web.archive.org/web/20190613194434/https://tao.1688.com")})}};o.register("view","common_dialog",i)});define(["jQuery","AppContext"],function(o,t){var e={init:function(o,t){this.div=o,this.config=t,this.checkShowCustom()},closeEvents:function(t){var e=this,i=this.config.context.uid,n=e.firstCharToUpper(t);o(".close",this.div).on("click",function(o){o.preventDefault(),o.stopPropagation(),e.div.remove(),localStorage.setItem(n+"-"+i,(new Date).getTime())})},checkShowCustom:function(){var o=this,t=this.config.context.uid;if(o.config.showNewCustomerPro){var e=localStorage.getItem("newCustomerPromotion-"+t);if(!e)return this.showApp("new-customer-promotion");var i=864e5;if((new Date).getTime()-e>i)return this.showApp("new-customer-promotion");o.checkShowCoupon()}else o.checkShowCoupon()},checkShowCoupon:function(){var o=this,t=this.config.context.uid;if(o.config.showCouponLayer){var e=localStorage.getItem("couponLayer-"+t);if(!e)return this.showApp("coupon-layer");var i=864e5;if((new Date).getTime()-e>i)return this.showApp("coupon-layer")}},firstCharToUpper:function(o){if(!o)return o;for(var t=o.split("-"),e=1;e