").css({width:"0",height:"0",overflow:"hidden"});t.before(r),new n(r,function(){r.remove(),a._add(t,i)},{span:100})},_add:function(t,n){r.info("ready for "+t);var i={app:t,fn:n};this.items?(this.items.push(i),this.items.length>=6&&this._process()):(this.items=[i],this.timer=setTimeout(e.proxy(this,"_process"),100))},_request:function(t){var n=this,a=i.getGlobalViewConfig("fragmentUrl");if(!a)throw"require fragmentUrl in global view config";r.info("request apps html"),e.ajax(a,{dataType:this._isSameDomain(a)?"json":"jsonp",cache:!1,data:this._getData(t),success:function(e){e.isSuccess&&e.result?n._success(t,e.result):n._error(e)},error:function(){n._error()}})},_isSameDomain:function(e){var t=(/^\w+:\/\/([^\/]+)\//.exec(e)||[])[1];return t===window.location.host},_getData:function(t){var n=this,a={};a.page_type=i.getPageType();var r=[];return e.each(t,function(e,t){r.push(n._getItemData(t))}),a.apps=JSON.stringify(r),a},_getItemData:function(e){var t=e.app;if(!t.length)return void r.error("invalid app "+e.app);var n=t.data("app"),i=t.closest("div.region"),a=i.closest("div.segment"),o={app_key:n.id,appName:n.name,segment_id:a.data("segmentId"),layout_type:a.data("layoutType"),region_type:i.data("regionType")};return e.fragmentKey=this._getKey(o),o},_success:function(t,n){r.info("render apps");var i=this,a={};e.each(n,function(e,t){var n=i._getKey(t);a[n]=t}),e.each(t,function(e,t){var n=t.fragmentKey,o=a[n];o&&o.html?i._render(t,o):r.error("can not find item for "+n)})},_render:function(e,t){r.info("render app"+e.app),e.fn(e.app,t.html)},_getKey:function(e){return e.appName+"-"+e.app_key},_error:function(e){var t=e&&e.message||"\u7f51\u7edc\u7e41\u5fd9\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5";r.error(t)}};return o}),define("core.FragmentHandler",["jQuery","Log","core.Fragment","core.AppUtil"],function(e,t,n,i){var a=new t("core.FragmentHandler"),r=function(e,t,n){var i=n.async?"App":n.htmlFragment?"Html":!1;if(!i)return e;if(!t.hasClass("mod-ui-async")&&!t.hasClass("mod-ui-html-fragment"))return e;var a=t.hasClass("ui-load-async");if(a)return t.removeClass("mod-ui-async"),t.removeClass("mod-ui-html-fragment"),e;var r="function"==typeof e,s=r?e:e.init,c=o[i].create(s);if(r)c.prototype=e.prototype,e=c;else{var l=e.init;e.init=function(){e.init=l,c.apply(this,arguments)}}return e},o={};return o.App={create:function(t){var i=this;return function(t){n.add(t,e.proxy(i,"_render"))}},_render:function(e,t){var n=i.create(t);if(n){var a=n.app;e.empty().append(a.children());var r=a.attr("data-view-config"),o=a.attr("data-edit-config"),s=a.attr("data-app"),c=a.attr("data-result");r&&e.attr("data-view-config",r)&&e.data("viewConfig",JSON.parse(r)),o&&e.attr("data-edit-config",o)&&e.data("editConfig",JSON.parse(o)),s&&e.attr("data-app",s)&&e.data("app",JSON.parse(s)),c&&e.attr("data-result",c)&&e.data("result",JSON.parse(c)),e.attr("class",a.attr("class"));var l=e.data("viewConfig");l.async=!1,e.data("viewContextInited",!1),i.ready(e),e.addClass("mod-ui-async-complete")}}},o.Html={create:function(t){var i=this;return function(a,r){this.fragment=function(e,t){a.on("html-fragment-"+e,function(e,n){t(n)})},t.apply(this,arguments),n.add(a,e.proxy(i,"_render"))}},_render:function(t,n){var r=i.create(n);if(r){var o=this,s=this._cache(t),c=e(".ui-html-fragment",r.app);c.each(function(){var n=e(this),i=n.data("fragment");if(!i.name)return void a.error("invalid fragment config for "+n);var r=s[i.name];return r?void o._replace(t,r,n,i):void a.warn("no fragment found: "+i.name)}),t.addClass("mod-ui-html-fragment-complete")}},_cache:function(t){var n=e(".ui-html-fragment",t),i={};return n.each(function(){var t=e(this),n=t.data("fragment")||{};return n.name?void(i[n.name]=t):void a.error("invalid fragment config for "+t)}),i},_replace:function(e,t,n,i){t.replaceWith(n),e.trigger("html-fragment-"+i.name,n),n.addClass("ui-html-fragment-complete")}},r}),define("core.ViewContext",["jQuery","Context","Log","core.Component","core.FragmentHandler"],function(e,t,n,i,a){"use strict";var r=new n("core.ViewContext"),o=new t("ViewContext",{before:function(t){return this.context=t,this.defaultModule=new c(t),site.on("app-view-ready",function(e,n){var i=s.getTemplate(e);t.attach(e,i,n)}),e("div[data-app]","body").each(function(){site.trigger("app-view-ready",e(this))}),site.trigger("app-view-ready-all"),!1},query:function(e,t){this.defaultModule.add(e,t)},resolve:function(e){return i.getAppName(e)},bind:function(t,n,a,o){if(t.data("viewContextInited"))return void r.warn("node is already initialized "+t);t.data("viewContextInited",!0);var s=t.data("viewConfig"),c=t.data("result");r.isEnabled("error")&&s&&!e.isPlainObject(s)&&r.error("invalid data-view-config: "+t),s=e.extend({},i.getGlobalViewConfig(),s),s.context=i.getUserContext(),s.viewData=o,r.isEnabled("info")&&r.info("init app view "+t),this._init(a,t,s,c)},_init:function(e,t,n,i){e=this._decorate(e,t,n,i),s.execute(e,t,n,i)},_decorate:function(e,t,n,i){return a(e,t,n,i)}}),s={execute:function(e,t,n,a){var r=i.getAppName(t);site.executor.execute(r,function(){var i=e;"function"==typeof e?i=new e(t,n,a):e.init&&e.init(t,n,a),t.data("appObject",i)})},getTemplate:function(e){var t=i.getAppTemplate(e);return t&&"defaultTemplate"!==t?t:"default"}},c=function(e){this.context=e,this.cache={}};return c.prototype={init:function(e){r.info("proxy init for "+e);var t=this.cache,n=i.getAppName(e),a=s.getTemplate(e),o=this.getKey(n,a),c=t[o];c||(c=t[o]=[],setTimeout(function(){delete t[o]},1e4)),c.push(arguments)},getKey:function(e,t){return e+"."+t},add:function(t,n){var i=this.context.get(t,n),a=this.getKey(t,n),o=this.cache[a];return o?(e.each(o,function(e,t){r.info("proxy trigger for "+t[0]);var n=[i];n.push.apply(n,t),s.execute.apply(s,n)}),void delete this.cache[a]):void r.info("proxy no item found for "+t)}},o}),define("core.Parts",["jQuery","Class","Log"],function(e,t,n){var i=new n("core.Parts");return new t({init:function(e,t,n){"string"!=typeof e&&(n=t,t=e,e=t.name||"anony-part"),i.info("init parts: "+e),this._mixPartsProto(t),this._mixPartsMember(t),this._executeParts(e,t,n)},_mixPartsProto:function(t){if(!t.__partsMixed__){var n=this._getPartsProto(t);e.each(t.Parts,function(){e.extendIf(this,n)}),t.__partsMixed__=!0}},_getPartsProto:function(t){var n={};return e.each(t,function(i,a){"function"==typeof a&&"init"!==i&&"Parts"!==i&&0!==i.indexOf("_")&&(n[i]=e.proxy(a,t))}),n},_mixPartsMember:function(t){var n={};e.each(t,function(e,t){"init"!==e&&"Parts"!==e&&0!==e.indexOf("_")&&"function"!=typeof t&&(n[e]=t)}),e.each(t.Parts,function(){e.extend(this,n)})},_executeParts:function(t,n,a){i.info("execute Parts ..."),e.each(n.Parts,function(e,t){site.executor.execute(e,function(){t.init.apply(t,a||[])})})}})}),define("core.Msg",["jQuery","Log"],function(e,t){var n=new t("core.Msg"),i=e.extend({info:function(e){this._show(e,"info")},error:function(e){this._show(e,"error")},warn:function(e){this._show(e,"warn")},_show:function(e,t){this.fire(e,t)}},e.Callbacks());return i.add(function(e,t){n.info("["+t+"]"+e)}),i}),define("core.Remote",["jQuery","Log","core.Msg","core.Component"],function(e,t,n,i){var a=new t("core.Remote"),r={config:{},validateHandler:[],dataHandler:[],successHandler:[],errorHandler:[],call:function(t,n){var i=this._getConfig(t),r=i.url?i.url:t,o=null,s=null;return n=e.extend(!0,{cache:!1,type:"get",dataType:"json"},i,n),a.isEnabled("info")&&(s=(new Date).getTime(),a.info(t+" start")),o=e.extend(this._getDefaultData(t,n),n.data),this._request(r,o,n,s)},_getConfig:function(t){var n=i.getGlobalEditConfig("siteEventUrls")||{},a=this.config[t]||{};return n[t]&&(a=e.extend({},a),a.url=n[t]),a},_request:function(t,n,i,r){var o=this;return e.ajax(this._prepareUrl(t,i),{type:i.type,dataType:i.dataType,cache:i.cache,timeout:i.timeout,data:i.paramSpecial?e.paramSpecial(n):n,success:function(e){return o._validate(name,i,e)?(a.isEnabled("info")&&(r=(new Date).getTime()-r,a.info(name+" success, cost "+r+" ms")),o._doDefaultSuccess(name,i,e),i.success&&i.success(e),void(i.complete&&i.complete())):(a.warn("remote call return but failed"),void o._error(name,i,e))},error:function(){a.error("remote call error "+name),o._error(name,i),i.complete&&i.complete()}})},callEvent:function(t,n,i){var a=e.util.substitute("/event/app/{0}/{1}.htm",[t,n]);return this.call(a,e.extend({pageAware:!0,type:"post"},i))},callAscepter:function(t,n,i){var a=e.util.substitute("/ascepter/"+t),r=e.extend({},i);return r.type="post",r.data=r.data||{},r.data.methodConfig=JSON.stringify({name:n,paramterValues:this._getAscepterParams(r)}),delete r.data.params,this.call(a,r)},_getAscepterParams:function(t){var n=t.params||[];return n=e.isArray(n)?n:[n],t.uidAware&&n.splice(0,0,i.getUserContext().uid),n.length?n:void 0},_prepareUrl:function(t,n){return e.util.substitute(t,n)},_getDefaultData:function(t,n){var i={};return this.dataHandler.length&&e.each(this.dataHandler,function(a,r){e.extend(i,r(t,n))}),i},_validate:function(e,t,n){for(var i=0,a=this.validateHandler.length;a>i;i++)if(!this.validateHandler[i](e,t,n))return!1;return!0},_doDefaultSuccess:function(t,n,i){this.successHandler.length&&e.each(this.successHandler,function(e,a){a(t,n,i)})},_error:function(e,t,i){if(i&&501===i.errorCode)return void alert(i.errorMsg||"\u5305\u542b\u8fdd\u7981\u5185\u5bb9\uff0c\u8bf7\u4fee\u6539!");if(i&&i.errorMsg&&i.errorMsg.indexOf("forbiddenWords:")>-1)return void alert(i.errorMsg.replace("forbiddenWords:","")||"\u5305\u542b\u8fdd\u7981\u5185\u5bb9\uff0c\u8bf7\u4fee\u6539!");if(!t.error||t.error(i)===!1){for(var r=0,o=this.errorHandler.length;o>r;r++)if(this.errorHandler[r](e,t,i)!==!1)return;return i?void a.warn("ignore error"):void n.error("\u7f51\u7edc\u7e41\u5fd9\uff0c\u8bf7\u5237\u65b0\u540e\u91cd\u8bd5")}}};return r.dataHandler.push(function(t,n){var a={},r=i.getGlobalViewConfig("remoteExtraData");if(n.noExtraData||(a.site_id=i.getSiteId(),r&&e.extend(a,r)),n.csrfToken&&(a._csrf_token=i.getUserContext().csrfToken),n.pageAware&&(a.site_key=i.getSiteKey(),a.page_name=i.getPageName(),a.page_type=i.getPageType()),n.siteAware&&(a.site_key=i.getSiteKey()),n.templateAware&&(a.template_key=i.getTemplateKey()),n.regionAware){var o=n.regionAware.closest("div.region"),s=o.closest("div.segment");a.region_type=o.data("regionType"),a.segment_id=s.data("segmentId"),a.layout_type=s.data("layoutType")}return a}),r.validateHandler.push(function(e,t,n){var i=t.dataType||"html";return n?"html"===i&&!t.preventValidateHtml&&/]*>/i.test(n)?!1:"json"===i||"jsonp"===i?n.success||n.isSuccess:!0:!1}),e.extend(r.config,{"app.load":{url:"/app/{appName}.htm",type:"get",dataType:"html",pageAware:!0}}),r}),define("core.StyleLoader",["jQuery","Log","core.Component","CssLoader","core.RegisterAppsFac"],function(e,t,n,i,a){"use strict";var r=new t("core.StyleLoader");return{loadAppStyles:function(t,n,i){if(this._bindFlag||this._bindPageReload(),this._stylesCache||this._prepareStylesCache(),!this._stylesCache[t]){this._stylesCache[t]=!0;var a,r=[],o=[],s=[];return n=this._prepareStyles(t,n),a=this._prepareReactStyles(t,i),e.each(n,function(e,t){"css"===t.type&&r.push(t.url),"js"===t.type&&o.push(t.url)}),r.length&&s.push(this.loadAppCss(r)),o.length&&s.push(this.loadAppJs(o)),a.csses.length&&s.push(this.loadAppCss(a.csses,"cdn")),a.jses.length&&s.push(this.loadAppJs(a.jses,"cdn")),s.length?e.when.apply(e,s):null}},loadOssAppStyles:function(t,n){if(this._bindFlag||this._bindPageReload(),this._stylesCache||this._prepareStylesCache(),!this._stylesCache[t]){this._stylesCache[t]=!0;var i=[],a=[],r=[];return e.each(n,function(e,t){"css"===t.type&&i.push(t.url),"js"===t.type&&a.push(t.url)}),a.length&&r.push(this.loadOssAppJs(a)),i.length&&r.push(this.loadOssAppCss(i)),r.length?e.when.apply(e,r):null}},_bindPageReload:function(){var e=this;this._bindFlag=!0,site.on("page-reload",function(){e._prepareStylesCache()})},_prepareStylesCache:function(){r.info("prepare style cache");var t=this._stylesCache={},i=e("div[data-app]","#content");i.each(function(e,i){var a=n.getAppName(i);t[a]=!0})},_prepareStyles:function(t,n){if(e.isArray(n))return n;var i=[];return n.css&&i.push(this._createStyleItem(t,"css")),n.js&&i.push(this._createStyleItem(t,"js")),i},_prepareReactStyles:function(e,t){var i={csses:[],jses:[]};if(!t)return i;var r=n.getAppModuleConfig(t),o=r.extendInfo||{};
if("react"===r.appType){var s=o.frontName?o.frontName:e;i.jses.push("cwp-pc/"+s+"/"+o.frontVersion+"/index.js"),o.hasClass!==!1&&i.csses.push("cwp-pc/"+s+"/"+o.frontVersion+"/index.css"),a.registerApp(r)}return i},_createStyleItem:function(t,n){var i="app/{0}/1.0.0/{1}";return{type:n,url:e.util.substitute(i,[t,"view."+n])}},loadAppCss:function(t,a){var o="cdn"===a?n.getCdnDomain():n.getStaticDomain();t=e.makeArray(t);var s=15,c=null,l=o+"/??",u=null,f=null;return e.util.ua.ie&&(f=e("link.lazy-load","head"),r.info("link.lazy-load size: "+f.length),f.length>s&&(u=f.eq(0).removeClass("lazy-load"),l=u.attr("href")+",")),u&&setTimeout(function(){r.info("remote link"),u.remove()},1e4),c=l+t.join(","),r.info("loading css: "+c),e.Deferred(function(t){var n=i.load(c,{success:function(){t.resolve()}});e(n).addClass("lazy-load")})},loadAppJs:function(t,i){var a="cdn"===i?n.getCdnDomain():n.getStaticDomain(),o=a+"/??"+t.join(","),s=e.Deferred();return r.info("loading js "+o),e.ajax(o,{dataType:"script",cache:!0,success:function(){r.info("load js success "+o),s.resolve()}}),s},loadOssAppJs:function(t){for(var n=t.length||0,i=e.Deferred(),a=[],o=0;n>o;o++){var s=e.Deferred();e.ajax(t[o],{dataType:"script",cache:!0,success:function(){r.info("load js success "+t[o]),s.resolve()}}),a.push(s)}return e.when.apply(e,a).done(function(){i.resolve()}),i},loadOssAppCss:function(t){for(var n=t.length||0,a=e.Deferred(),r=[],o=0;n>o;o++){var s=e.Deferred(function(n){var a=i.load(t[o],{success:function(){n.resolve()}});e(a).addClass("lazy-load")});r.push(s)}return e.when.apply(e,r).done(function(){a.resolve()}),a}}}),define("core.AppLoader",["jQuery","Log","core.Remote","core.Component","core.StyleLoader","core.AppUtil"],function(e,t,n,i,a,r){var o=new t("core.AppLoader"),s={reload:function(t,n){var a=this;return n=n||{},t.length?this.request(e.extendIf({appName:i.getAppName(t),appKey:i.getAppKey(t),regionAware:t,success:function(e){t.replaceWith(e),n.success&&n.success(e,t),a._appReady(e,n),site.trigger("app-reload",[e,t])}},n)):void o.warn("parameter error, invalid app for reload")},load:function(t){var n=this,i=t.region,a=t.index;this.request(e.extendIf({appName:t.appName,appKey:t.appKey,appStyles:t.appStyles,regionAware:i,success:function(r,o,s){if(i){var c=e("div.mod-box",i);a=a>=0?a:c.length,0===a?i.prepend(o):c.eq(a-1).after(o)}t.success&&t.success(r,o,s),n._appReady(r,t),o&&site.trigger("app-box-ready",[o,t.boxData]),site.trigger("app-load",[r,o,s])}},t))},_appReady:function(e,t){e.addClass("ui-load-async"),r.ready(e,t)},request:function(t){var r=null,o=t.appdata;return t.isOssResource&&t.appStyles?r=a.loadOssAppStyles(t.appName,t.appStyles):t.appStyles&&(r=a.loadAppStyles(t.appName,t.appStyles,t.app)),o&&e.isPlainObject(o)&&(o=JSON.stringify(o)),n.call("app.load",e.extendIf({appName:t.appName,data:e.extend({app_key:t.appKey,appdata:o,is_diy:i.getUserContext().diy},t.data),success:e.proxy(this,"_requestSuccess",t,r)},t))},_requestSuccess:function(e,t,n){var i=r.create(n);i||e.error&&e.error();var a=i.app,o=i.box;return t?void t.then(function(){e.success(a,o,n)}):void e.success(a,o,n)}};return s}),define("core.AppDialog",["jQuery","Class","ui.Dialog","core.AppLoader"],function(e,t,n,i){return new t(n,{$prepare:function(t){if(!t.appName)throw"appName should specified";return t.loader=e.proxy(this,"_load"),t.buttons=t.buttons||[],t.contentSuccess=e.proxy(this,"_contentSuccess"),t},_load:function(t){var n=e.extend({},this.config);n.success=function(e){t(e)},n.error=function(){t(!1)},i.load(n)},_contentSuccess:function(e){var t=this.config;e.node.on("event",function(n,i){var a=i.type;a&&("close"===a?e.close():"loading"===a?e.showLoading(i.message):"function"==typeof t[a]&&t[a](i))})},getApp:function(){return e("div[data-app]",this.node)}})}),define("core.RegisterAppsFac",[],function(){return{registerApps:function(e){if(e&&0!==e.length)for(var t=0;t
0&&(t=t+"&fromsite="+a),i.length>0&&(t=t+"&domainType="+i),logurl=o+t+"&time="+d.getTime();try{(new Image).src=logurl}catch(r){}}return!0}return function(a){var r=t.getUserContext(),o=t.getGlobalConfig(),s=r.uid,c=o.isTP,l=o.isTopDomain,u=o.xunpanUrl,f=c?"PM":"COMMON",d=o.companyId;a=e(a),FE.util.alitalk(a,{prop:function(){var t=e(this).data("alitalk"),n=t.offerid;return n?"&gid="+t.offerid:""}}),a.mousedown(function(e){return aliclick(this,"?tracelog=wp_infowidget_alitalk"),aliclick(this,"?info_id="+d),n(this,s,"","",l,u),i(this,"alitalk",s,"athena",f,l),!1})}}),define("part.SiteAlitalk2",["jQuery","core.Component"],function(e,t){function n(e,t,n,i,a,r){a?xunpanInfo(e,"true",r,t,n,i):xunpanInfo(e,"false","",t,n,i)}function i(e,t,n,i,r,o){var s="";return s=s+"?type="+t,s=s+"&sourcetype="+i,s=s+"&toid="+n,s=s+"&memberLevel="+r,a(e,s,o),!0}function a(e,t,n){if(d=new Date,document.images){var i=n?"www":"",a="";try{a=document.cookie.match(/track_cookie[^;]*cosite=(\w+)/)[1]}catch(r){}var o="//web.archive.org/web/20220123160335/http://stat.1688.com/feedback/click.html";a.length>0&&(t=t+"&fromsite="+a),i.length>0&&(t=t+"&domainType="+i),logurl=o+t+"&time="+d.getTime();try{(new Image).src=logurl}catch(r){}}return!0}return function(a,r){var o=t.getUserContext(),s=t.getGlobalConfig(),c=o.uid,l=s.isTP,u=s.isTopDomain,f=s.xunpanUrl,d=l?"PM":"COMMON",p=s.companyId;a=e(a),a.mousedown(function(e){return aliclick(this,"?tracelog=wp_infowidget_alitalk"),aliclick(this,"?info_id="+p),n(this,c,"","",u,f),i(this,"alitalk",c,"athena",d,u),!1})}}),define("part.Fdsafe",["jQuery","Class"],function(e,t){return t({init:function(t,n){if(!t)throw"please specify appkey for fdsafe";this.appkey=t,this.name=n||"Anonymous";var i=this;e.each(["info","notice","warn","error","fatal"],function(e,t){i[t]=function(){try{var e=i._toMsg(arguments);i.log(e,t)}catch(n){}}})},log:function(e,t){},_toMsg:function(t){var n=[];return e.each(t,function(e,t){if(t){var i=t.toString();t.stack&&(i+="\n"+t.stack.substr(0,500)),n.push(i)}}),n.join(" | ")},_level:{info:0,notice:1,warn:2,error:3,fatal:4}})}),define(["jQuery","Log","core.PageContext","core.AppContext","core.ViewContext","ui.Autowire","core.Component","core.Fragment","part.Fdsafe"],function(e,t,n,i,a,r,o,s,c){var l=new t("!Site"),u={init:function(){var t=this;i.push("view",a),e(function(){site.executor.execute("domready",e.proxy(t,"ready"))})},ready:function(){this.initFdsafe(),this.initPage(),this.initAutowire(),site.trigger("domready-complete"),this.report()},initFdsafe:function(){var e=new c("1119a660fb00453aa8fe119141c7cf14",o.getSiteId());site.error.handler=function(t,n){if(e.warn(t,n),l.isEnabled("info"))throw t;var i=n?"["+n+"] "+t:t;l.error(i)}},initAutowire:function(){new r("body",{executor:site.executor}),site.on("app-view-ready app-edit-ready",function(e){new r(e,{executor:site.executor})})},initPage:function(){n.start(),i.start(),s.start()},report:function(){l.isEnabled("info")&&l.info("\n\n"+site.executor.report()+"\n\n")}};u.init()}),define(["jQuery","PageContext"],function(e,t){var n={init:function(){var t=(window.location.hash||"").substr(1);if(t){var n=t.split("&"),i={};e.each(n,function(e,t){var n=t.indexOf("=");-1!==n&&(i[t.substr(0,n)]=t.substr(n+1))}),i.action&&site.on("domready-complete",function(){site.trigger("action-"+i.action,i)})}}};t.add("plugin.Action",n)}),define(["jQuery","Log","PageContext","widget.LazyInitializer"],function(e,t,n,i){var a=new t("plugin.LazyLoad"),r={init:function(){var t=this;this.doInit("body"),site.on("domready-complete",function(){site.on("app-view-ready ui-lazy-load-bind",function(e){t.doInit(e)})}),site.on("ui-lazy-load-trigger",function(t){if(t=e(t),t.length&&!t.data("lazyLoadTrigger")){t.data("lazyLoadTrigger",!0);var n=e("textarea.lazy-load-template",t);n.each(function(){var t=e(this).data("lazyLoadHandler");t&&t()})}})},doInit:function(t){var n=this,a=e("textarea.lazy-load-template",t);a.each(function(){var t=e(this),a=t.prev("div.lazy-load-loading");a.length||(a=e(""),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/20220123160335/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/20220123160335/http://astyle.alicdn.com/fdevlib/js/lofty/util/messageproxy/1.0/messageproxy.js",function(){i.getScript("https://web.archive.org/web/20220123160335/http://astyle.alicdn.com/sys/js/purchaselist/v1/core.js",function(){i.getScript("https://web.archive.org/web/20220123160335/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('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/20220123160335/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(e,i,t,o,a){var n={renderAStoreShopSign:function(){jQuery(".app-shopSigns").width("100%");var e="wp_pc_common_shopsign",i="astore-shopsign",t=window.__astorePageData__||jQuery(".app-topbar").data("viewConfig").astorePageData;window.__oldPcWeb__&&window.__oldPcWeb__.renderModule&&window.__oldPcWeb__.renderModule(i,e,t)},init:function(i,t){if(t.useAStorePageData)return void this.renderAStoreShopSign();this.view=i;var n=e("div.logo img",i);o.resizeImage(n,80),this.initFlash(),a.setConfig({shopId:t.memberId,userNick:t.userLoginId}),a.log("shopSignsInfo",{templateName:t.templateName,isImall:t.isImall})},initFlash:function(){var i=this.view,t=e(".adv .flash",i),o=t.data("url");o&&e.use("ui-flash",function(){t.flash({swf:o,wmode:"transparent",width:952,height:t.data("height")})})}};i.register("view","shopSigns",n)});/**
* ��Ʒ���ม��
* @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/20220123160335/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-topbar').data('viewConfig').astorePageData;
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, pageData);
},
init: function (div, config, data) {
if (config.useAStorePageData) {
this.renderAStorePageTopNav();
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);
});
/**
* ????????
*/
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)});/**
* վ������
* @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);
});
/**
* @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', '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/20220123160335/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/20220123160335/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/20220123160335/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/20220123160335/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/20220123160335/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/20220123160335/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/20220123160335/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)});/**
* ��˾��̬
* @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', '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/20220123160335/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20220123160335/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/20220123160335/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 ��˾�����
*
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.Util', 'widget.UI', 'widget.Paging', 'part.Album'],
function($, AppContext, Util, UI, Paging, album) {
var initConfig = {
"maxNum": "8",
"hasAlbums":true
};
var AutoAlbum = {
init : function(context,config,data){
$.extendIf(data,initConfig);
new album(context,config,data);
}
}
/**
* �������
*/
AppContext.register('view', 'autoAlbum', AutoAlbum);
});
/**
* @fileoverview �Ƽ������
*
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.Util', 'widget.UI', 'widget.Paging', 'part.Album'],
function($, AppContext, Util, UI, Paging, album) {
var initConfig = {
"maxNum": "10",
"hasAlbums":true
};
var ManualAlbum = {
init : function(context,config,data){
$.extend(data,initConfig);
new album(context,config,data);
}
}
/**
* �������
*/
AppContext.register('view', 'manualAlbum', ManualAlbum);
});
define([ 'jQuery', 'AppContext' ], function($, AppContext) {
var CategoryBigView = ({
init : function(div, config, data) {
this.div = div;
//ȥ�������һ�з����µĺ�����ʽ
this.removeSplitStyle();
this.switchChildrenCategroy();
},
removeSplitStyle : function(){
var self = this;
var lastCategoryMainUl = $('ul.category-main',$('.m-content', self.div)).last();
if(lastCategoryMainUl.hasClass('category-main')){
lastCategoryMainUl.addClass('last-category-main');
}
},
switchChildrenCategroy : function() {
var self = this;
$('.arrowhead', self.div).bind('click',
function() {
//console.log($(this));
//��ȡ��ǰ���Ԫ�ص�index
var index = $(this).closest('li').index();
//console.log(index);
var currentliEle = $(this).closest('li');
var currentUlEle = $(this).closest('li').closest('ul');
//console.log(currentUlEle);
//��ȡ��Ҫ�����ĵ�ul
var showEle = currentUlEle.next('div.children-categories').find('ul.children-category').eq(index);
//console.log(showEle);
//���ϴ���ʾ��dom�ڵ��������
if(self.lastShowEle && self.lastShowEle[0] !== showEle[0]){
self.lastShowEle.hide();
}
//�Ƴ��ϴε�ѡ��Ч��
if(self.lastliEle && self.lastliEle[0] !== currentliEle[0]){
self.lastliEle.removeClass("select-li");
}
//�Ƴ��ϴεļ�ͷЧ��
if(self.lastSpanEle && self.lastSpanEle[0] !== $(this)[0]){
self.lastSpanEle.removeClass("hide-children-categroy");
self.lastSpanEle.addClass("show-children-categroy");
}
//�л�class
currentliEle.toggleClass("select-li");
//�л�������ʾЧ��
showEle.toggle();
//�л���ͷ�ķ���Ч��
if($(this).hasClass("show-children-categroy")){
$(this).removeClass("show-children-categroy");
$(this).addClass("hide-children-categroy");
}else{
$(this).removeClass("hide-children-categroy");
$(this).addClass("show-children-categroy");
}
//�ѱ�����ʾ��dom���浽ȫ�ֱ�����
self.lastShowEle = showEle;
self.lastliEle = currentliEle;
self.lastSpanEle = $(this);
}
);
}
});
AppContext.register('view', 'categoryBig', CategoryBigView);
});
define([ 'jQuery', 'AppContext' ], function($, AppContext) {
var CategoryBigView = ({
init : function(div, config, data) {
this.div = div;
this.config = config;
this.data = data;
//��ʼ�����ĸ߶�
this.initModHeight();
//����������ࡱ��ť��������
// this.showMoreChildrenCategroy();
//���·���ʾ���а�ť��������
this.showAllCategroies();
},
//�������С��6����ʼ���߶ȣ�����ʹ����ʽ���190px�ĸ߶�
initModHeight : function(){
var self = this;
if($('.fold-lines-count',self.div).val() < 6){
$('.category-main',self.div).height($('.category-main-height',self.div).val());
}
},
showMoreChildrenCategroy : function() {
var self = this;
$('.more-arrowhead-icon', self.div).bind('click',
function() {
//�������С��6��ʱ���ִ����
if($('.fold-lines-count',self.div).val() < 6){
//�л������ࡱ��ͷ����ʽ
$(this).toggleClass('arrowhead-up');
var currentCategroyDiv = $(this).closest('div');
//�л�������ʾ�Ĵ�С��ʽ
currentCategroyDiv.toggleClass('children-categroy-more-than-two-lines');
//��������ĸ߶����Զ�
$('.category-main',self.div).css("height","auto");
return;
}
//����ͷ�����������·��İ�ť����ʾ�����ʱ��ִ�еĺ���
if(!$(this).hasClass('arrowhead-up') && !$('.show-all-categroies',self.div).hasClass('hide-some-categroies')){
//�������������ʱ������������߶����ó��Զ�
$('.category-main', self.div).toggleClass('category-main-more');
//�ѵײ��ĸ��ఴť���ó��������ʽ
$('.show-all-categroies', self.div).toggleClass('hide-some-categroies');
}
var currentCategroyDiv = $(this).closest('div');
//�л�������ʾ�Ĵ�С��ʽ
currentCategroyDiv.toggleClass('children-categroy-more-than-two-lines');
//�л������ࡱ��ͷ����ʽ
$(this).toggleClass('arrowhead-up');
}
);
},
showAllCategroies : function() {
var self = this;
$('.show-all-categroies', self.div).bind('click',
function() {
// console.log($('.fold-lines-count', self.div).val())
var content = $(this).closest('div');
//�л���ʾ����Ĵ�С
$('.category-main', content).toggleClass('category-main-more');
//�л���ť�����ࡱ�͡���������ͼƬ��css
$(this).toggleClass('hide-some-categroies');
}
);
}
});
AppContext.register('view.tiled', 'categoryBig', CategoryBigView);
});
define(["jQuery","AppContext","part.SiteAlitalk2"],function(i,e){var t={init:function(){}};e.register("view","supplierInfoSmall",t)});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/20220123160335/http://astyle-src.alicdn.com/sys/css/logist/logist.css'],
js: ['//web.archive.org/web/20220123160335/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/20220123160335/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', 'Class'],function($, AppContext, Class) {
var WholesaleDescriptionSmall = new Class({
init: function(div) {
this.div = div;
//��tab��ť�¼�
$('div.operate-tabs-wholesale', div).on('click', $.proxy(this, "changeTabEffect","wholesale"));
},
/**
* ��tab��ʽ
*/
changeTabEffect : function(flag) {
if(flag == "wholesale"){
//����仯
$('div.operate-tabs-wholesale', this.div).addClass("font-blod");
//�»���Ч��
$('div.operate-tabs-wholesale', this.div).addClass("underline");
//������ʾ
$('div.wholesale-desc-main', this.div).removeClass("hidden");
}else{
//����仯
$('div.operate-tabs-wholesale', this.div).removeClass("font-blod");
//�»���Ч��
$('div.operate-tabs-wholesale', this.div).removeClass("underline");
//������ʾ
$('div.wholesale-desc-main', this.div).addClass("hidden");
}
}
});
AppContext.register('view', 'wholesaleDescriptionSmall', WholesaleDescriptionSmall);
});define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var AutoOfferSmall = 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-sub 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-sub 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(){
new Image().src = Util.formatUrl('//web.archive.org/web/20220123160335/http://ctr.1688.com/ctr.html', params || {});
new Image().src = '//web.archive.org/web/20220123160335/http://gm.mmstat.com/ctr.1688.2?gokey=' + encodeURIComponent($.param(param));
}
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/20220123160335/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/20220123160335/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', 'autoOfferSmall', AutoOfferSmall);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer'], function($, Class, AppContext, Component, Util, LazyInitializer) {
var AutoOfferSmall = 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-sub 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-sub 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('https://web.archive.org/web/20220123160335/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/20220123160335/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/20220123160335/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', 'autoOfferSmall.detail', AutoOfferSmall);
});
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', 'Log', 'AppContext', 'widget.UI'],
function($, Log, AppContext, UI) {
var log = new Log('app.poster.view');
var Poster = {
init: function(mod, config, data) {
var self = this;
this.segment = $('#site_fly_right_bottom');
this.container = $('div.container', mod);
this.config = config;
this.data = data || {};
this.fixFlyPosition();
this.render(this.data);
mod.on('render', function(e, data) {
self.render(data);
});
// �DZ༭״̬��Ҫ����hover��close�¼�
if (!config.context.diy) {
this.handleHover();
this.handleClose();
this.animate();
this.autoClose();
}
},
render: function(data) {
var container = this.container;
if (!this.checkStatus(data)) {
log.info('hide');
this.segment.addClass('position-fixed-hide').hide();
container.hide();
return;
}
log.info('show');
this.segment.removeClass('position-fixed-hide').show();
container.show();
var body = $('div.body', container);
body.empty();
data.posterType === 'flashPoster' ?
this.renderFlashPoster(body, data.flashPoster || {}) :
this.renderPicPoster(body, data.picPoster || {});
},
/**
* ��麣����ʾ״̬
*/
checkStatus: function(data) {
var picPoster = data.picPoster || {},
flashPoster = data.flashPoster || {},
now = $.now();
// �Ƿ���
if (data.posterStatus === 'disabled') {
return false;
}
if (!data.beginTime || !data.endTime) {
return false;
}
// �Ƿ�����Ч����
if (now < data.beginTime || now > data.endTime + 24 * 3600 * 1000) {
return false;
}
// ͼƬ��ַ�Ƿ���Ч
if (data.posterType === 'picPoster' && !picPoster.url) {
return false;
}
// ���flash��ַ�Ƿ���Ч
if (data.posterType !== 'picPoster' && !flashPoster.flashUrl) {
return false;
}
return true;
},
/**
* ��ȾFlash
*/
renderFlashPoster: function(body, flashPoster) {
var div = $('').addClass('flash').appendTo(body);
$.use('ui-flash', function() {
div.flash({
swf: flashPoster.flashUrl,
width: flashPoster.width || 200,
height: flashPoster.height || 200
});
});
},
/**
* ��ȾͼƬ
*/
renderPicPoster: function(body, picPoster) {
var div = $('
').addClass('image').appendTo(body);
if (picPoster.targetUrl) {
var link = $('
', { href: picPoster.targetUrl, target: '_blank' });
div.append(link);
div = link; // ͼƬ����������
}
var img = $('', { src: picPoster.url });
UI.resizeImage(img, {
size: 200,
success: function() {
div.append(img);
}
});
},
/**
* ��������hover�¼�
*/
handleHover: function() {
var self = this;
this.container.hover(function() {
self.autoClose(false);
self.container.addClass('mod-poster-hover');
}, function() {
self.autoClose(true);
self.container.removeClass('mod-poster-hover');
});
},
/**
* �����رհ�Ť�¼�
*/
handleClose: function() {
var self = this;
$('a.close', this.container).click(function(e) {
e.preventDefault();
self.close();
});
},
/**
* ����
*/
animate: function() {
var self = this,
container = this.container,
height = container.height();
container.css('bottom', '-200px');
setTimeout(function() {
container.animate({
bottom: 0
}, 3000, function() {
self.autoClose(true);
});
}, 2000)
},
/**
* �رպ���
*/
close: function() {
var container = this.container,
segment = this.segment;
container.animate({
bottom: '-=200'
}, function() {
container.remove();
segment.hide();
});
},
/**
* �Զ��ر�
* @param {boolean} open �Ƿ���
*/
autoClose: function(open) {
if (this.config.context.diy) {
return;
}
var self = this,
delay = 10000; // 10s
if (open && !this.timer) {
this.timer = setTimeout(function() {
self.close();
}, delay); // 10s
}
if (!open && this.timer) {
clearTimeout(this.timer);
this.timer = null;
}
},
fixFlyPosition: function() {
if (!$.util.ua.ie6 && this.segmentInited) {
return;
}
this.segmentInited = true;
var self = this;
UI.positionFixed(this.segment, {
bottom: true,
show: function(item) {
if (!item.hasClass('position-fixed-hide')) {
item.show();
}
}
});
site.on('app-box-minimize app-box-normalize', function(box) {
var segment = box.closest('div.segment');
if (self.segment[0] === segment[0]) {
log.info('trigger ui-position-fixed');
self.segment.trigger('ui-position-fixed');
box.trigger('mouseenter');
}
});
}
};
AppContext.register('view', 'poster', Poster);
});
/**
* ʵ���̼�����ͷ��
* @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/20220123160335/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/20220123160335/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/20220123160335/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