');
self.containerDiv.appendTo('body');
//��ȡ��div���Ҳ�λ��
var topNavBar = $('.top-nav-bar');
var winWidth = topNavBar.width() + topNavBar.offset().left;
var divWidth = 192;
if (offset.left + divWidth > winWidth) {
offset.left = winWidth - divWidth - 2;
}
self.containerDiv.css({
'display': 'none',
'left': offset.left,
'top': offset.top + self.handler.height()
});
self.containerDiv.html(categoryDiv);
//�Զ�̬���ɵ�div���Ӵ��
site.trigger('widget-tracelog', self.containerDiv);
//��ҳ
self.changePage();
//����������Ŀ
self.showSubCategory();
//���Ƹ��㸡��ʱ�����ʧʱ��
new FloatPanel(self.containerDiv, {
handler: self.handler,
event: 'mouseenter',
autoClose: 300,
delay: 300
});
self.handler.trigger('mouseenter');
}
);
},
showOtherCatDiv: function () {
var self = this;
var supList = $('#sup-store-container');
if (supList.length === 0) {
this.getOtherCatDiv(function (supDiv) {
// var offset = self.supHandler.offset();
self.supMainDiv = $('
');
self.supMainDiv.appendTo(self.supHandler.parent());
self.supMainDiv.css({
'position': 'absolute',
'left': 0,
'top': self.supHandler.height(),
"zIndex": 2000
});
self.supMainDiv.html(supDiv);
self.supMainDiv.on('mouseenter', function () {
self.supMainDiv.stop(true, true).show();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
// self.supHandler.removeClass('active');
// self.supMainDiv.delay(100).fadeOut(50);
self.fadeOutOtherCatDiv(100, 50);
})
});
} else {
supList.stop(true, true).fadeIn();
}
},
hideOtherCatDiv: function () {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.hide();
}
},
fadeOutOtherCatDiv: function (delay, time) {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.delay(delay).fadeOut(time)
}
},
getOtherCatDiv: function (callback) {
var self = this;
var config = this.config;
var selectedCats = config.selectedCats;
// try {
// selectedCats = this.config.selectedCats
// } catch(e) {}
if (!config.otherCategoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.otherCategoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
selectedCats: selectedCats
},
success: function (_data) {
callback(_data);
},
error: function () {
// ������⣬ֱ�ӷ�����100%��ʧ�ܣ��������Ի���
self.showOtherCatDiv();
}
});
}
};
AppContext.register('view', 'topNav', OfferCategory);
});
/**
* վ������
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.InstantValidator', 'widget.PlaceHolder'],
function($, AppContext, InstantValidator, PlaceHolder) {
var SearchInSite = {
init: function(div) {
this.div = div;
this.initPriceInput();
this.searchText = $('div.search-text input', div);
new PlaceHolder(this.searchText, { placeholder: '�������Ʒ����' })
this.initSubmit();
},
/**
* ���Ƽ۸������
*/
initPriceInput: function() {
var inputs = $('input.price-low,input.price-high', this.div);
new InstantValidator(inputs, 'price');
},
initSubmit:function(){
$("input.search-btn-big").on("click",function(){
var submitCotent = $("input.search-keywords-big").val().trim();
if (submitCotent == "�������Ʒ����" || submitCotent == "") {
$("input.search-keywords-big").val("");
}else {
$("input.search-keywords-big").val(submitCotent.replace('%',''));
}
});
}
}
//~
AppContext.register('view', 'searchInSite', SearchInSite);
});define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var AutoOfferBig = new Class({
init : function(div, config, data) {
if(data.sortType !== 'recommend'){
return;
}
this.div = div;
this.config = config;
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $('.offer-list-row li', this.div),
offers = this.config.offer;
offers && $.each(offers, function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleExposureTrace: function() {
var self = this,
lis = $('.offer-list-row li', this.div),
offers = [];
lis.each(function(index) {
offers.push($(this).data('offer'));
});
var page = RecUtil.getPageParams(),
objectIds = $.map(offers, function(item) {
return item.id + ',' + (item.alg || 0);
}).join(';'),
params = {
ctr_type: page.nowinport ? 3 : 32,
page_area: page.recid,
interface_id: page.recid,
page_id: page.pageid,
object_type: 'offer',
object_ids: objectIds,
ctr_ns:'',
uid: Aliuser.getLastMemberId(),
time: $.now()
};
var sendExposure = function(){
var img = new Image();
img.src = Util.formatUrl('//web.archive.org/web/20211221161401/http://ctr.1688.com/ctr.html', params || {});
}
new LazyInitializer(this.div, sendExposure);
},
handleClickTrace: function() {
var self = this,
page = RecUtil.getPageParams();
$(this.div).delegate('li div.image,li div.title a', 'click', function(){
var item = $(this).closest('li').data('offer') || {};
// params = {
// page: page.nowinport ? 3 : 32,
// objectId: item.id,
// recId: page.recid,
// interface_id: page.recid,
// alg: item.alg || 0,
// objectType: 'offer',
// st_page_id: page.pageid,
// ctr_ns:'',
// uid: Aliuser.getLastMemberId(),
// time: $.now()
// }
// var img = new Image();
// img.src = Util.formatUrl('//web.archive.org/web/20211221161401/http://stat.1688.com/bt/1688_click.html', params || {});
var gmParams = {
page: page.nowinport ? 3 : 32,
objectId: item.id,
recId: page.recid,
interface_id: page.recid,
alg: item.alg || 0,
objectType: 'offer',
st_page_id: page.pageid,
ctr_ns:'',
uid: Aliuser.getLastMemberId()
}
var gmImg = new Image();
gmImg.src = '//web.archive.org/web/20211221161401/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(gmParams)) + '&time=' + $.now();
});
}
});
var RecUtil = {
getPageParams: function() {
var nowinport = Component.getUserContext().siteId === 'nowinportoffer',
recid = '7103';
return {
recid: recid,
pageid: window.dmtrack_pageid,
nowinport:nowinport
}
}
};
AppContext.register('view', 'autoOfferBig', AutoOfferBig);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer'], function($, Class, AppContext, Component, Util, LazyInitializer) {
var AutoOfferBig = new Class({
init : function(div, config, data) {
if(data.sortType !== 'recommend'){
return;
}
this.div = div;
this.config = config;
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $('.offer-list-row li', this.div),
offers = this.config.offer;
offers && $.each(offers, function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleExposureTrace: function() {
var self = this,
lis = $('.offer-list-row li', this.div),
offers = [];
lis.each(function(index) {
offers.push($(this).data('offer'));
});
var page = RecUtil.getPageParams(),
objectIds = $.map(offers, function(item) {
return item.id + ',' + (item.alg || 0);
}).join(';'),
params = {
ctr_type: page.nowinport ? 3 : 32,
page_area: page.recid,
interface_id: page.recid,
page_id: page.pageid,
object_type: 'offer',
object_ids: objectIds,
ctr_ns:'',
time: $.now()
};
var sendExposure = function(){
var img = new Image();
img.src = Util.formatUrl('//web.archive.org/web/20211221161401/http://ctr.1688.com/ctr.html', params || {});
}
new LazyInitializer(this.div, sendExposure);
},
handleClickTrace: function() {
var self = this,
page = RecUtil.getPageParams();
$(this.div).delegate('li div.image,li div.title a', 'click', function(){
var item = $(this).closest('li').data('offer') || {};
// params = {
// page: page.nowinport ? 3 : 32,
// objectId: item.id,
// recId: page.recid,
// interface_id: page.recid,
// alg: item.alg || 0,
// objectType: 'offer',
// st_page_id: page.pageid,
// ctr_ns:'',
// time: $.now()
// }
// var img = new Image();
// img.src = Util.formatUrl('//web.archive.org/web/20211221161401/http://stat.1688.com/bt/1688_click.html', params || {});
var gmParams = {
page: page.nowinport ? 3 : 32,
objectId: item.id,
recId: page.recid,
interface_id: page.recid,
alg: item.alg || 0,
objectType: 'offer',
st_page_id: page.pageid,
ctr_ns:''
}
var gmImg = new Image();
gmImg.src = '//web.archive.org/web/20211221161401/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(gmParams)) + '&time=' + $.now();
});
}
});
var RecUtil = {
getPageParams: function() {
var nowinport = Component.getUserContext().siteId === 'nowinportoffer',
recid = '7103';
return {
recid: recid,
pageid: window.dmtrack_pageid,
nowinport:nowinport
}
}
};
AppContext.register('view.detail', 'autoOfferBig', AutoOfferBig);
});
define(["jQuery","Class","AppContext","widget.UnStopRoll","widget.UI","widget.ImageLazyLoad"],function(e,i,t,a,o,l){var n=i({init:function(e,i,t){this.div=e,this.config=i,this.data=t,"detail"!==i.effectType&&"detailroll"!==i.effectType||64===parseInt(i.imageSize,10)?"roll"===i.effectType?i.context.diy||MT.ui.bigImgPlay(e):"commonroll"===i.effectType&&this.imageRoll(e,t):this.hoverEffect(e),this.rollImage(e),this.handleResizeImages(e),new l(e)},handleResizeImages:function(i){i=e("div.common-small-64",i),i.length&&i.on("widget-image-lazy-load","img",function(){o.resizeImage(this,64)})},imageRoll:function(i){setTimeout(function(){var t=e("ul.displayWindowCarouselViewList",i);new a(t,{Max:1,animateTime:1500,stopTime:2500})},3e3)},hoverEffect:function(i){i.on("mouseenter","li",function(){var i=e(this),t=e("div.hover-body",i),a=i.height()-e("div.image",i).height();i.addClass("hovered"),a>t.height()&&(i.addClass("fixheight"),t.css("height",a+"px"))}),i.on("mouseleave","li",function(){var i=e(this);i.removeClass("hovered"),e("div.hover-body",i).css("height","")})},rollImage:function(i){var t=function(e){var i=e.data("rollTimer");i&&clearTimeout(i),e.data("rollTimer",!1)};i.on("mouseenter","a.roll-image",function(){var i=e(this),a=i.closest("li");t(a);var o=i.data("imageSrc"),l=e("div.image img",a);l.attr("src",o)}),i.on("mouseleave","a.roll-image",function(){var i=e(this).closest("li");i.data("rollTimer",setTimeout(function(){t(i);var a=e("a.roll-image",i).eq(0),o=e("div.image img",i);o.attr("src",a.data("imageSrc"))},200))})}});t.register("view","offerGeneral",n)});function addOrderCallback(){var e=jQuery(".wp-order-coupon"),n=jQuery(".ui-dialog .sys-purchaselist");n&&e&&0!=e.length&&(e=e.eq(0),n.find(".wp-order-coupon").length<=0&&n.append(e),n.find(".wp-order-coupon").hide(),jQuery("body").trigger("startLotteryPurchase",{selector:".wp-order-coupon"}),n.find(".wp-order-coupon").show())}function clickOrderCallback(){jQuery(".sys-purchaselist .wp-order-coupon").hide()}define(["jquery","AppContext","https://web.archive.org/web/20211221161401/https://astyle-src.alicdn.com/fdevlib/js/fdev-v4/widget/ui/dialog-min.js?v=1.0"],function(e,n){var i={name:"wpCoupon1118",init:function(e,n){this.div=e,this.config=n,this.bindEvents()},bindEvents:function(){}};n.register("view",i.name,i)});define(["jQuery","PageContext","core.Remote","core.Component"],function(e,t,i,a){var r={init:function(){var e=this;this.handPrivateOffer(),setTimeout(function(){e.onAppLoad()},3e3)},handPrivateOffer:function(){var t=e(".private-image-area","div.mod"),i=e(".private-price-area","div.mod");(t.length||i.length)&&this.sendRequest(t,i)},sendRequest:function(t,i){var r=this;return url=a.getGlobalViewConfig("eventUrl"),data={},url?(url+="/event/app/offerGeneral/partnerRelation.htm",url.indexOf("apps.1688.com")>0&&(data._server_name=a.getGlobalViewConfig("domainUrl")),void e.ajax(url,{dataType:"jsonp",data:data,success:function(e){if(e.isSuccess){var a=e.result;r.isPicAuth=a.isPicAuth,r.isPriceAuth=a.isPriceAuth,r._process(t,i)}},error:function(){}})):void this.sendCallEvent(t,i)},sendCallEvent:function(e,t){var a=this;i.callEvent("offerGeneral","partnerRelation",{success:function(i){if(i.isSuccess){var r=i.result;a.isPicAuth=r.isPicAuth,a.isPriceAuth=r.isPriceAuth,a._process(e,t)}},error:function(){}})},onAppLoad:function(){var t=this;site.on("app-view-ready",function(i){var a=e(".private-image-area",i),r=e(".private-price-area",i);(a.length||r.length)&&("undefined"==typeof t.isPicAuth?t.sendRequest(a,r):t._process(a,r))})},_process:function(t,i){this.isPicAuth?(t.addClass("authed"),t.closest(".offer-list-row-offer").find(".image-item-summm").each(function(){var t=e(this),i=t.data("summurl"),a=t.data("actualsrc");t.attr("src",i).data("bigsrc",a)})):t.each(function(){e(this).closest("div.image").find("div.private-image-clean").remove()}),this.isPriceAuth&&(i.addClass("authed"),i.each(function(){var t=e(this),i=t.attr("data-p");e(".price-container",t).html(i),e(".price-item",t).html(i)}))}};t.add("offer_partner_relation",r)});define(['jQuery', 'Class', 'AppContext', 'widget.Util', 'widget.UI', 'part.SiteAlitalk', 'core.Component'],
function($, Class, AppContext, Util, UI, SiteAlitalk, Component) {
var ContactBig = new Class({
init : function(div, config, data) {
this.div = div;
this.config = config;
this.initMobile();
this.initAlitalk();
},
initMobile: function(){
var self = this,
isTopDomain = this.config.context.isTopDomain;
var phoneContainer = $('dl.m-mobilephone', this.div),
needNotLogin = phoneContainer.data('needNotLogin'),
phoneNo = phoneContainer.data('no');
if (needNotLogin) {
return ;
}
if (Component.isLogin()) {
var phoneNoContaner = $('.mobile-number', phoneContainer);
phoneNoContaner.html(phoneNo);
return ;
}
var phoneLoginContaner = $('.mobilephone', phoneContainer);
// �����Ҫ��¼����û�е�¼
if (isTopDomain) { //��������
var loginUrl = null;
loginUrl = Util.formatUrl(phoneLoginContaner.attr('href'), {
targetUrl: window.location.href
});
phoneLoginContaner.attr('href', loginUrl);
phoneLoginContaner.show();
} else {//��������
phoneLoginContaner.show();
$.add('wp-logist', {
css: ['https://web.archive.org/web/20211221161401/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20211221161401/http://style.c.aliimg.com/sys/js/logist/logist-min.js'],
ver: '1.0'
});
phoneLoginContaner.click(function(e) {
$.use("wp-logist", function(){
FE.sys.logist({
onLoginSuccess: function(){ //��½�ɹ���ص�����
window.location.reload();
},
onRegistSuccess: function(){ //ע��ɹ���ص�����
window.location.reload();
}
});
});
return false;
});
}
},
initAlitalk: function() {
var alitalk = $('a[data-alitalk]', this.div);
new SiteAlitalk(alitalk);
}
});
AppContext.register('view', 'contactBig', ContactBig);
});
/**
* @anchor han.hsh
* @date 2015.8.12
* ʹ���°�������� 2017-12-22 zhao.zdw
*/
define([ 'jQuery', 'core.Remote', 'core.Component','lofty/alicn/aliuser/1.0/aliuser', '//web.archive.org/web/20211221161401/http://g.alicdn.com/aliww/ww-light-cbu/index.js' ],
function($, Remote, Component,AliUser, Aliww ) {
/*var domainUrl = $('.wp-aliwangwang input.currentdomain').val();
var self = this;
var eventUrl = Component.getGlobalViewConfig('eventUrl');
if(typeof domainUrl == 'undefined'){
return;
}
$('.gold-wangwang').click(function(){
var page_id;
var wangSource = $(this).data('wangsource');
if(window.dmtrack_pageid){
page_id = dmtrack_pageid;
}
if(window.goldlog){
goldlog.record('/1688-winport-element.click.shopclick','CLK','click_type=' + wangSource + '&page_id=' + page_id,'H1511971673');
}
});
$('.wp-aliwangwang').each(function(index, item) {
var href = $(item).attr('href');
var alitalk = $(item).data('alitalk');
if (AliUser.isLogin()) {
href = href.replace(/fromid\=(.*)$/ig, "fromid=cnalichn" + encodeURIComponent(AliUser.getLoginId()));
alitalk.fromid = "cnalichn" + AliUser.getLoginId();
}else{
var lastId = AliUser.getLastLoginId();
if(lastId){
lastId = lastId.replace(/"/g, "")
href = href.replace(/fromid\=(.*)$/ig, "fromid=cnalichn" + encodeURIComponent(lastId));
alitalk.fromid = "cnalichn" + lastId;
}else{
href = href.replace(/fromid\=(.*)$/ig, "fromid=");
alitalk.fromid = "";
}
}
$(item).data("alitalk", alitalk);
$(item).attr("href", href);
});*/
});
/**
* @fileoverview ����֤����
*
*/
define(['jQuery','AppContext', 'Class', 'core.Component', 'core.Remote'],
function($, AppContext, Class, Component, Remote) {
var CertificateBig = new Class({
template:
'<% if (certs.length) { %>\
\
\
֤��ͼƬ | \
֤������ | \
��֤���� | \
���� | \
\
<% jQuery.each(certs, function(index, cert) { %>\
\
 | \
<%= cert.name %> | \
<%= cert.origin %> | \
<%= cert.dateDesc %> | \
\
<% }); %>\
\
\
<% } else { %>\
����֤������
\
<% } %>',
init: function(div, config, data) {
this.div = div;
this.config = config;
var self = this;
if (!data.maxNum) {
data.maxNum = 4;
}
var url = Component.getGlobalViewConfig('eventUrl');
if(url) {
url += '/event/app/certificateSmall/getCertificate.htm';
$.ajax(url, {
data: {
// _csrf_token: Component.getUserContext('csrfToken'),
_server_name: Component.getGlobalViewConfig('domainUrl'),
memberId: config.context.uid,
maxNum: data.maxNum
},
dataType: 'jsonp',
success: function(ret) {
ret.success && self.render(ret.cert_data || [], config.context.uid);
}
});
} else {
Remote.callEvent('certificateSmall','getCertificate',{
pageAware: true,
data: {
memberId: config.context.uid,
maxNum: data.maxNum
},
type: 'post',
success: function(ret) {
ret.result && ret.result.success && self.render(ret.result.cert_data || [], config.context.uid);
}
});
}
},
render: function(certs, memberId) {
var self = this,
content = $('div.m_container', this.div);
this.filterData(certs, memberId);
var data = {
certs: certs,
moreUrl: self.config.moreUrl
}
var html = FE.util.sweet( self.template).applyData(data);
content.html(html);
},
filterData: function(certs, memberId) {
var self = this,
detailBase = self.config.creditDetailBaseUrl,
detailUulBase = self.config.certificateDetailUrl;
$.each(certs, function() {
var cert = this;
cert.name = $.util.escapeHTML(cert.name);
cert.origin = $.util.escapeHTML(cert.origin);
cert.detailUrl = detailUulBase + '?memberId=' + memberId + '&certifyInfoId=' + cert.certifyInfoId;
cert.smallImg = cert.imgPath;
cert.dateDesc = self.formatDateDesc(cert);
});
},
formatDateDesc: function(cert) {
var startDate = new Date(parseInt(cert.dateStart));
var endDate = new Date(parseInt(cert.dateEnd));
return this.dateFormat(startDate, 'yyyy-MM-dd') + (cert.dateEnd ? ' �� ' + this.dateFormat(endDate, 'yyyy-MM-dd') : ' ��');
},
dateFormat: function(date, fmt) { //java Dateת��Ϊfmt��ʽ��String
var o = {
"M+": date.getMonth() + 1, //�·�
"d+": date.getDate(), //��
"h+": date.getHours(), //Сʱ
"m+": date.getMinutes(), //��
"s+": date.getSeconds(), //��
"q+": Math.floor((date.getMonth() + 3) / 3), //����
"S": date.getMilliseconds() //����
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
});
AppContext.register('view', 'certificateBig', CertificateBig);
});
define(["jQuery","AppContext","part.SiteAlitalk2"],function(i,c,l){var o={init:function(c,o){this.div=c,this.config=o,this.collectShopGoldClick(c,o),new l(i("a.wangwang",c))},collectShopGoldClick:function(c){i(".collect\uff0dwp",c).click(function(){var i;window.dmtrack_pageid&&(i=dmtrack_pageid),window.goldlog&&goldlog.record("/1688-winport-element.click.shopclick","CLK","click_type=collectshop&page_id="+i,"H1511971673")})}};c.register("view","supplierInfoSmall",o)});define([ 'jQuery', 'AppContext', 'widget.UI' ], function($, AppContext, UI) {
var CategorySmallView = ({
init : function(div, config, data) {
this.div = div;
this.resizeImages();
this.initCats();
this.initCollapse();
},
/**
* ����ͼƬ�������>150��Ҫ��С
*/
resizeImages : function() {
var imgs = $('li a img', this.div);
UI.resizeImage(imgs, {
width : 150
});
},
/**
* ��ʼ����Ŀ��״�ṹ
*/
initCats : function() {
var self = this, root = $('ul:first>li', this.div);
// ����Ŀ
root.eq(-1).addClass('last-cat');
root.each(function() {
var elm = $(this), lis = $('li', elm);
if (!lis.length) {
return;
}
elm.addClass('expand');
lis.eq(-1).addClass('last');
});
},
initCollapse : function() {
$(this.div).delegate('.expand', 'click', function(event) {
$(this).children('.cat-hd').toggleClass('collapse');
$(this).children('.cat-bd').toggle();
if($('.shop-category>div.bd>ul',CategorySmallView.div).attr('class') == "vas"){
if(!$(this).children('.cat-hd').hasClass('collapse')){
$(this).children('.cat-hd').css({
'background-position':'0 -28px'
});
}else{
$(this).children('.cat-hd').css({
'background-position':'0 0'
});
}
}
});
$(this.div).delegate('.cat a', 'click', function(event) {
event.stopPropagation();
return true;
});
}
});
AppContext.register('view', 'categorySmall', CategorySmallView);
});
define([ 'jQuery', 'AppContext', 'Class'], function($, AppContext, Class) {
var CategorySmallView = new Class({
init : function(div, config, data) {
this.div = div;
this.config = config;
//�����װ��̨�������ظ���Ч��
if(!config.context.diy){
this.showSubCategory();
}
},
//����������Ŀ
showSubCategory:function(){
var self = this;
var firstCategory = $('li.sec', self.div);
//������һ����Ŀչʾ������Ŀ����
self.div.on('mouseenter','li.sec', function(){
var className = $(this).data("index");
if(self.subCategory && self.subCategory.length > 0){
self.subCategory.css("display","none");
}
var position = $(this).position();
var subSize = $("input[name=subSize]",$(this)).val();
var left = position.left + 189;
self.hoverClass = "rhover";
if(self.div.is('div.layout-m0s5 .grid-sub div.mod') || self.div.is('div.layout-s5m0s5 .grid-extra div.mod')){
//������ң�����߸���
if(subSize > 10){
left = position.left - 402;
} else{
left = position.left - 202;
}
self.hoverClass = "lhover";
}else{
//����������ұ߸���
}
if(!$(this).hasClass(self.hoverClass)){
$(this).addClass(self.hoverClass);
}
self.subCategory = $("div." + className, self.div).css({
'display':'block',
'left':left,
'top':position.top + 1
});
self.subCategory.bind('mouseleave', function(){
$(this).css("display","none");
firstCategory.removeClass(self.hoverClass);
});
});
//����뿪һ����Ŀ���ض�����Ŀ����
self.div.on('mouseleave','li.sec', function(){
var handler = this;
var className = $(this).attr("data-index");
self.timeOut = setTimeout(function(){
$("div." + className, self.containerDiv).css("display","none");
//�˳�һ����Ŀȥ��hoverЧ��
$(handler).removeClass(self.hoverClass);
},20);
//��һ����Ŀ���������Ŀ����ʱ�����ֶ�����Ŀ���㲻����
self.subCategory.bind('mouseenter', function(){
clearTimeout(self.timeOut);
});
});
}
});
AppContext.register('view.emersion', 'categorySmall', CategorySmallView);
});
define(['jQuery', 'Class', 'AppContext', 'widget.UI'],
function($, Class, AppContext,UI) {
var WinportFooter = new Class({
init : function(div, config) {
this.initShield(div);
this.bindEvent();
this.resetCss(div);
//�÷����dz���� ��Ϊ��������Ҳ��һ���ײ����� ��Ҫ��offerdetail�ĵ��������ص�
if(config.isJkWp){
$('#site_footer .app-footerNavigation .m-content').addClass('fd-hide');
}
},
initShield : function(div){
var imgs = $('img.shield-img',div);
UI.resizeImage(imgs, {height:70});
},
resetCss:function(div){
var layout_type=$("#site_footer").attr("data-layout-type");
if(layout_type&&"fluid"==layout_type){
//�����ȫ�����֣���û�б�Ҫ���ּ��
$(div).addClass("mod-winport_footer_no_margin");
}
//�����footNav app��û�б�Ҫ���ּ��
var footerNavigation=$("#site_footer").find(".app-footerNavigation");
if(footerNavigation.length>0){
$(div).addClass("mod-winport_footer_no_margin");
}
},
bindEvent:function(){
var self = this;
$('.icphref',this.div).on('click',function(e){
e.preventDefault();
var url = $(this).data('url');
if(url){
window.open(url);
}
});
}
});
AppContext.register('view', 'winport_footer', WinportFooter);
});
/**
* ʵ���̼�����ͷ��
* @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;
console.log('[TopNav] ===> config', config);
if (config.useAStorePageData) {
this.renderAStoreHeader(this.config);
return;
}
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));
},
renderAStoreHeader: function (config) {
console.log('[TopNav] ===> render new page header', config);
// ��ҳ�����ݷŵ�ȫ��
AppContext.__astorePageData__ = config.astorePageData;
window.__astorePageData__ = config.astorePageData;
var moduleName = 'wp_pc_common_header';
var containNode = 'astore-header';
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, config.astorePageData);
}
};
AppContext.register('view', '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/20211221161401/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/20211221161401/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/20211221161401/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