"),t.before(a));var r=function(){n.initTpl(a,t)};t.data("lazyLoadHandler",r),new i(a,r)})},initTpl:function(t,n){var i=n.val();i=i.replace(/<(\/?script[^>]*)>/g,"<$1>");var r=e(i),o=null,s=null;a.info("lazy load for "+r),r.addClass("ui-lazy-load"),t.replaceWith(r),n.remove(),r.is("div[mod-box]")?(s=r,o=e(">div.mod",s)):r.is("div[data-app]")&&(o=r),s&&site.trigger("app-box-ready",s),o&&site.trigger("app-view-ready",o)}};n.add("plugin.LazyLoad",r)}),define(["jQuery","PageContext"],function(e,t){var n={init:function(){setTimeout(e.proxy(this,"initAutoTracelog"),5e3),setTimeout(e.proxy(this,"initExpTracelog"),3e3)},initAutoTracelog:function(){var e=this;this.handle("click",function(t,n){t.is("input:text")||t.is("select")||e.trace(n)}),this.handle("change",function(t,n){t.is("select")&&e.trace(n)});var t="tracelogLastValue";this.handle("blur",function(n,i){if(n.is("input:text")){var a=n.data(t),r=n.val();a!==r&&(e.trace(i),n.data(t,r))}})},handle:function(t,n){e("body").on(t,"[data-tracelog]",function(){var t=e(this),i=t.data("tracelog");i&&n(t,i)})},initExpTracelog:function(){var t=this,n=function(n){var i=e("div[data-tracelog-exp],ul[data-tracelog-exp]",n);i.each(function(){var n=e(this),i=n.data("tracelogExp");i&&t.trace(i),n.removeData("tracelogExp")})};n("body"),site.on("widget-tracelog",n)},trace:function(e){aliclick(null,"?tracelog="+e)}};t.add("plugin.TraceLog",n)});!function(i){i(function(){if("undefined"==typeof window.SiteAlibarUnify){i.namespace("FE.sys.Alibar"),window.SiteAlibarUnify={},window.SiteAlibarUnify.refreshFlag=!1,window.SiteAlibarUnify.purchaselistRefreshFlag=!1,window.SiteAlibarUnify.showTipFlag=!1,window.SiteAlibarUnify.hideTipFlag=!1;var e={};e.refresh=function(){SiteAlibarUnify.refreshFlag=!0},e.purchaselistRefresh=function(){SiteAlibarUnify.purchaselistRefreshFlag=!0},e.showTip=function(){SiteAlibarUnify.hideTipFlag=!1,SiteAlibarUnify.showTipFlag=!0},e.hideTip=function(){SiteAlibarUnify.showTipFlag=!1,SiteAlibarUnify.hideTipFlag=!0},FE.sys.Alibar=e,i.getScript("//web.archive.org/web/20220404083949/http://astyle.alicdn.com/sys/js/universal/alibar/merge-v4.js",function(){})}})}(jQuery),define(["jQuery","PageContext"],function(i,e){e.add("page.view.View",{init:function(){this.loadPurchaseLib()},loadPurchaseLib:function(){setTimeout(function(){i.getScript("https://web.archive.org/web/20220404083949/http://astyle.alicdn.com/fdevlib/js/lofty/util/messageproxy/1.0/messageproxy.js",function(){i.getScript("https://web.archive.org/web/20220404083949/http://astyle.alicdn.com/sys/js/purchaselist/v1/core.js",function(){i.getScript("https://web.archive.org/web/20220404083949/http://astyle.alicdn.com/sys/js/purchaselist/v1/purchaselist.js",function(){})})})},1e3)}})});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)});define(['jQuery', 'Class','AppContext' ,'widget.UnStopRoll','widget.UI', 'widget.ImageLazyLoad'],
function($, Class, AppContext, UnStopRoll, UI, ImageLazyLoad) {
var smt_offerGeneral = new Class({
init : function(div, config, data) {
this.div = div;
if ((config.effectType === 'detail' || config.effectType === 'detailroll')
&& parseInt(config.imageSize, 10) !== 64) {
this.hoverEffect(div);
} else if (config.effectType === 'roll') {
if (!config.context.diy) {
MT.ui.bigImgPlay(div);
}
} else if (config.effectType === 'commonroll') {
this.imageRoll(div, data);
}
this.rollImage(div);
this.handleResizeImages(div);
this.imageSwitch();
new ImageLazyLoad(div);
},
handleResizeImages: function(div) {
var imageSmall = $('div.common-small-64', div);
imageSmall.length && imageSmall.on('widget-image-lazy-load', 'img', function() {
UI.resizeImage(this, 64);
});
var image = $('.image-resize',div);
image.length && div.on('widget-image-lazy-load', 'img', function() {
UI.resizeImage(this, $(this).data('size'));
});
},
imageRoll : function(div, data) {
setTimeout(function() {
var list = $('ul.displayWindowCarouselViewList', div);
new UnStopRoll(list, {
Max : 1,
animateTime : 1500,
stopTime : 2500
});
}, 3000);
},
hoverEffect: function(div) {
div.on('mouseenter', 'li', function() {
var li = $(this),
hover = $('div.hover-body', li),
height = li.height() - $('div.image', li).height(),
marginBottom = parseInt($('div.image', li).css('margin-bottom'));
li.addClass('hovered');
if (height > hover.height()) {
li.addClass('fixheight');
hover.css('height', height - marginBottom + 'px');
}
});
div.on('mouseleave', 'li', function() {
var li = $(this);
li.removeClass('hovered');
$('div.hover-body', li).css('height', '');
});
},
rollImage: function(div) {
var clear = function(li) {
var timer = li.data('rollTimer');
timer && clearTimeout(timer);
li.data('rollTimer', false);
};
div.on('mouseenter', 'a.roll-image', function() {
var elm = $(this),
li = elm.closest('li');
clear(li);
var imageSrc = elm.data('imageSrc'),
image = $('div.image img', li);
image.attr('src', imageSrc);
});
div.on('mouseleave', 'a.roll-image', function() {
var li = $(this).closest('li');
li.data('rollTimer', setTimeout(function() {
clear(li);
var img = $('a.roll-image', li).eq(0);
var image = $('div.image img', li);
image.attr('src', img.data('imageSrc'));
}, 200));
});
},
imageSwitch: function() {
if(!$('.thumb-image', this.div).length) {
return ;
}
$('.thumb-image a', this.div).on('click', function(e) {
e.preventDefault();
var image = $(this).data('image'),
li = $(this).closest('li');
li.find('.thumb-image').removeClass('thumb-active');
$(this).closest('.thumb-image').addClass('thumb-active');
li.find('.main-image img').attr('src', image);
});
}
});
AppContext.register('view', 'smt_offerGeneral', smt_offerGeneral);
});/**
* ����ǰ̨tracelog���
*/
define('app.tracelog.TraceLog', ['jQuery', 'Class'], function($, Class) {
return new Class({
init: function(data) {
var self = this;
$.each(data, function(selector, items) {
$.each(items || [], function(index, item) {
var event = item[2] || 'mousedown';
$(selector).on(event, item[0], function() {
self[event] && self[event](this, item[1]);
});
});
});
},
click: function(elm, tracelog) {
tracelog = typeof tracelog === 'function' ? tracelog.apply(elm) : tracelog;
tracelog && this.trace(tracelog);
},
mousedown: function() {
this.click.apply(this, arguments);
},
trace: function(tracelog) {
aliclick(null, '?tracelog=' + tracelog);
}
});
});
define(['jQuery', 'PageContext', 'app.tracelog.TraceLog', 'core.Component'],
function($, PageContext, TraceLog, Component) {
PageContext.add('app.tracelog.view', function() {
var context = Component.getUserContext();
context.diy || setTimeout(function() {
new TraceLog(Data);
}, 5000)
});
//~entry
// ������ݿ�ʼ
var Data = {
}
//~Data
});
/**
* ��ֹ֧��������
* @author zhao.zdw
*/
define([ 'jQuery', 'PageContext'],
function($, PageContext) {
var PreventAlipay = {
init:function (div, config, data) {
$('body').on('click', 'a', function(e) {
var linkUrl = $(this).attr('href');
if (linkUrl && linkUrl.toLowerCase().indexOf('alipay.com') > -1) {
e.preventDefault();
}
});
}
};
PageContext.register('PreventAlipay', PreventAlipay);
});
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('app.contactSmall.map', ['jquery','lofty/lang/class','util/exposure/1.0'], function($, Class, Exposure){
var hasInitMap = false;
var defer;
return Class({
init: function (div,data) {
this.div = div;
this.viewdata = data;
this.initMapContainer();
this.bindEvents();
this.delayLoad();
},
bindEvents: function () {
},
/**
* @desc ��ʼ����ͼ����
* */
initMapContainer: function () {
var id = this.mapId = 'amap' + new Date().getTime();
var mapBox = this.div.find('.map');
mapBox.attr('id', id);
},
/**
* @desc �ӳ������ͼ
* */
delayLoad : function(){
var self = this;
var viewdata = self.viewdata;
var exp = new Exposure({
target : '#' + self.mapId
});
exp.on('exposure', function(){
self.initMapScript();
});
// lofty����������һ����Ҫ�ֶ�����һ�¡�(~��~)
exp.execute();
},
/**
* @desc ��ͼ���벿��
* */
loadMap: function () {
var self = this;
var address = this.viewdata.address;
/**
* @desc �ߵµ�ͼ��api�����ȫ�ֱ���AMap,����ֻ��Ҫ�ж��Ƿ����,�Ϳ���֪���Ƿ��Ѿ����ص�ͼapi
* */
if(!window['AMap']){
this.mapNetworkError();
return;
}
if (!address) {
console && console.error('����ĵ�ַΪ��');
self.mapPosError();
return;
}
/**
* @desc ���ص����������
* */
AMap.service(["AMap.Geocoder"], function () {
var geocoder = new AMap.Geocoder();
/**
* @desc ���������ת��
* */
geocoder.getLocation(address, function (status, result) {
if (status !== 'complete' && result.resultNum > 0) {
console && console.error('��ͼλ�ý�������');
self.mapPosError();
return;
}
/**
* @desc ȡ��һ����
* */
var location = result.resultNum > 0 ? result.geocodes[0].location : {lat: 0, lng: 0};
var point = [location.lng, location.lat];
var map = new AMap.Map(self.mapId, {
zoom: 16,
resizeEnable: true,
center: point
});
AMap.plugin(['AMap.ToolBar','AMap.Scale'],
function(){
map.addControl(new AMap.ToolBar());
map.addControl(new AMap.Scale());
});
if (!result || !result.geocodes) {
return;
}
var opts = {
companyName : self.viewdata.companyName,
companyAddress: self.viewdata.address
};
addMarker(result.geocodes[0], map, opts);
self.div.find('.loadmask').hide();
});
});
},
/**
* @desc ���������ʾ
* */
mapNetworkError : function(){
this.div.find('.warn-msg').hide();
this.div.find('.warn-msg.networkerror').show();
this.div.trigger('map-load-error');
},
/**
* @desc ��λ������ʾ
* */
mapPosError : function(){
this.div.find('.warn-msg').hide();
this.div.find('.warn-msg.loaderror').show();
this.div.trigger('map-load-error');
},
/**
* @desc ��ʼ�������ͼ�ű�,������Ҫ���˸���ֹ��ͼapi���ظ����������.
* */
initMapScript: function () {
var self = this;
if (defer) {
defer.then(function(){
self.loadMap();
});
return;
}
defer = jQuery.Deferred();
defer.then(function(){
self.loadMap();
});
if(window['AMap']){
defer.resolve();
return;
}
var cb = function(){
window[self.id] = null;
defer.resolve();
};
hasInitMap = true;
this.id = 'init' + new Date().getTime();
window[this.id] = cb;
loadAMapScript(this.id);
}
});
function loadAMapScript(callbackName) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = top.window.location.protocol + "//web.archive.org/web/20220404083949/http://webapi.amap.com/maps?v=1.3&key=03068365dcc9ca7ec6db154941fe9327&callback=" + callbackName;
document.body.appendChild(script);
}
/**
* @desc ��ͼͼ���ע,�Լ�������
* */
function addMarker(d, map, opts) {
var contentHtml = [
'
' + opts.companyName + '
',
'
' + opts.companyAddress + '
'
].join('');
var marker = new AMap.Marker({
map: map,
position: [d.location.getLng(), d.location.getLat()]
});
var infoWindow = new AMap.InfoWindow({
content: contentHtml,
offset: {x: 0, y: -30}
});
infoWindow.open(map, marker.getPosition());
}
})
define(["jQuery","AppContext","widget.Util","widget.UI","util.SlsLogger"],function(i,e){var t={init:function(i,e){e.hitGrep}};e.register("view","shopSigns",t)});/**
* ��Ʒ���ม��
* @author zengpan.zhengzp
*/
define(['jQuery', 'AppContext', 'widget.FloatPanel', 'lofty/util/template/2.0/template'], function ($, AppContext, FloatPanel, Template) {
var BrandCategory = {
init: function (div, config, data) {
this.resizeTopNav();
if (config.context.diy) {
$('#topnav').on('click', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
$('#topnav').on('mouseenter', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
return;
}
this.log('start');
this.renderUtil = null;
this.fullCategory = [];
this.winportUserId = config.userId;
this.initHtmlCompiler();
this.hasShowCategory = false;
this.loadMtop(this.initTarget);
},
resizeTopNav: function () {
jQuery('.segment-box').first().addClass('segment-box-fluid')
},
loadFirstCategory: function (cb) {
BrandCategory.fetchChildrenCategory(
{
winportUserId: BrandCategory.winportUserId,
parentGroupId: '-1'
},
function (res) {
BrandCategory.fullCategory = res.category || [];
cb && cb();
});
},
loadMtop: function (cb) {
$.getScript('//web.archive.org/web/20220404083949/http://g.alicdn.com/mtb/lib-mtop/2.5.8/mtop.js', function () {
cb && cb();
});
},
initTarget: function () {
$('a.allSpuList').on('mouseenter', function (e) {
if (BrandCategory.hasShowCategory) {
return;
}
BrandCategory.hasShowCategory = true;
e && (e.preventDefault(), e.stopPropagation());
BrandCategory.loadFirstCategory(function () {
var covertedData = BrandCategory.convertToRenderData(BrandCategory.fullCategory || []);
var renderData = {
firstCategory: covertedData,
secondCategory: [],
thirdCategory: [],
firstIndex: -1,
secondIndex: -1,
};
BrandCategory.render('.brand-first-category', BrandCategory.renderUtil.firstHtmlRender, renderData);
})
})
},
log: function (str) {
console.log('---topNav---', str);
},
logTree: function (list, tab) {
function logTree(list, tab) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(tab + cur.groupId);
if (cur.children && cur.children.length > 0) {
logTree(cur.children, tab + '--')
}
}
}
logTree(list, tab);
},
fetchChildrenCategory: function (params, cb) {
lib.mtop.config.prefix = 'h5api'
lib.mtop.config.mainDomain = '1688.com'
lib.mtop.config.subDomain = 'm';
lib.mtop.request({
api: 'mtop.1688.imall.itemdigital.productgroup.listChildGroup', // 必须
v: '1.0',
data: params,
ecode: 0,
type: 'GET',
dataType: 'jsonp',
timeout: 20000,
},
function (result) {
cb({
parentGroupId: params.parentGroupId,
category: (result.data && result.data.result) || []
});
})
},
checkChildren: function (fullCategory, parentId, cb) {
function addChildrenToTree(list, parentId, children) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var curItem = list[i];
var groupId = curItem.groupId;
if (groupId === parentId) {
curItem.children = children;
return list;
}
if (curItem.children && curItem.children.length > 0) {
addChildrenToTree(curItem.children, parentId, children);
}
}
return list;
}
function findNode(list, id) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(cur.groupId);
if (cur.groupId === id) {
return cur;
}
if (cur.children && cur.children.length > 0) {
var res = findNode(cur.children, id);
if (res) {
return res;
}
}
}
return null;
}
var parent = findNode(fullCategory, parentId);
if (!parent) {
return;
}
if (parent.children && parent.children.length > 0) {
cb(fullCategory);
return;
}
this.fetchChildrenCategory(
{
winportUserId: this.winportUserId,
parentGroupId: parentId
},
function (res) {
var parentGroupId = res.parentGroupId;
var category = res.category;
var newCategory = addChildrenToTree(fullCategory, parentGroupId, category);
cb(newCategory);
}
);
},
convertToRenderData: function (fullCategory) {
function genDataConvert() {
return function (item) {
item = item || {};
var groupId = item.groupId;
var groupName = item.groupName;
var leafNode = item.leafNode;
var res = {
groupId: groupId,
title: groupName,
leafNode: (leafNode + '') === 'true',
};
if (!leafNode) {
res.children = [];
}
return res;
}
}
function recursive(list, dataConvert) {
var newList = [];
if (!list) {
return [];
}
for (var i = 0, len = list.length; i < len; i++) {
var newItem = dataConvert(list[i]);
if (list[i].children && list[i].children.length > 0) {
newItem.children = recursive(list[i].children, dataConvert);
}
newList.push(newItem);
}
return newList;
}
function resetLink(list, level, parentId) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
if (cur.leafNode) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
} else {
if (level === 1) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(cur.groupId);
}
if (level === 2) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(parentId) + '&twoCateId=' + encodeURIComponent(cur.groupId);
}
if (level === 3) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
}
}
if (cur.children && cur.children.length > 0) {
resetLink(cur.children, level + 1, cur.groupId);
}
}
return list;
}
var covertedData = recursive(fullCategory, genDataConvert());
return resetLink(covertedData, 1, -1);
},
initHtmlCompiler: function () {
var firstCategory = "\
\
\
\
{{if firstCategory && firstCategory.length > 0}}\
\
{{/if}}\
\
";
var secondCategory = "\
\
{{if secondCategory && secondCategory.length > 0}}\
\
{{selectedFirstCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
\
";
var thirdCategory = "\
{{if thirdCategory && thirdCategory.length > 0}}\
\
{{selectedSecondCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
";
this.renderUtil = {
firstHtmlRender: Template.compile(firstCategory),
secondHtmlRender: Template.compile(secondCategory),
thirdHtmlRender: Template.compile(thirdCategory),
};
},
bindCategoryClickEvent: function (html) {
if (!html) {
return;
}
function genthrottling(func, time) {
var timer = null;
var valid = true;
return {
enter: function (e) {
if (!valid) {
return;
}
valid = false;
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
valid = true;
func(e);
}, time);
},
leave: function (e) {
clearTimeout(timer);
valid = true;
},
}
}
var _this = this;
function eventHandler(e) {
e && (e.preventDefault(), e.stopPropagation());
var groupId = e.target.getAttribute('group-id');
var leafNode = e.target.getAttribute('leaf-node') === 'true';
var level = e.target.getAttribute('category-level');
var firstIndex = e.target.getAttribute('first-index');
var secondIndex = e.target.getAttribute('second-index');
var arrayIndex = e.target.getAttribute('array-index');
if (leafNode && level === '0') {
_this.clear('.brand-second-category');
_this.clear('.brand-third-category');
return
}
if (leafNode && level === '1') {
_this.clear('.brand-third-category');
return
}
if (level === '0' && arrayIndex === firstIndex) {
return
}
if (level === '1' && arrayIndex === secondIndex) {
return
}
_this.checkChildren(
_this.fullCategory,
groupId,
function (newCategory) {
var coverted = _this.convertToRenderData(newCategory);
var renderData = {
firstCategory: coverted,
secondCategory: [],
thirdCategory: [],
};
if (level === '0') {
renderData.firstIndex = arrayIndex;
renderData.selectedFirstCat = coverted[arrayIndex];
renderData.selectedSecondCat = null;
renderData.secondIndex = null;
renderData.secondCategory = coverted[arrayIndex].children;
renderData.thirdCategory = [];
_this.render('.brand-second-category', _this.renderUtil.secondHtmlRender, renderData);
_this.clear('.brand-third-category');
}
if (level === '1') {
renderData.firstIndex = firstIndex;
renderData.secondIndex = arrayIndex;
renderData.secondCategory = coverted[firstIndex].children;
renderData.selectedSecondCat = renderData.secondCategory[arrayIndex];
renderData.thirdCategory = coverted[firstIndex].children[arrayIndex].children;
_this.render('.brand-third-category', _this.renderUtil.thirdHtmlRender, renderData);
}
});
}
var headlers = genthrottling(eventHandler, 300);
html.on('mouseenter', '.category-item-title', headlers.enter);
html.on('mouseleave', '.category-item-title', headlers.leave);
},
bindCloseButtonClickEvent: function (html) {
if (!html) {
return;
}
var _this = this;
html.on('click', '.close-button', function (e) {
_this.hasShowCategory = false;
e && (e.preventDefault(), e.stopPropagation());
$('.brand-first-category').empty();
$('.brand-second-category').empty();
$('.brand-third-category').empty();
})
},
render: function (containerId, compiler, renderData) {
var htmlStr = compiler(renderData);
var html = $(htmlStr);
this.bindCategoryClickEvent(html);
if (containerId === '.brand-first-category') {
this.bindCloseButtonClickEvent(html);
}
var contain = $(containerId);
contain.empty().append(html);
},
clear: function (containerId) {
var contain = $(containerId);
contain.empty();
}
};
var OfferCategory = {
renderAStorePageTopNav: function () {
jQuery('.app-topNav').width('100%');
var moduleName = 'wp_pc_common_topnav';
var containNode = 'astore-topnav';
var pageData = window.__astorePageData__ || jQuery('.app-topNav').data('viewConfig').astorePageData;
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, pageData, true);
},
init: function (div, config, data) {
if (config.hitGrep) {
if (config.topDomain) {
this.renderAStorePageTopNav();
return;
}
return
}
if (config.brandPlusTopNav) {
BrandCategory.init(div, config, data);
return;
}
this.pageSize = 10;
this.config = config;
this.div = div;
this.handler = $('a.show-category', div);
this.supHandler = $('.other-cat-link', div);
this.bindEvent();
this.pageGoldClick();
// �������Ŀ��������ʾ
this.bindOtherCatState();
// �������Ŀ����������ҳʱ����Ĭ����ʾ
this.checkNavPosition();
},
bindEvent: function () {
var self = this;
this.handler.one('mouseenter', function () {
self.showCategoryDiv();
});
},
bindOtherCatState: function () {
var self = this;
if (self.config.context.diy !== 'true') {
this.supHandler.on('mouseenter', function () {
self.showOtherCatDiv();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
self.hideOtherCatDiv();
// self.supHandler.removeClass('active');
});
}
},
checkNavPosition: function () {
var self = this;
if (self.config.isDiy !== 'true' && self.config.nowPageName === 'index') {
// self.supHandler.addClass('active')
self.showOtherCatDiv();
}
},
pageGoldClick: function () {
$('.top-nav-bar-box li').click(function () {
var page_id;
var pageName = $(this).data('page-name');
if (window.dmtrack_pageid) {
page_id = dmtrack_pageid;
}
if (window.goldlog) {
goldlog.record('/1688-winport-element.click.shopclick', 'CLK', 'click_type=page' + '&page_type=' + pageName + '&page_id=' + page_id, 'H1511971673');
}
});
},
//����������Ŀ
showSubCategory: function () {
var self = this;
firCategory = $('li.sec', self.containerDiv);
//������һ����Ŀչʾ������Ŀ����
self.containerDiv.on('mouseenter', 'li.sec', function () {
//��һ����Ŀ������������data-index�����Կ������һ����Ŀ��Ӧ�Ķ�����Ŀdiv
var subClassName = $(this).attr("data-index");
var position = $(this).position();
var left = position.left + 192;
self.hoverClass = " rhover";
var topNavIndex = $('input[name=topNavIndex]', self.containerDiv).val();
//����Ӧ��Ʒ��Ŀҳ�ڵ�������ǰ�ĸ�ʱ������Ŀ���Ҹ�������������
if (topNavIndex > 4) {
//��������Ŀ�����Ҷ�����Ŀ��������10��������Ҫ�ֳ����У�ÿ�п�200px������λ����Ҫ�����ƽ�400px
var subSize = $("input[name=subSize]", $(this)).val();
if (subSize > 10) {
left = position.left - 402;
} else {
left = position.left - 202;
}
self.hoverClass = " lhover";
}
//����һ����Ŀ����hoverЧ��
var firClassName = $(this).attr("class");
if (firClassName.indexOf(self.hoverClass) == -1) {
$(this).addClass(firClassName + self.hoverClass);
}
//�ҵ�Ҫչʾ�Ķ�����Ŀdivչʾ֮
self.subCategory = $("div." + subClassName, self.containerDiv).css({
'display': 'block',
'left': left,
'top': position.top
});
self.subCategory.bind('mouseleave', function () {
$(this).css("display", "none");
//�˳�������Ŀȥ��һ����Ŀ��hoverЧ��
self.delHover(firCategory, self.hoverClass);
});
});
//����뿪һ����Ŀ���ض�����Ŀ����
self.containerDiv.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Ч��
self.delHover($(handler), self.hoverClass);
}, 20);
//��һ����Ŀ���������Ŀ����ʱ�����ֶ�����Ŀ���㲻����
self.subCategory.bind('mouseenter', function () {
clearTimeout(self.timeOut);
});
});
},
//��ҳ
changePage: function () {
var self = this;
var upPage = $('a.up', self.containerDiv);
var downPage = $('a.down', self.containerDiv);
//���Ϸ�ҳ
upPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == 1) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
//���Ϸ�ҳҳ����1
pageNum = pageNum - 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
//���·�ҳ
downPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == pages) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
pageNum = pageNum + 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var nextStart = (pageNum - 1) * self.pageSize + 1;
var nextEnd = nextStart + self.pageSize;
if (pageNum == pages) {
nextEnd = nextStart + self.pageSize + 1
}
for (var i = nextStart; i < nextEnd; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
},
//����Ŀ��������չʾҳ��
showPageNum: function (pageNum) {
var $pageNum = $('span[name=pageNum]', this.containerDiv);
$pageNum.html(pageNum);
},
//���hover��
delHover: function (obj, hoverClass) {
var firClassName = obj.attr("class");
obj.removeClass(hoverClass);
},
//�л�class show hidden
switchClass: function (obj, replacement) {
var className = obj.attr("class");
if (!className) {
return;
}
if (replacement == "show") {
className = className.replace(/category-hide\d+/, 'show');
} else {
className = className.replace("show", replacement);
}
obj.attr("class", className);
},
ajaxCategoryLoader: function (callback) {
var config = this.config;
if (!config.categoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.categoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
topNavIndex: config.topNavIndex
},
success: function (_data) {
callback(_data);
}
});
},
showCategoryDiv: function () {
var self = this;
this.ajaxCategoryLoader(
function (categoryDiv) {
var offset = self.handler.offset();
self.containerDiv = $('
');
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 zengpan.zhengzp
*/
define([ 'jQuery', 'AppContext'],
function($, AppContext) {
var FullScreenRoll = {
init:function (div, config, data) {
this.div = div;
this.initArrow();
},
initArrow: function(){
var self = this,
designBox = $('.design-box', this.div);
designBox.on('mouseenter', function(){
$('.fx-prev,.fx-next', self.div).show();
});
designBox.on('mouseleave', function(){
$('.fx-prev,.fx-next', self.div).hide();
});
}
};
AppContext.register('view', 'fullScreenRoll', FullScreenRoll);
});
/**
* ????????
*/
define(['jQuery', 'AppContext', 'fui/tabs/2.0','fui/timer/1.0'], function($, AppContext, Tabs, Timer) {
var timerInit = function(_time, el) {
var _timer = new Timer({
to: _time,
el: el, //'#remain-timer'
maxUnit: 'day',
useServerTime: true,
fixInterval: true
});
};
var view = {
init: function (div, config) {
this.div = div;
this.config = config;
if (this.div.find(".app-shop-promotion").length > 1) {
this.initTab();
}
var actives = $('.shopPromotion-activeWrap');
for(var i=0;i
new Date()){
timerInit(_startTime, el);
}else {
$(actives[i]).find('.shopPromotion-remain')[0].innerText = '��Ѿ�����';
$(actives[i]).find('.shopPromotion-remain')[0].style.marginBottom = '50px';
$(actives[i]).find('.shopPromotion-remainTime')[0].style.display = 'none';
}
}
var card = $($(actives[i]).find('.shopPromotion-info')[0]);
var outUrl = $($(actives[i]).find('.shopPromotion-more')[0]).attr('href');
card.click(function(){
window.open(outUrl);
});
})(i);
}
},
initTab: function () {
var tab = new Tabs({
tpl: "#shopPromotionContainer",
event: 'click',
boxSelector: '.app-shop-promotion',
effect: 'leftright',
prev: '.left-btn',
next: '.right-btn',
overflowContainer: '.app-shop-promotion-over-flow-container',
currentCls: 'active'
});
}
};
AppContext.register('view', 'shopPromotion', view);
});
define(["jQuery","AppContext","widget.Util","widget.UI"],function(i,t){var n={init:function(i,t,n){this.div=i,this.config=t,this.data=n,this.initOnload()},initOnload:function(){var t=this,n=i(".img-container",t.div);if(t.data.linkObj&&t.data.image){var a=i('');a.on("load",function(){var i=a.width();n.css({marginLeft:"-"+i/2+"px",visibility:"visible"})}),n.prepend(a)}}};t.register("view","fullscreenImg",n)});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/20220404083949/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', 'AppContext', 'Class', 'widget.VideoPlay', 'core.Remote'],function($, AppContext, Class, VideoPlay, Remote) {
var videoBig = new Class ({
init : function(div, config, data){
this.config = config;
this.isEdit = config.context.diy;
this.isTopDomain = config.context.isTopDomain;
this.data = data;
this.div = div;
this.mediaServer = config.mediaServer;
this._init();
},
_init:function(){
var self = this ;
if(self.data&&self.data.videoId){
Remote.callEvent('videoInfo', 'getVideoById', {
data: {
videoId: self.data.videoId,
_csrf_token: self.config.context.csrfToken
},
type: 'post',
success: function(data) {
if (data.result) {
self.render(data.result);
self.view(data.result);
}
},
error: function() {
}
})
} else{
if(self.isEdit){
$('.vas_video_view', self.div).html("�㻹û�в���ʹ����Ƶ������Ҳ����ð�ť�����ɲ�����Ƶ
");
self.view();
}
}
},
render:function(data){
var self = this;
if(self.data&&self.data.videoId) {
var self = this;
var config = data;
var a = [];
if(config.status=="online"){
a.push('');
if(!self.isTopDomain){
a.push('����������������Ƶ���泡�ء����ϼ��ز��ɻ�Ա�ṩ����Ƶ֮��ʵ�ԡ��Ϸ��Լ���������ɻ�Ա���и���
');
}
}else{
a.push('');
a.push('
');
if ($.isEmptyObject(config)) {
a.push('');
a.push('������Ƶ�Ҳ����ˣ���ȥ��Ƶ������̨����������Ƶ��
');
} else if(config.status=="failed"){
a.push('');
a.push('��Ƶ��˲�ͨ����
');
}else {
a.push('');
a.push('�����Ƶ��������У�������Ա����1~2���������������ɡ�
');
}
a.push('
');
a.push('
');
}
$('.vas_video_view',this.div).html(a.join(''));
if(config.status=="failed"){
// $($('.vas_video_view_content')).css({padding:"0 0 0 "+(392-196-config.refuseMessage.length*14)/2+"px"});
}
}
},
view:function(config){
var self = this;
if(self.data&&self.data.videoId) {
if(!self.isEdit){
if(config&&config.status=="online"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
config && !$.isEmptyObject(config) && self.playVideo(config);
} else {
if(!self.isEdit){
if(config&&config.auditStatus=="approved"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
}
},
playVideo: function(data) {
var self = this;
var maxWidth = 1190; // Ĭ����Ƶ��������
var maxHeight = 600; // Ĭ����Ƶ�����߶�
// �ڲ�ͬ��region�µ������Ƶ�������
if(self.config && self.config.regionType == "full"){
maxWidth = 952;
maxHeight = 500;
}else if(self.config && self.config.regionType == "big"){
maxWidth = 752;
maxHeight = 400;
}
var options = {
width: maxWidth,
height: maxHeight,
adaptShape: true, // ��Ƶ����Ĭ������Ӧ��ֻ����������
autoplay: false,
loop: false,
controls: true,
poster: data.extendInfo && data.extendInfo.coverImg || 'https://web.archive.org/web/20220404083949/https://img.alicdn.com/tfs/TB1RUrPaBTH8KJjy0FiXXcRsXXa-1125-618.png'
}
var video = new VideoPlay($('.video-show', self.div), data.address, options);
var videoEle = $('.video-show', self.div).find('video');
// ������adaptShape:true����Ӧ��width��height��ת��Ϊ max-*** ,����video��ǩ��Ȼ��Ҫ����������һ�Σ���Ȼ����width��Ϊ��
if (options.adaptShape) {
videoEle.css({'max-width':options.width, 'max-height': options.height});
video.isFull = false;
// ����ȫ��ʱ����max-xxx���ԣ������Ӱ�쵽ȫ������
video.on('video:enterFullscreen', function() {
if (!video.isFull) {
videoEle.css({'max-width':'initial', 'max-height': 'initial'});
video.isFull = true;
} else {
videoEle.css({'max-width':options.width, 'max-height': options.height});
video.isFull = false;
}
});
// exit api��bug��ȫ����������enter�¼����Ժ�butterfly���������������������bug����Ҫ�õ�����Ĵ�����
// video.on('video:exitFullscreen', function() {
// videoEle.css({'max-width':options.width, 'max-height': options.height});
// });
}
}
});
AppContext.register('view', 'videoBig', videoBig);
});
/**
* ��˾ȫ��
* @author zengpan.zhengzp
*/
define(['jQuery', 'AppContext', 'widget.UI', 'Class'],
function($, AppContext, UI, Class) {
var CompanyViewBig = new Class({
init: function(div, config, data) {
this.div = div;
this.viewMain = $('div.view-main', div);
this.imageWrap = $('div.image-wrap', div);
this.images = this.imageWrap.data('images');
this.viewsData =$('div.views-wrap', div).data('views');
this.viewIndex = this.imageIndex = 0;
if (this.images.length == 0 || this.viewsData .length == 0){
return;
}
this.initViewList();
this.initScrollView();
this.showImage({
'image':this.images[0][0]
});
this.initScrollImage();
},
initViewList: function(){
var self = this;
self.resizeImage('small');
$('div.views', self.div).on('click', 'li.view', function(e){
e.preventDefault();
self.initCurrentView($(this).data('index'));
});
},
initScrollView: function(){
var self = this;
self.div.on('click', 'a.up, a.down', function(e) {
e.preventDefault();
var isUp = $(this).hasClass('up');
if(isUp && self.viewIndex > 0){
self.viewIndex --;
} else if(!isUp && self.viewIndex < self.viewsData.length - 1){
self.viewIndex ++;
} else {
return;
}
self.initCurrentView(self.viewIndex);
self.needScroll(self.viewIndex) && self.scollView(isUp);
});
},
showImage: function(options){
if(options.image){
var bigImage = this.getBigImageData(options.image.src);
if(options.isScroll){
this.setPosition(bigImage, options.direction);
} else {
this.imageWrap.empty();
}
bigImage.appendTo(this.imageWrap);
this.resizeImage('big');
options.isScroll && this.scollImage(options.direction);
this.showHArrow();
this.showImageCover();
}
},
initScrollImage: function(){
var self = this;
self.canClick = true;
self.div.on('click', 'a.prev, a.next', function(e) {
e.preventDefault();
if(self.canClick){
self.canClick = false;
setTimeout(function(){
self.canClick = true;
}, 500);
} else {
return;
}
var isPrev = $(this).hasClass('prev'),
imageSize = self.images[self.viewIndex].length;
if(isPrev){
if(self.imageIndex == 0){
self.imageIndex = imageSize - 1;
} else {
self.imageIndex --;
}
} else {
if(self.imageIndex == imageSize - 1){
self.imageIndex = 0;
} else {
self.imageIndex ++;
}
}
self.showImage({
'image':self.images[self.viewIndex][self.imageIndex],
'isScroll':true,
'direction':isPrev ? 'left' : 'right'
});
});
},
scollView: function(isUp){
var views = $('div.views', this.div),
top;
if(isUp){
top = views.offset().top - $('li.view', this.div).eq(this.viewIndex).offset().top;
} else {
top = views.offset().top - $('li.view', this.div).eq(this.viewIndex - 2).offset().top;
}
views.animate({
"top": top
}, 500);
},
scollImage: function(direction){
var self = this;
self.imageWrap.animate({
left: direction == 'left' ? 577 : -577
}, 500, function(){
$('div.item', self.imageWrap).eq(0).remove();
self.imageWrap.css('left','0');
$('div.item', self.imageWrap).css('left','0');
});
},
needScroll: function(index){
var top = $('div.views-wrap', this.div).offset().top,
height = $('div.views-wrap', this.div).height(),
nowTop = $('li.view', this.div).eq(index).offset().top,
nowHeight = $('li.view', this.div).eq(index).height();
return nowTop >= top + height || nowTop + nowHeight <= top;
},
getBigImageData: function(src){
var html = "";
return $(html);
},
showHArrow: function(){
var elms = $('a.prev,a.next', this.div);
if(this.images[this.viewIndex] && this.images[this.viewIndex].length > 1){
elms.show();
} else {
elms.hide();
}
},
showImageCover: function(){
var desc = this.viewsData[this.viewIndex].viewDesc,
imageDesc = $('div.image-desc', this.viewMain),
imageCount = $('div.image-count', this.viewMain),
imageCover = $('div.image-cover', this.viewMain);
imageCover.show();
imageDesc.show().html(desc);
imageCount.show().html((this.imageIndex + 1) + '/' + this.viewsData[this.viewIndex].imageCount);
},
setPosition: function(obj, direction){
obj.css('left', direction == 'left' ? '-577px' : '577px');
},
initCurrentView: function(index){
var self = this,
views = $('li.view', self.div),
bigImage = $('div.view-main img', self.div);
self.viewIndex = index;
self.imageIndex = 0;
views.removeClass('current');
views.eq(index).addClass('current');
self.showImage({
'image' : self.images[self.viewIndex][0]
});
},
resizeImage: function(type){
var img;
if(type == 'big'){
img = $('div.view-main img',this.div);
} else {
img = $('div.view-sub img',this.div);
}
UI.resizeImage(img, {
width:type == 'big' ? 577 : 134,
height:type == 'big' ? 433 : 100,
success:function(){
img.show();
}
});
}
});
AppContext.register('view', 'companyViewBig', CompanyViewBig);
});
/**
* @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'],
function($, AppContext) {
var BingRecordBig = {
init : function(div, config){
this.div = div;
this.config = config;
this.dongtai = $('div.dongtai', this.div).hide();
var self = this;
$.use('util-date');
this.getOrder(function(){
self.initScroll();
self.initMemberStatus();
self.dongtai.show();
});
},
_getBuyOffer: function(){
var obj = {};
if($('#buyOffer', this.div).length>0){
obj.orderScrollOut = 'order-scroll-out';
obj.slideInner = 'slide-inner';
obj.size = $('#buyOffer').attr('data-size');
} else {
obj.orderScrollOut = 'order-scroll-out2';
obj.slideInner = 'slide-inner2';
obj.size = 0;
}
return obj;
},
_processData: function(data, callback){
var buyOfferData = this._getBuyOffer();
var html ='';
var orders = data.data.orders;
for(var i= 0, l=orders.length; i'+
''+
'
�ɹ�����
'+
'
'+
'���� '+place+' �IJɹ����Ѹ���'+'
'+
''+time+''+
'
'+obj.productName+'
'+
'
'+
''
}
var newHtml = '
';
var getMemberInfo = $('#getMemberInfo',this.div);
if (buyOfferData.size>0){
getMemberInfo.prepend($('
'))
}
getMemberInfo.prepend($(newHtml)).attr('size', orders.length + ' | ' +buyOfferData.size);
$('#buyOffer', this.div).addClass('buyOffer-scroll-out').children('div').first().addClass('slide-inner');
callback();
},
_showNoOrders: function(callback){
var buyOfferData = this._getBuyOffer();
if (buyOfferData.size == 0){
this.dongtai.parent().html('
���ӵ���̬����
');
} else {
$('#getMemberInfo',this.div).attr('size', '0 | ' +buyOfferData.size);
$('#buyOffer',this.div).addClass('buyOffer-scroll-out2').children('div').first().addClass('slide-inner2');
callback();
}
},
getOrder: function(callback){
var self = this;
var gapDays = 90;
var today = new Date();
var endDay = new Date(+today + 24*3600*1000),
startDay = new Date(+endDay - 24*3600*1000*gapDays);
var uid = this.dongtai.attr('data-uid');
var endTime = +endDay, startTime = +startDay;
var xhr = $.ajax({
type: 'GET',
url: self.config.getTradeSellerOrderAjaxUrl,
dataType: 'jsonp',
cache: false,
data: {
status: 'SUCCESS',
payStartTime: startTime,
payEndTime: endTime,
loginId: encodeURIComponent(uid)
},
timeout: 3000
});
xhr.done(function(data){
if (data && data.success && data.data.orders){
self._processData(data, callback);
} else {
self._showNoOrders(callback);
}
});
xhr.fail(function(jqXhr,status,error){
self._showNoOrders(callback)
});
},
initScroll:function () {
var self = this;
var orderSize = self.div.find("#order").attr("data-size");
var buyOfferSize = self.div.find("#buyOffer").attr("data-size");
$.use('ui-tabs-effect', function(){
var orderDom = self.div.find('.order-scroll-out');
var orderDom2 = self.div.find('.order-scroll-out2');
var buyOfferDom = self.div.find('.buyOffer-scroll-out');
var buyOfferDom2 = self.div.find('.buyOffer-scroll-out2');
if(orderDom.length > 0 && orderSize && orderSize > 2) {
self.scroll3(orderDom);
}
if(orderDom2.length > 0 && orderSize && orderSize > 4) {
self.scroll4(orderDom2);
}
if(buyOfferDom.length > 0 &&buyOfferSize && buyOfferSize > 2) {
self.scroll3(buyOfferDom);
}
if(buyOfferDom2.length > 0 &&buyOfferSize && buyOfferSize > 4) {
self.scroll4(buyOfferDom2);
}
});
},
scroll3 : function(dom) {
if(dom) {
dom.tabs({
isAutoPlay:true,
boxSelector:".slide-y .ulist",
effect:'scroll',
scrollType:'loop',
perItem:2,
direction:'up'
});
}
},
scroll4 : function(dom) {
if(dom) {
dom.tabs({
isAutoPlay:true,
boxSelector:".slide-y .ulist",
effect:'scroll',
scrollType:'loop',
perItem:4,
direction:'up'
});
}
},
distinct:function(arrObj){
var arr = [],
len = arrObj.length;
for ( var i = 0; i < len; i++ ){
for( var j = i+1; j < len; j++ ){
if( arrObj[i] === arrObj[j] ){
j = ++i;
}
}
arr.push( arrObj[i] );
}
return arr;
},
initMemberStatus: function() {
var self = this;
var ulists = self.div.find(".ulist");
var ids = [];
ulists.each(function(k,v){
if($(v).data("vaccountids")){
ids.push($(v).data("vaccountids"))
}
});
ids = self.distinct(ids);
var data = {"vaccountIds":ids.toString()};
// $.ajax({
// url: self.config.buyerStatusListAjaxUrl,
// data:data,
// dataType:"jsonp",
// success: function(o) {
// if(o.success){
// $(o.data.BuyerStatusList).each(function(k,v){
// var dom = self.div.find('.vac_'+v.vaccountId);
// dom.each(function(a,b){
// $(b).find(".td3 .inlinep").append(self.createLogos(v));
// });
//
// });
// }else{
// }
// }
// });
},
createLogos:function(v){
var html = '';
if(v.isVip){
html = html+ '
'
}else if(v.isTp){
html = html+ '
'
}else if(v.isTmall){
html = html+ '
'
}else if(v.isTaobao){
html = html+ '
'
}
if(v.ov){
html = html+ '
'
}else if(v.av){
html = html+ '
'
}else if(v.cna){
html = html+ '
'
}else if(v.pna){
html = html+ '
'
}
return html;
}
};
AppContext.register('view', 'bingRecordBig', BingRecordBig);
});
define(['jQuery', 'AppContext', 'app.bingCreatedBig.view.Dialog', 'app.bingCreatedBig.view.Upload','app.bingCreatedBig.view.Verify'],
function ($, AppContext,dialog, uploader,verify) {
var BingCreatedBig = {
init: function(app, config) {
this.app = app;
this.prepare();
this.bindE();
this.verify23();
this.delegateE();
this.upload();
this.xjSubmit();
},
prepare: function() {
var app = this.app;
this.config = {
bingCreateBig: app,
offerTable:$(".offer-list tbody" ,app),
addoffer : $(".add-offer", app),
actionCell : $(".action-cell", app),
lxBlock:$(".lx-block", app),
bcBlock:$(".bc-block", app),
submit:$(".submit", app),
uploadContent:$(".upload", app),
uploadURL:$(".uploadURL", app),
offerItemsInput:$(".offer-items-input", app),
offerSubjectInput:$(".offer-items-subject", app),
form:$(".xunjia-form", app)
};
},
verify23:function(){
var self = this;
self.config.lxBlock.find(".item-people").bind("blur",function(){
var value = $(this).val().trim();
if(value ==''){
$(this).parents(".bck").find(".msg").empty();
$(this).parents(".bck").find(".msg").append(self.createTip('��ϵ�˲���Ϊ��'));
$(this).attr("vg","0");
}else{
$(this).parents(".bck").find(".msg").empty();
$(this).attr("vg","1");
}
});
self.config.lxBlock.find(".item-tel").bind("blur",function(){
var value = $(this).val().trim();
if(value =='' || value.lenght < 7 || !(/^\d/.test(value))){
$(this).parents(".bck").find(".msg").empty();
$(this).parents(".bck").find(".msg").append(self.createTip('����ȷ��д�绰����'));
$(this).attr("vg","0");
}else{
$(this).parents(".bck").find(".msg").empty();
$(this).attr("vg","1");
}
});
self.config.bcBlock.find(".ta-detail").bind("blur",function(){
var value = $(this).val().trim();
$.ajax({
dataType:"jsonp",
url:$(".mod-bingCreatedBig .subjectVerifyDetail").val(),
data:{
"subject":value
},
success:function(o){
if(o.data.forbidden == "true"){
self.config.bcBlock.find(".shuomingError").empty();
self.config.bcBlock.find(".shuomingError").append(self.createTip('�зǷ��ؼ���'));
}else{
self.config.bcBlock.find(".shuomingError").empty();
}
}
});
});
self.config.bcBlock.find(".ta-detail").bind("keyup",function(){
var value = $(this).val().trim();
if(value.length > 500){
$(this).val($(this).val().cut(500));
}
});
},
delegateE:function(){
var self = this;
self.config.offerTable.delegate(".del","click",function(){
$(this).parents("tr").remove();
if(self.config.offerTable.find("tr").length == 1){
self.config.offerTable.find(".del").css("display","none");
}
});
self.config.offerTable.delegate(".item-title","blur",function(){
var it = $(this);
var value = $(this).val().trim();
if(value !=''){
$(this).attr("vg","1");
$.ajax({
dataType:"jsonp",
url:$(".mod-bingCreatedBig .subjectVerify").val(),
data:{
"subject":value
},
success:function(o){
if(o.data.forbidden == "true"){
if(o.data.prompt == "dpp.title.simple"){
it.parents(".relative").find(".vgMsg").empty();
it.parents(".relative").find(".vgMsg").append(self.createTip('���ı�����ڼ��ή�ͱ���Ч�����벹������'));
}else{
it.parents(".relative").find(".vgMsg").empty();
it.parents(".relative").find(".vgMsg").append(self.createTip('�зǷ��ؼ���'));
}
}else{
it.parents(".relative").find(".vgMsg").empty();
}
}
});
}
});
self.config.offerTable.delegate(".item-amount","blur",function(){
var value = $(this).val().trim();
if(verify.verifyRules.posInt.test(value)){
$(this).attr("vg","1");
$(this).parents(".relative").find(".vgMsg").empty();
}else{
$(this).parents(".relative").find(".vgMsg").empty();
$(this).parents(".relative").find(".vgMsg").append(self.createTip('������������'));
$(this).attr("vg","0");
}
});
self.config.offerTable.delegate(".item-unit","blur",function(){
var value = $(this).val().trim();
if(/^[^0-9]*$/.test(value) && value != ''){
$(this).attr("vg","1");
$(this).parents(".relative").find(".vgMsg").empty();
}else{
$(this).parents(".relative").find(".vgMsg").empty();
$(this).parents(".relative").find(".vgMsg").append(self.createTip('����Ϊ���ֺͿ�'));
$(this).attr("vg","0");
}
});
},
upload: function () {
var config = this.config;
new uploader({
container: config.uploadContent,
uploadUrl: config.uploadURL.val(),
dataInput: config.bingCreateBig.find(".uploadData")
});
},
bindE:function(){
var self = this;
self.config.addoffer.bind("click",function(){
self.config.offerTable.find(".del").css("display","block");
if(self.config.offerTable.find("tr").length >= 30){
self.config.actionCell.find(".themost").empty();
self.config.actionCell.find(".themost").append(self.createTip('���ֻ������30���Ʒ'));
setTimeout(function(){
self.config.actionCell.find(".themost").empty();
},2000);
}else{
self.config.offerTable.append(self.createClip());
}
});
},
createTip:function(info){
return $('
'+info+'');
},
offerItemsToInput:function(arr){
var self = this;
var str = JSON.stringify(arr);
self.config.offerItemsInput.val(str);
},
offerSubjectToInput:function(arr){
var self = this;
var str = "";
if(arr.length > 1){
str = str+"�ɹ�";
str = str+arr[0].subject;
str = str + '�ȹ�' +arr.length+'���Ʒ';
}else{
str = str+arr[0].subject;
}
self.config.offerSubjectInput.val(str);
},
verifyOfferList:function(){
var self = this;
self.config.offerTable.find("tr").each(function(){
if($(this).find(".input-item[vg=1]").length == 3){
$(this).attr("vg","1");
$(this).attr("effect","1");
}else if($(this).find(".input-item[vg=0]").length == 3){
$(this).attr("vg","1");
$(this).attr("effect","0");
}else{
$(this).attr("vg","0");
$(this).attr("effect","0");
}
});
if(self.config.offerTable.find("tr[vg=0][effect=0]").length > 0){
return false;
}
if(self.config.offerTable.find("tr[effect=1]").length > 0){
var arr = [];
self.config.offerTable.find("tr[effect=1]").each(function(k,v){
var obj = {};
obj.subject = $(v).find(".item-title").val();
obj.purchaseAmount = $(v).find(".item-amount").val();
obj.unit = $(v).find(".item-unit").val();
arr.push(obj);
});
self.offerItemsToInput(arr);
self.offerSubjectToInput(arr);
return true;
}else{
return false;
}
},
verifyConnect:function(){
var self = this;
if(self.config.lxBlock.find(".input-item[vg=0]").length > 0){
return false;
}else{
return true;
}
},
verifyShuoming:function(){
var self = this;
if(self.config.bcBlock.find(".ta[vg=0]").length > 0){
return false;
}else{
return true;
}
},
xjSubmit:function(){
var self = this;
self.config.submit.find(".submit-btn").bind("click",function(e){
e.preventDefault();
//console.log('1'+self.verifyOfferList());
//console.log('2'+self.verifyShuoming());
//console.log('3'+self.verifyConnect());
if(self.verifyOfferList() && self.verifyShuoming() && self.verifyConnect()){
// self.config.bcBlock.find(".ta-detail").val(self.config.bcBlock.find(".ta-detail").val().cut(30));
var str = self.config.form.serialize();
//console.log(str);
$.ajax({
url: $(".mod-bingCreatedBig .sendXunjiaAjax").val(),
data:str,
dataType:"jsonp",
success: function(o) {
if(o.c == "E00002"){
$.add('wp-logist', { 'css': ['//web.archive.org/web/20220404083949/http://astyle-src.alicdn.com/sys/css/logist/logist-min.css'], 'js': ['//web.archive.org/web/20220404083949/http://astyle-src.alicdn.com/sys/js/logist/logist-min.js'] });
$.use('wp-logist', function() {
FE.sys.logist({
source: 'test', //����ҳ�����Դ
onLoginSuccess: function(){ //��½�ɹ���ص�����
FE.sys.logist('close');
self.config.submit.find(".submit-btn").trigger("click");
},
onRegistSuccess: function(){ //ע��ɹ���ص�����
window.location.reload();
}
});
});
}else{
if(o.c == "0"){
window.location.href = o.d;
}else{
if(o.c == "E00102"){
dialog.alert({content:'�û��ں������У�',btnCancel:'ȷ��'});
}else if(o.c == "E00101"){
dialog.alert({content:'�û����췢����ѯ�۵��Ѿ��������ޣ�',btnCancel:'ȷ��'});
}else if(o.c == "E00001"){
dialog.alert({content:'ϵͳ��æ����ˢ��ҳ�����ԣ�',btnCancel:'ȷ��'});
}else{
dialog.alert({content:'ϵͳ��æ����ˢ��ҳ�����ԣ�',btnCancel:'ȷ��'});
}
}
}
},error:function(o){
dialog.alert({content:'�½�ѯ�۵�ʧ�ܣ�',btnCancel:'ȷ��'});
}
});
}else{
if(!self.verifyOfferList()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('ѯ�۵���Ʒ��֤��ͨ��'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
if(!self.verifyShuoming()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('����˵����֤��ͨ��'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
if(!self.verifyShuoming()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('����ȷ��д��ϵ��ʽ'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
}
});
},
createClip:function(){
return $('
\
\
\
| \
\
\
| \
\
\
| \
');
}
};
AppContext.register('view', 'bingCreatedBig', BingCreatedBig);
});
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/20220404083949/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/20220404083949/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/20220404083949/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/20220404083949/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/20220404083949/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/20220404083949/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.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/20220404083949/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20220404083949/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/20220404083949/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);
});*/
});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)});/**
* վ������
* @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', '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', 'AppContext', 'widget.UI'], function($, AppContext, UI) {
var SalesRankingSmall = ({
init:function(div, config, data){
this.div = div;
if (!config.context.diy) {
var ele = $('input.offer-count-hidden-side', div);
var offerCount = ele.val();
if(offerCount > 0){
this.showSalesRankingSmall(div, config, data);
}
}else{
this.showSalesRankingSmall(div, config, data);
}
this.handleBigImage(div);
$(function() {
UI.resizeImage($('div.image img', div), 40);
UI.resizeImage($('div.big-image img', div), 100);
});
},
handleBigImage: function(div) {
var getBigImage = function(elm) {
var wrap = $(elm).closest('div.image-wrap');
return $('div.big-image', wrap);
};
var timer = null;
$('div.image img', this.div).on('mouseenter', function() {
var big = getBigImage(this);
timer && clearTimeout(timer);
timer = setTimeout(function() {
big.removeClass('fd-hide');
}, 200);
});
$('div.image img', this.div).on('mouseleave', function() {
timer && clearTimeout(timer);
var big = getBigImage(this);
big.addClass('fd-hide');
});
},
showSalesRankingSmall : function(div, config, data){
if($.util.ua.ie67){
div.css("display", "block").nextAll("div.mod");
div.each(function() {
var _elm = $(this);
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
});
}
div.css("display", "block");
}
});
AppContext.register('view', 'salesRankingSmall', SalesRankingSmall);
});
/**
* ��˾��̬
* @author yefei.niuyf
*/
define(['jQuery', 'Class', 'AppContext', 'widget.Util'],
function($, Class, AppContext, Util) {
var NewsList = Class({
template:
'<% if (articles.length) { %>\
\
\
<% } else { %>\
����˾��̬
\
<% } %>',
init: function(div, config, data) {
var initConfig = {
"maxNum": "8"
};
this.div = div;
$.extendIf(data,initConfig);
this.data = data;
var self = this,
url = config.requestUrl;
params = {
domainId: config.context.uid,
count: 30,
iframe_delete: true
}
$.ajax(url, {
dataType: 'script',
data : params,
success: function() {
self.render(window.article || [], config);
}
});
},
render: function(articles, config) {
var content = $('div.m-container', this.div),
isGridSub = $(this.div).closest('div.grid-sub').length > 0;
articles = this.data.maxNum ?
articles.slice(0, this.data.maxNum) : articles;
this.filter(articles);
var data = {
articles: articles,
moreUrl: config.moreUrl,
util: {
// ������Ҫ����������
formatSubject: function(subject) {
subject = Util.escape(subject);
return isGridSub && subject.lenB() > 24 ?
subject.cut(23) + '..' : subject;
},
escape: Util.escape
}
}
var html = FE.util.sweet(this.template).applyData(data);
content.html(html);
},
filter: function(articles) {
var self = this,
t = { viewCount: 0, comCount: 0 };
$.each(articles, function() {
for (var k in t) {
var len = ('' + this[k]).length;
t[k] < len && (t[k] = len);
}
});
$.each(articles, function() {
for (var k in t) {
this[k + 'Text'] = self.format('' + this[k], t[k]);
}
});
},
format: function(text, len) {
var k = len - text.length,
t = [];
for (var i = 0; i < k; i++) {
t.push(' ');
}
return '(' + text + ')' + t.join('');
}
});
//~
window.displayCompanyInfo = $.noop;
AppContext.register('view', 'news', NewsList);
});
define(['jQuery',
'Class',
'AppContext',
'widget.Util',
'widget.UI',
'widget.LazyInitializer',
'part.SiteAlitalk',
'core.Component',
'app.contactSmall.map'],
function($, Class, AppContext, Util, UI, LazyInitializer, SiteAlitalk, Component,Map) {
var ContactSmall = new Class({
init : function(div, config, data) {
this.div = div;
this.config = config;
this.initMobile();
this.initAlitalk();
//new LazyInitializer(this.div, $.proxy(this, 'initMap'));
this.initGaoDeMap();
},
initGaoDeMap:function() {
new Map($('div.map-container', this.div), {
address : this.config.address,
companyName : this.config.companyName
});
},
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: ['//web.archive.org/web/20220404083949/http://astyle-src.alicdn.com/sys/css/logist/logist.css'],
js: ['//web.archive.org/web/20220404083949/http://astyle-src.alicdn.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);
},
initMap: function() {
var container = $('div.map-container', this.div),
uid = null;
if (!container.length) {
return;
}
uid = this.config.context.uid;
$.add('vas-zqx', { js: ['//web.archive.org/web/20220404083949/http://astyle-src.alicdn.com/app/searchweb/common/widget/js/zqx.js'] });
$.use('vas-zqx', function() {
window.ZQX &&
ZQX.init({
prodid: '201',
container: container[0],
width: 174,
height: 203,
memberIds: uid,
service: 'map'
});
});
}
});
AppContext.register('view', 'contactSmall', ContactSmall);
});
define(['jquery', 'AppContext', 'util.SlsLogger'], function ($, AppContext, slsLogger) {
var view = {
/**
* ����������������֤��־
*/
addLogs: function(){
var content = this.div.find('textarea.lazy-load-template').val() || '';
var info = {}
if(content.match(/position\s*:\s*absolute/i)){
info.hasPosAbsolute = true;
}
if(content.match(/position\s*:\s*fixed/i)){
info.hasPosFixed = true;
}
if(content.match(/