").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/20220421073705/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/20220421073705/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/20220421073705/http://astyle.alicdn.com/fdevlib/js/lofty/util/messageproxy/1.0/messageproxy.js",function(){i.getScript("https://web.archive.org/web/20220421073705/http://astyle.alicdn.com/sys/js/purchaselist/v1/core.js",function(){i.getScript("https://web.archive.org/web/20220421073705/http://astyle.alicdn.com/sys/js/purchaselist/v1/purchaselist.js",function(){})})})},1e3)}})});define(["jQuery","Class","AppContext","widget.UnStopRoll","widget.UI","widget.ImageLazyLoad"],function(e,i,t,a,o,l){var n=i({init:function(e,i,t){this.div=e,this.config=i,this.data=t,"detail"!==i.effectType&&"detailroll"!==i.effectType||64===parseInt(i.imageSize,10)?"roll"===i.effectType?i.context.diy||MT.ui.bigImgPlay(e):"commonroll"===i.effectType&&this.imageRoll(e,t):this.hoverEffect(e),this.rollImage(e),this.handleResizeImages(e),new l(e)},handleResizeImages:function(i){i=e("div.common-small-64",i),i.length&&i.on("widget-image-lazy-load","img",function(){o.resizeImage(this,64)})},imageRoll:function(i){setTimeout(function(){var t=e("ul.displayWindowCarouselViewList",i);new a(t,{Max:1,animateTime:1500,stopTime:2500})},3e3)},hoverEffect:function(i){i.on("mouseenter","li",function(){var i=e(this),t=e("div.hover-body",i),a=i.height()-e("div.image",i).height();i.addClass("hovered"),a>t.height()&&(i.addClass("fixheight"),t.css("height",a+"px"))}),i.on("mouseleave","li",function(){var i=e(this);i.removeClass("hovered"),e("div.hover-body",i).css("height","")})},rollImage:function(i){var t=function(e){var i=e.data("rollTimer");i&&clearTimeout(i),e.data("rollTimer",!1)};i.on("mouseenter","a.roll-image",function(){var i=e(this),a=i.closest("li");t(a);var o=i.data("imageSrc"),l=e("div.image img",a);l.attr("src",o)}),i.on("mouseleave","a.roll-image",function(){var i=e(this).closest("li");i.data("rollTimer",setTimeout(function(){t(i);var a=e("a.roll-image",i).eq(0),o=e("div.image img",i);o.attr("src",a.data("imageSrc"))},200))})}});t.register("view","offerGeneral",n)});define(['jQuery', 'Class','AppContext' ,'widget.UnStopRoll','widget.UI', 'widget.ImageLazyLoad'],
function($, Class, AppContext, UnStopRoll, UI, ImageLazyLoad) {
var smt_offerGeneral = new Class({
init : function(div, config, data) {
this.div = div;
if ((config.effectType === 'detail' || config.effectType === 'detailroll')
&& parseInt(config.imageSize, 10) !== 64) {
this.hoverEffect(div);
} else if (config.effectType === 'roll') {
if (!config.context.diy) {
MT.ui.bigImgPlay(div);
}
} else if (config.effectType === 'commonroll') {
this.imageRoll(div, data);
}
this.rollImage(div);
this.handleResizeImages(div);
this.imageSwitch();
new ImageLazyLoad(div);
},
handleResizeImages: function(div) {
var imageSmall = $('div.common-small-64', div);
imageSmall.length && imageSmall.on('widget-image-lazy-load', 'img', function() {
UI.resizeImage(this, 64);
});
var image = $('.image-resize',div);
image.length && div.on('widget-image-lazy-load', 'img', function() {
UI.resizeImage(this, $(this).data('size'));
});
},
imageRoll : function(div, data) {
setTimeout(function() {
var list = $('ul.displayWindowCarouselViewList', div);
new UnStopRoll(list, {
Max : 1,
animateTime : 1500,
stopTime : 2500
});
}, 3000);
},
hoverEffect: function(div) {
div.on('mouseenter', 'li', function() {
var li = $(this),
hover = $('div.hover-body', li),
height = li.height() - $('div.image', li).height(),
marginBottom = parseInt($('div.image', li).css('margin-bottom'));
li.addClass('hovered');
if (height > hover.height()) {
li.addClass('fixheight');
hover.css('height', height - marginBottom + 'px');
}
});
div.on('mouseleave', 'li', function() {
var li = $(this);
li.removeClass('hovered');
$('div.hover-body', li).css('height', '');
});
},
rollImage: function(div) {
var clear = function(li) {
var timer = li.data('rollTimer');
timer && clearTimeout(timer);
li.data('rollTimer', false);
};
div.on('mouseenter', 'a.roll-image', function() {
var elm = $(this),
li = elm.closest('li');
clear(li);
var imageSrc = elm.data('imageSrc'),
image = $('div.image img', li);
image.attr('src', imageSrc);
});
div.on('mouseleave', 'a.roll-image', function() {
var li = $(this).closest('li');
li.data('rollTimer', setTimeout(function() {
clear(li);
var img = $('a.roll-image', li).eq(0);
var image = $('div.image img', li);
image.attr('src', img.data('imageSrc'));
}, 200));
});
},
imageSwitch: function() {
if(!$('.thumb-image', this.div).length) {
return ;
}
$('.thumb-image a', this.div).on('click', function(e) {
e.preventDefault();
var image = $(this).data('image'),
li = $(this).closest('li');
li.find('.thumb-image').removeClass('thumb-active');
$(this).closest('.thumb-image').addClass('thumb-active');
li.find('.main-image img').attr('src', image);
});
}
});
AppContext.register('view', 'smt_offerGeneral', smt_offerGeneral);
});/**
* ����ǰ̨tracelog���
*/
define('app.tracelog.TraceLog', ['jQuery', 'Class'], function($, Class) {
return new Class({
init: function(data) {
var self = this;
$.each(data, function(selector, items) {
$.each(items || [], function(index, item) {
var event = item[2] || 'mousedown';
$(selector).on(event, item[0], function() {
self[event] && self[event](this, item[1]);
});
});
});
},
click: function(elm, tracelog) {
tracelog = typeof tracelog === 'function' ? tracelog.apply(elm) : tracelog;
tracelog && this.trace(tracelog);
},
mousedown: function() {
this.click.apply(this, arguments);
},
trace: function(tracelog) {
aliclick(null, '?tracelog=' + tracelog);
}
});
});
define(['jQuery', 'PageContext', 'app.tracelog.TraceLog', 'core.Component'],
function($, PageContext, TraceLog, Component) {
PageContext.add('app.tracelog.view', function() {
var context = Component.getUserContext();
context.diy || setTimeout(function() {
new TraceLog(Data);
}, 5000)
});
//~entry
// ������ݿ�ʼ
var Data = {
}
//~Data
});
/**
* ��ֹ֧��������
* @author zhao.zdw
*/
define([ 'jQuery', 'PageContext'],
function($, PageContext) {
var PreventAlipay = {
init:function (div, config, data) {
$('body').on('click', 'a', function(e) {
var linkUrl = $(this).attr('href');
if (linkUrl && linkUrl.toLowerCase().indexOf('alipay.com') > -1) {
e.preventDefault();
}
});
}
};
PageContext.register('PreventAlipay', PreventAlipay);
});
define(["jQuery","PageContext","core.Remote","core.Component"],function(e,t,i,a){var r={init:function(){var e=this;this.handPrivateOffer(),setTimeout(function(){e.onAppLoad()},3e3)},handPrivateOffer:function(){var t=e(".private-image-area","div.mod"),i=e(".private-price-area","div.mod");(t.length||i.length)&&this.sendRequest(t,i)},sendRequest:function(t,i){var r=this;return url=a.getGlobalViewConfig("eventUrl"),data={},url?(url+="/event/app/offerGeneral/partnerRelation.htm",url.indexOf("apps.1688.com")>0&&(data._server_name=a.getGlobalViewConfig("domainUrl")),void e.ajax(url,{dataType:"jsonp",data:data,success:function(e){if(e.isSuccess){var a=e.result;r.isPicAuth=a.isPicAuth,r.isPriceAuth=a.isPriceAuth,r._process(t,i)}},error:function(){}})):void this.sendCallEvent(t,i)},sendCallEvent:function(e,t){var a=this;i.callEvent("offerGeneral","partnerRelation",{success:function(i){if(i.isSuccess){var r=i.result;a.isPicAuth=r.isPicAuth,a.isPriceAuth=r.isPriceAuth,a._process(e,t)}},error:function(){}})},onAppLoad:function(){var t=this;site.on("app-view-ready",function(i){var a=e(".private-image-area",i),r=e(".private-price-area",i);(a.length||r.length)&&("undefined"==typeof t.isPicAuth?t.sendRequest(a,r):t._process(a,r))})},_process:function(t,i){this.isPicAuth?(t.addClass("authed"),t.closest(".offer-list-row-offer").find(".image-item-summm").each(function(){var t=e(this),i=t.data("summurl"),a=t.data("actualsrc");t.attr("src",i).data("bigsrc",a)})):t.each(function(){e(this).closest("div.image").find("div.private-image-clean").remove()}),this.isPriceAuth&&(i.addClass("authed"),i.each(function(){var t=e(this),i=t.attr("data-p");e(".price-container",t).html(i),e(".price-item",t).html(i)}))}};t.add("offer_partner_relation",r)});define('app.contactSmall.map', ['jquery','lofty/lang/class','util/exposure/1.0'], function($, Class, Exposure){
var hasInitMap = false;
var defer;
return Class({
init: function (div,data) {
this.div = div;
this.viewdata = data;
this.initMapContainer();
this.bindEvents();
this.delayLoad();
},
bindEvents: function () {
},
/**
* @desc ��ʼ����ͼ����
* */
initMapContainer: function () {
var id = this.mapId = 'amap' + new Date().getTime();
var mapBox = this.div.find('.map');
mapBox.attr('id', id);
},
/**
* @desc �ӳ������ͼ
* */
delayLoad : function(){
var self = this;
var viewdata = self.viewdata;
var exp = new Exposure({
target : '#' + self.mapId
});
exp.on('exposure', function(){
self.initMapScript();
});
// lofty����������һ����Ҫ�ֶ�����һ�¡�(~��~)
exp.execute();
},
/**
* @desc ��ͼ���벿��
* */
loadMap: function () {
var self = this;
var address = this.viewdata.address;
/**
* @desc �ߵµ�ͼ��api�����ȫ�ֱ���AMap,����ֻ��Ҫ�ж��Ƿ����,�Ϳ���֪���Ƿ��Ѿ����ص�ͼapi
* */
if(!window['AMap']){
this.mapNetworkError();
return;
}
if (!address) {
console && console.error('����ĵ�ַΪ��');
self.mapPosError();
return;
}
/**
* @desc ���ص����������
* */
AMap.service(["AMap.Geocoder"], function () {
var geocoder = new AMap.Geocoder();
/**
* @desc ���������ת��
* */
geocoder.getLocation(address, function (status, result) {
if (status !== 'complete' && result.resultNum > 0) {
console && console.error('��ͼλ�ý�������');
self.mapPosError();
return;
}
/**
* @desc ȡ��һ����
* */
var location = result.resultNum > 0 ? result.geocodes[0].location : {lat: 0, lng: 0};
var point = [location.lng, location.lat];
var map = new AMap.Map(self.mapId, {
zoom: 16,
resizeEnable: true,
center: point
});
AMap.plugin(['AMap.ToolBar','AMap.Scale'],
function(){
map.addControl(new AMap.ToolBar());
map.addControl(new AMap.Scale());
});
if (!result || !result.geocodes) {
return;
}
var opts = {
companyName : self.viewdata.companyName,
companyAddress: self.viewdata.address
};
addMarker(result.geocodes[0], map, opts);
self.div.find('.loadmask').hide();
});
});
},
/**
* @desc ���������ʾ
* */
mapNetworkError : function(){
this.div.find('.warn-msg').hide();
this.div.find('.warn-msg.networkerror').show();
this.div.trigger('map-load-error');
},
/**
* @desc ��λ������ʾ
* */
mapPosError : function(){
this.div.find('.warn-msg').hide();
this.div.find('.warn-msg.loaderror').show();
this.div.trigger('map-load-error');
},
/**
* @desc ��ʼ�������ͼ�ű�,������Ҫ���˸���ֹ��ͼapi���ظ����������.
* */
initMapScript: function () {
var self = this;
if (defer) {
defer.then(function(){
self.loadMap();
});
return;
}
defer = jQuery.Deferred();
defer.then(function(){
self.loadMap();
});
if(window['AMap']){
defer.resolve();
return;
}
var cb = function(){
window[self.id] = null;
defer.resolve();
};
hasInitMap = true;
this.id = 'init' + new Date().getTime();
window[this.id] = cb;
loadAMapScript(this.id);
}
});
function loadAMapScript(callbackName) {
var script = document.createElement("script");
script.type = "text/javascript";
script.src = top.window.location.protocol + "//web.archive.org/web/20220421073705/http://webapi.amap.com/maps?v=1.3&key=03068365dcc9ca7ec6db154941fe9327&callback=" + callbackName;
document.body.appendChild(script);
}
/**
* @desc ��ͼͼ���ע,�Լ�������
* */
function addMarker(d, map, opts) {
var contentHtml = [
'
' + opts.companyName + '
',
'
' + opts.companyAddress + '
'
].join('');
var marker = new AMap.Marker({
map: map,
position: [d.location.getLng(), d.location.getLat()]
});
var infoWindow = new AMap.InfoWindow({
content: contentHtml,
offset: {x: 0, y: -30}
});
infoWindow.open(map, marker.getPosition());
}
})
define(["jQuery","AppContext","widget.Util","widget.UI","util.SlsLogger"],function(i,e){var t={init:function(i,e){e.hitGrep}};e.register("view","shopSigns",t)});/**
* ��Ʒ���ม��
* @author zengpan.zhengzp
*/
define(['jQuery', 'AppContext', 'widget.FloatPanel', 'lofty/util/template/2.0/template'], function ($, AppContext, FloatPanel, Template) {
var BrandCategory = {
init: function (div, config, data) {
this.resizeTopNav();
if (config.context.diy) {
$('#topnav').on('click', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
$('#topnav').on('mouseenter', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
return;
}
this.log('start');
this.renderUtil = null;
this.fullCategory = [];
this.winportUserId = config.userId;
this.initHtmlCompiler();
this.hasShowCategory = false;
this.loadMtop(this.initTarget);
},
resizeTopNav: function () {
jQuery('.segment-box').first().addClass('segment-box-fluid')
},
loadFirstCategory: function (cb) {
BrandCategory.fetchChildrenCategory(
{
winportUserId: BrandCategory.winportUserId,
parentGroupId: '-1'
},
function (res) {
BrandCategory.fullCategory = res.category || [];
cb && cb();
});
},
loadMtop: function (cb) {
$.getScript('//web.archive.org/web/20220421073705/http://g.alicdn.com/mtb/lib-mtop/2.5.8/mtop.js', function () {
cb && cb();
});
},
initTarget: function () {
$('a.allSpuList').on('mouseenter', function (e) {
if (BrandCategory.hasShowCategory) {
return;
}
BrandCategory.hasShowCategory = true;
e && (e.preventDefault(), e.stopPropagation());
BrandCategory.loadFirstCategory(function () {
var covertedData = BrandCategory.convertToRenderData(BrandCategory.fullCategory || []);
var renderData = {
firstCategory: covertedData,
secondCategory: [],
thirdCategory: [],
firstIndex: -1,
secondIndex: -1,
};
BrandCategory.render('.brand-first-category', BrandCategory.renderUtil.firstHtmlRender, renderData);
})
})
},
log: function (str) {
console.log('---topNav---', str);
},
logTree: function (list, tab) {
function logTree(list, tab) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(tab + cur.groupId);
if (cur.children && cur.children.length > 0) {
logTree(cur.children, tab + '--')
}
}
}
logTree(list, tab);
},
fetchChildrenCategory: function (params, cb) {
lib.mtop.config.prefix = 'h5api'
lib.mtop.config.mainDomain = '1688.com'
lib.mtop.config.subDomain = 'm';
lib.mtop.request({
api: 'mtop.1688.imall.itemdigital.productgroup.listChildGroup', // 必须
v: '1.0',
data: params,
ecode: 0,
type: 'GET',
dataType: 'jsonp',
timeout: 20000,
},
function (result) {
cb({
parentGroupId: params.parentGroupId,
category: (result.data && result.data.result) || []
});
})
},
checkChildren: function (fullCategory, parentId, cb) {
function addChildrenToTree(list, parentId, children) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var curItem = list[i];
var groupId = curItem.groupId;
if (groupId === parentId) {
curItem.children = children;
return list;
}
if (curItem.children && curItem.children.length > 0) {
addChildrenToTree(curItem.children, parentId, children);
}
}
return list;
}
function findNode(list, id) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(cur.groupId);
if (cur.groupId === id) {
return cur;
}
if (cur.children && cur.children.length > 0) {
var res = findNode(cur.children, id);
if (res) {
return res;
}
}
}
return null;
}
var parent = findNode(fullCategory, parentId);
if (!parent) {
return;
}
if (parent.children && parent.children.length > 0) {
cb(fullCategory);
return;
}
this.fetchChildrenCategory(
{
winportUserId: this.winportUserId,
parentGroupId: parentId
},
function (res) {
var parentGroupId = res.parentGroupId;
var category = res.category;
var newCategory = addChildrenToTree(fullCategory, parentGroupId, category);
cb(newCategory);
}
);
},
convertToRenderData: function (fullCategory) {
function genDataConvert() {
return function (item) {
item = item || {};
var groupId = item.groupId;
var groupName = item.groupName;
var leafNode = item.leafNode;
var res = {
groupId: groupId,
title: groupName,
leafNode: (leafNode + '') === 'true',
};
if (!leafNode) {
res.children = [];
}
return res;
}
}
function recursive(list, dataConvert) {
var newList = [];
if (!list) {
return [];
}
for (var i = 0, len = list.length; i < len; i++) {
var newItem = dataConvert(list[i]);
if (list[i].children && list[i].children.length > 0) {
newItem.children = recursive(list[i].children, dataConvert);
}
newList.push(newItem);
}
return newList;
}
function resetLink(list, level, parentId) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
if (cur.leafNode) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
} else {
if (level === 1) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(cur.groupId);
}
if (level === 2) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(parentId) + '&twoCateId=' + encodeURIComponent(cur.groupId);
}
if (level === 3) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
}
}
if (cur.children && cur.children.length > 0) {
resetLink(cur.children, level + 1, cur.groupId);
}
}
return list;
}
var covertedData = recursive(fullCategory, genDataConvert());
return resetLink(covertedData, 1, -1);
},
initHtmlCompiler: function () {
var firstCategory = "\
\
\
\
{{if firstCategory && firstCategory.length > 0}}\
\
{{/if}}\
\
";
var secondCategory = "\
\
{{if secondCategory && secondCategory.length > 0}}\
\
{{selectedFirstCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
\
";
var thirdCategory = "\
{{if thirdCategory && thirdCategory.length > 0}}\
\
{{selectedSecondCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
";
this.renderUtil = {
firstHtmlRender: Template.compile(firstCategory),
secondHtmlRender: Template.compile(secondCategory),
thirdHtmlRender: Template.compile(thirdCategory),
};
},
bindCategoryClickEvent: function (html) {
if (!html) {
return;
}
function genthrottling(func, time) {
var timer = null;
var valid = true;
return {
enter: function (e) {
if (!valid) {
return;
}
valid = false;
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
valid = true;
func(e);
}, time);
},
leave: function (e) {
clearTimeout(timer);
valid = true;
},
}
}
var _this = this;
function eventHandler(e) {
e && (e.preventDefault(), e.stopPropagation());
var groupId = e.target.getAttribute('group-id');
var leafNode = e.target.getAttribute('leaf-node') === 'true';
var level = e.target.getAttribute('category-level');
var firstIndex = e.target.getAttribute('first-index');
var secondIndex = e.target.getAttribute('second-index');
var arrayIndex = e.target.getAttribute('array-index');
if (leafNode && level === '0') {
_this.clear('.brand-second-category');
_this.clear('.brand-third-category');
return
}
if (leafNode && level === '1') {
_this.clear('.brand-third-category');
return
}
if (level === '0' && arrayIndex === firstIndex) {
return
}
if (level === '1' && arrayIndex === secondIndex) {
return
}
_this.checkChildren(
_this.fullCategory,
groupId,
function (newCategory) {
var coverted = _this.convertToRenderData(newCategory);
var renderData = {
firstCategory: coverted,
secondCategory: [],
thirdCategory: [],
};
if (level === '0') {
renderData.firstIndex = arrayIndex;
renderData.selectedFirstCat = coverted[arrayIndex];
renderData.selectedSecondCat = null;
renderData.secondIndex = null;
renderData.secondCategory = coverted[arrayIndex].children;
renderData.thirdCategory = [];
_this.render('.brand-second-category', _this.renderUtil.secondHtmlRender, renderData);
_this.clear('.brand-third-category');
}
if (level === '1') {
renderData.firstIndex = firstIndex;
renderData.secondIndex = arrayIndex;
renderData.secondCategory = coverted[firstIndex].children;
renderData.selectedSecondCat = renderData.secondCategory[arrayIndex];
renderData.thirdCategory = coverted[firstIndex].children[arrayIndex].children;
_this.render('.brand-third-category', _this.renderUtil.thirdHtmlRender, renderData);
}
});
}
var headlers = genthrottling(eventHandler, 300);
html.on('mouseenter', '.category-item-title', headlers.enter);
html.on('mouseleave', '.category-item-title', headlers.leave);
},
bindCloseButtonClickEvent: function (html) {
if (!html) {
return;
}
var _this = this;
html.on('click', '.close-button', function (e) {
_this.hasShowCategory = false;
e && (e.preventDefault(), e.stopPropagation());
$('.brand-first-category').empty();
$('.brand-second-category').empty();
$('.brand-third-category').empty();
})
},
render: function (containerId, compiler, renderData) {
var htmlStr = compiler(renderData);
var html = $(htmlStr);
this.bindCategoryClickEvent(html);
if (containerId === '.brand-first-category') {
this.bindCloseButtonClickEvent(html);
}
var contain = $(containerId);
contain.empty().append(html);
},
clear: function (containerId) {
var contain = $(containerId);
contain.empty();
}
};
var OfferCategory = {
renderAStorePageTopNav: function () {
jQuery('.app-topNav').width('100%');
var moduleName = 'wp_pc_common_topnav';
var containNode = 'astore-topnav';
var pageData = window.__astorePageData__ || jQuery('.app-topNav').data('viewConfig').astorePageData;
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, pageData, true);
},
init: function (div, config, data) {
if (config.hitGrep) {
if (config.topDomain) {
this.renderAStorePageTopNav();
return;
}
return
}
if (config.brandPlusTopNav) {
BrandCategory.init(div, config, data);
return;
}
this.pageSize = 10;
this.config = config;
this.div = div;
this.handler = $('a.show-category', div);
this.supHandler = $('.other-cat-link', div);
this.bindEvent();
this.pageGoldClick();
// �������Ŀ��������ʾ
this.bindOtherCatState();
// �������Ŀ����������ҳʱ����Ĭ����ʾ
this.checkNavPosition();
},
bindEvent: function () {
var self = this;
this.handler.one('mouseenter', function () {
self.showCategoryDiv();
});
},
bindOtherCatState: function () {
var self = this;
if (self.config.context.diy !== 'true') {
this.supHandler.on('mouseenter', function () {
self.showOtherCatDiv();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
self.hideOtherCatDiv();
// self.supHandler.removeClass('active');
});
}
},
checkNavPosition: function () {
var self = this;
if (self.config.isDiy !== 'true' && self.config.nowPageName === 'index') {
// self.supHandler.addClass('active')
self.showOtherCatDiv();
}
},
pageGoldClick: function () {
$('.top-nav-bar-box li').click(function () {
var page_id;
var pageName = $(this).data('page-name');
if (window.dmtrack_pageid) {
page_id = dmtrack_pageid;
}
if (window.goldlog) {
goldlog.record('/1688-winport-element.click.shopclick', 'CLK', 'click_type=page' + '&page_type=' + pageName + '&page_id=' + page_id, 'H1511971673');
}
});
},
//����������Ŀ
showSubCategory: function () {
var self = this;
firCategory = $('li.sec', self.containerDiv);
//������һ����Ŀչʾ������Ŀ����
self.containerDiv.on('mouseenter', 'li.sec', function () {
//��һ����Ŀ������������data-index�����Կ������һ����Ŀ��Ӧ�Ķ�����Ŀdiv
var subClassName = $(this).attr("data-index");
var position = $(this).position();
var left = position.left + 192;
self.hoverClass = " rhover";
var topNavIndex = $('input[name=topNavIndex]', self.containerDiv).val();
//����Ӧ��Ʒ��Ŀҳ�ڵ�������ǰ�ĸ�ʱ������Ŀ���Ҹ�������������
if (topNavIndex > 4) {
//��������Ŀ�����Ҷ�����Ŀ��������10��������Ҫ�ֳ����У�ÿ�п�200px������λ����Ҫ�����ƽ�400px
var subSize = $("input[name=subSize]", $(this)).val();
if (subSize > 10) {
left = position.left - 402;
} else {
left = position.left - 202;
}
self.hoverClass = " lhover";
}
//����һ����Ŀ����hoverЧ��
var firClassName = $(this).attr("class");
if (firClassName.indexOf(self.hoverClass) == -1) {
$(this).addClass(firClassName + self.hoverClass);
}
//�ҵ�Ҫչʾ�Ķ�����Ŀdivչʾ֮
self.subCategory = $("div." + subClassName, self.containerDiv).css({
'display': 'block',
'left': left,
'top': position.top
});
self.subCategory.bind('mouseleave', function () {
$(this).css("display", "none");
//�˳�������Ŀȥ��һ����Ŀ��hoverЧ��
self.delHover(firCategory, self.hoverClass);
});
});
//����뿪һ����Ŀ���ض�����Ŀ����
self.containerDiv.on('mouseleave', 'li.sec', function () {
var handler = this;
var className = $(this).attr("data-index");
self.timeOut = setTimeout(function () {
$("div." + className, self.containerDiv).css("display", "none");
//�˳�һ����Ŀȥ��hoverЧ��
self.delHover($(handler), self.hoverClass);
}, 20);
//��һ����Ŀ���������Ŀ����ʱ�����ֶ�����Ŀ���㲻����
self.subCategory.bind('mouseenter', function () {
clearTimeout(self.timeOut);
});
});
},
//��ҳ
changePage: function () {
var self = this;
var upPage = $('a.up', self.containerDiv);
var downPage = $('a.down', self.containerDiv);
//���Ϸ�ҳ
upPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == 1) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
//���Ϸ�ҳҳ����1
pageNum = pageNum - 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
//���·�ҳ
downPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == pages) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
pageNum = pageNum + 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var nextStart = (pageNum - 1) * self.pageSize + 1;
var nextEnd = nextStart + self.pageSize;
if (pageNum == pages) {
nextEnd = nextStart + self.pageSize + 1
}
for (var i = nextStart; i < nextEnd; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
},
//����Ŀ��������չʾҳ��
showPageNum: function (pageNum) {
var $pageNum = $('span[name=pageNum]', this.containerDiv);
$pageNum.html(pageNum);
},
//���hover��
delHover: function (obj, hoverClass) {
var firClassName = obj.attr("class");
obj.removeClass(hoverClass);
},
//�л�class show hidden
switchClass: function (obj, replacement) {
var className = obj.attr("class");
if (!className) {
return;
}
if (replacement == "show") {
className = className.replace(/category-hide\d+/, 'show');
} else {
className = className.replace("show", replacement);
}
obj.attr("class", className);
},
ajaxCategoryLoader: function (callback) {
var config = this.config;
if (!config.categoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.categoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
topNavIndex: config.topNavIndex
},
success: function (_data) {
callback(_data);
}
});
},
showCategoryDiv: function () {
var self = this;
this.ajaxCategoryLoader(
function (categoryDiv) {
var offset = self.handler.offset();
self.containerDiv = $('
');
self.containerDiv.appendTo('body');
//��ȡ��div���Ҳ�λ��
var topNavBar = $('.top-nav-bar');
var winWidth = topNavBar.width() + topNavBar.offset().left;
var divWidth = 192;
if (offset.left + divWidth > winWidth) {
offset.left = winWidth - divWidth - 2;
}
self.containerDiv.css({
'display': 'none',
'left': offset.left,
'top': offset.top + self.handler.height()
});
self.containerDiv.html(categoryDiv);
//�Զ�̬���ɵ�div���Ӵ��
site.trigger('widget-tracelog', self.containerDiv);
//��ҳ
self.changePage();
//����������Ŀ
self.showSubCategory();
//���Ƹ��㸡��ʱ�����ʧʱ��
new FloatPanel(self.containerDiv, {
handler: self.handler,
event: 'mouseenter',
autoClose: 300,
delay: 300
});
self.handler.trigger('mouseenter');
}
);
},
showOtherCatDiv: function () {
var self = this;
var supList = $('#sup-store-container');
if (supList.length === 0) {
this.getOtherCatDiv(function (supDiv) {
// var offset = self.supHandler.offset();
self.supMainDiv = $('
');
self.supMainDiv.appendTo(self.supHandler.parent());
self.supMainDiv.css({
'position': 'absolute',
'left': 0,
'top': self.supHandler.height(),
"zIndex": 2000
});
self.supMainDiv.html(supDiv);
self.supMainDiv.on('mouseenter', function () {
self.supMainDiv.stop(true, true).show();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
// self.supHandler.removeClass('active');
// self.supMainDiv.delay(100).fadeOut(50);
self.fadeOutOtherCatDiv(100, 50);
})
});
} else {
supList.stop(true, true).fadeIn();
}
},
hideOtherCatDiv: function () {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.hide();
}
},
fadeOutOtherCatDiv: function (delay, time) {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.delay(delay).fadeOut(time)
}
},
getOtherCatDiv: function (callback) {
var self = this;
var config = this.config;
var selectedCats = config.selectedCats;
// try {
// selectedCats = this.config.selectedCats
// } catch(e) {}
if (!config.otherCategoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.otherCategoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
selectedCats: selectedCats
},
success: function (_data) {
callback(_data);
},
error: function () {
// ������⣬ֱ�ӷ�����100%��ʧ�ܣ��������Ի���
self.showOtherCatDiv();
}
});
}
};
AppContext.register('view', 'topNav', OfferCategory);
});define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var AutoOfferFull = 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/20220421073705/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/20220421073705/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/20220421073705/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', 'autoOfferFull', AutoOfferFull);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer'], function($, Class, AppContext, Component, Util, LazyInitializer) {
var AutoOfferFull = 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/20220421073705/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/20220421073705/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/20220421073705/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', 'autoOfferFull.detail', AutoOfferFull);
});
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/20220421073705/https://astyle-src.alicdn.com/fdevlib/js/fdev-v4/widget/ui/dialog-min.js?v=1.0"],function(e,n){var i={name:"wpCoupon1118",init:function(e,n){this.div=e,this.config=n,this.bindEvents()},bindEvents:function(){}};n.register("view",i.name,i)});define(["jQuery","PageContext","core.Remote","core.Component"],function(e,t,i,a){var r={init:function(){var e=this;this.handPrivateOffer(),setTimeout(function(){e.onAppLoad()},3e3)},handPrivateOffer:function(){var t=e(".private-image-area","div.mod"),i=e(".private-price-area","div.mod");(t.length||i.length)&&this.sendRequest(t,i)},sendRequest:function(t,i){var r=this;return url=a.getGlobalViewConfig("eventUrl"),data={},url?(url+="/event/app/offerGeneral/partnerRelation.htm",url.indexOf("apps.1688.com")>0&&(data._server_name=a.getGlobalViewConfig("domainUrl")),void e.ajax(url,{dataType:"jsonp",data:data,success:function(e){if(e.isSuccess){var a=e.result;r.isPicAuth=a.isPicAuth,r.isPriceAuth=a.isPriceAuth,r._process(t,i)}},error:function(){}})):void this.sendCallEvent(t,i)},sendCallEvent:function(e,t){var a=this;i.callEvent("offerGeneral","partnerRelation",{success:function(i){if(i.isSuccess){var r=i.result;a.isPicAuth=r.isPicAuth,a.isPriceAuth=r.isPriceAuth,a._process(e,t)}},error:function(){}})},onAppLoad:function(){var t=this;site.on("app-view-ready",function(i){var a=e(".private-image-area",i),r=e(".private-price-area",i);(a.length||r.length)&&("undefined"==typeof t.isPicAuth?t.sendRequest(a,r):t._process(a,r))})},_process:function(t,i){this.isPicAuth?(t.addClass("authed"),t.closest(".offer-list-row-offer").find(".image-item-summm").each(function(){var t=e(this),i=t.data("summurl"),a=t.data("actualsrc");t.attr("src",i).data("bigsrc",a)})):t.each(function(){e(this).closest("div.image").find("div.private-image-clean").remove()}),this.isPriceAuth&&(i.addClass("authed"),i.each(function(){var t=e(this),i=t.attr("data-p");e(".price-container",t).html(i),e(".price-item",t).html(i)}))}};t.add("offer_partner_relation",r)});/**
* �Ż�ȯ
*/
define(['jQuery', 'AppContext', 'Class', 'fui/timer/1.0'], function($, AppContext, Class, Timer) {
var View = new Class({
init: function(app, config) {
this.app = app;
this.root = $('#mod-discount-offer', this.app);
this.items = $('li.item', this.root);
this.ts = $('.c-timer', this.items);
this.sysDate = this.root.data('sysDate');
this.run( this.items );
},
run : function ( nodes, nstr ){
var self = this;
$.use('ui-timer',function(){
nodes.each(function ( index, obj ){
self.runCell( $( this ), nstr);
});
});
},
runCell : function ( node, nstr ){
var self = this,
st = $('.c-timer' + ( nstr ? nstr : ''), node),
config = node.data('config'), state;
if( typeof config['state'] == 'undefined' ){
return;
}
state = config.state;
state = JSON.parse(state);
var ft = state ?
( new Date( self.formatDate( self.sysDate) ) - new Date( self.formatDate( config.startDate) >= 0 )
? self.sysDate : config.startDate )
: self.sysDate,
tt = state ? config.endDate : config.startDate;
ft = self.formatDate( ft );
tt = self.formatDate( tt );
var timer = new Timer({
autoStart : true,
form : new Date( ft ),
to: new Date( tt ),
fixInterval: true,
useServerTime: true,
el: st,
event : {
stop: function() {
self.stopAction(self, node, config, state);
}
}
});
if(st.data('events') && st.data('events')[ 'stop' ]){
return;
}
},
stopAction: function(self, node, config, state) {
if (!state) {//������û�п�ʼִ��
config.state = String(!state);
node.data('config', config);
node.removeClass('item-unstart').addClass('item-start');
$('.block-info .block-tip-before',node).html('��������');
self.run(node)
}else {//ֱ�ӽ�����
node.removeClass('item-start').addClass('item-end');
$('a.snatch-tip',node).addClass('gray');
}
},
replaceSelf : function ( node, tag ){
node.replaceWith( '<' + tag + ' class="' + node[0].className + '" id="' + node[0].id + '" >' + node.html() + '' + tag + '>');
},
formatDate : function ( tstr ){
//Ϊ�˼���ie8 2013-08-09 ת����2013/08/09 ʧЧ����
return tstr.replace(/\-/g, '/');
}
});
//~ View
AppContext.register('view', 'limitDiscount', View);
});
define(['jQuery', 'AppContext', 'Class'], function($, AppContext, Class) {
var View = new Class({
init: function(node, config) {
var t=this;
t.node = node;
t.config = config;
if(!t.config.zeroResult){
t._init();
}
},
_init: function() {
var t=this,
chartNode=t.node.find('.chart'),
listNode=t.node.find('.obj-trend-table');
t.ajaxSpuList('init');
t.trendChartHandle();
t.node.find('.trigger').on('click','a',function(e){
var ancestor=$(this).closest('li');
e.preventDefault();
if(!$(this).hasClass('disabled')){
if($(this).closest('.prev').length>0){
listNode.data('curPage',listNode.data('curPage')-1);
}else{
listNode.data('curPage',listNode.data('curPage')+1);
}
t.ajaxSpuList('reload');
}
});
t.node.find('.obj-trend-table .table-wrap').on('mouseenter','.tbody ul',function(){
var item=$(this);
item.addClass('current');
item.siblings('ul').removeClass('current');
chartNode.trigger('trendChartUpdate',[item.data('spuId'),item.data('offerId'),item.find('.td1 a').html()]);
});
},
trendChartHandle:function(){
var t=this,
chartNode=t.node.find('.chart');
chartNode.on('trendChartInit',function(e,spuId,offerId,htmlStr){
$.add('spuprice',{requires:['ui-core'],js:['https://web.archive.org/web/20220421073705/http://style.c.aliimg.com/sys/js/spu/spuprice/spuprice.js']});
$.use('spuprice',function(){
chartNode.spuprice({
apiUrl : t.config.spuPriceUrl,
width : 370,
height : 180,
spuId : spuId,
offerId : offerId,
memberId : t.config.memberId
});
$('.obj-trend-chart .subject').html(htmlStr);
});
});
chartNode.on('trendChartUpdate',function(e,spuId,offerId,htmlStr){
chartNode.spuprice('loadData',{
spuId : spuId,
offerId : offerId,
memberId : t.config.memberId
});
$('.obj-trend-chart .subject').html(htmlStr);
});
},
ajaxSpuList:function(type){
var t=this,
listNode=t.node.find('.obj-trend-table');
$.ajax({
url:t.config.spuListUrl,
data:{
memberId:t.config.memberId,
page:listNode.data('curPage')
},
dataType: 'jsonp'
}).done(function(o){
if(o.success&&o.data.spuOfferList&&o.data.spuOfferList.length>0){
t._successHandler(o.data,type);
}
});
},
_successHandler:function(data,type){
var t=this,
listNode=t.node.find('.obj-trend-table'),
triggerNode=t.node.find('.trigger'),
page=listNode.data('curPage'),
chartNode=t.node.find('.chart'),
htmlStr='',
triggerHtml='',
curSpuNode,
curListNode;
htmlStr+=
'
'+
'
'+
'
'+
'- �ͺ�Ʒ��
'+
'- ����
'+
'- �۸�
'+
'
'+
'
'+
'
';
$.each(data.spuOfferList,function(index){
var dtype = "", dprice = "";
if(this.type){
dtype = this.type;
}
if(this.price){
dprice = this.price;
}
htmlStr+=
'
';
});
htmlStr+=
'
'+
'
';
listNode.find('.table-wrap').append(htmlStr);
listNode.data('curPage',data.page);
triggerHtml+=
'
';
triggerNode.html(triggerHtml);
curListNode=listNode.find('.table-wrap .unit-table').eq(data.page-1);
curSpuNode=curListNode.find('ul.current').eq(0);
if(curSpuNode.length===0){
curSpuNode=curListNode.find('ul').eq(0);
curSpuNode.addClass('current');
}
curListNode.show();
curListNode.siblings('.unit-table').hide();
if(type!=='init'){
chartNode.trigger('trendChartUpdate',[curSpuNode.data('spuId'),curSpuNode.data('offerId'),curSpuNode.find('.td1 a').html()]);
}else{
chartNode.trigger('trendChartInit',[curSpuNode.data('spuId'),curSpuNode.data('offerId'),curSpuNode.find('.td1 a').html()]);
}
}
});
AppContext.register('view', 'priceInfo', View);
});define(['jQuery', 'AppContext'],
function($, AppContext) {
var BingRecordFull = {
init : function(div, config){
this.div = div;
this.config = config;
this.dongtai = $('div.dongtai', this.div).hide();
var self = this;
$.use('util-date');
this.getOrder(function(){
self.initScroll();
self.initMemberStatus();
self.dongtai.show();
});
},
_getBuyOffer: function(){
var obj = {};
if($('#buyOffer', this.div).length>0){
obj.orderScrollOut = 'order-scroll-out';
obj.slideInner = 'slide-inner';
obj.size = $('#buyOffer').attr('data-size');
} else {
obj.orderScrollOut = 'order-scroll-out2';
obj.slideInner = 'slide-inner2';
obj.size = 0;
}
return obj;
},
_processData: function(data, callback){
var buyOfferData = this._getBuyOffer();
var html ='';
var orders = data.data.orders;
for(var i= 0, l=orders.length; i
'+
''+
'
�ɹ�����
'+
'
'+time+'
'+
'
'+
'���� '+place+' �IJɹ����Ѹ���' +
'
'+obj.productName+'
'+
'
'+
''
}
var newHtml = '
';
var getMemberInfo = $('#getMemberInfo',this.div);
if (buyOfferData.size>0){
getMemberInfo.prepend($('
'))
}
getMemberInfo.prepend($(newHtml)).attr('size', orders.length + ' | ' +buyOfferData.size);
$('#buyOffer',this.div).addClass('buyOffer-scroll-out').children('div').first().addClass('slide-inner');
callback();
},
_showNoOrders: function(callback){
var buyOfferData = this._getBuyOffer();
if (buyOfferData.size == 0){
this.dongtai.parent().html('
���ӵ���̬����
');
} else {
$('#getMemberInfo',this.div).attr('size', '0 | ' +buyOfferData.size);
$('#buyOffer',this.div).addClass('buyOffer-scroll-out2').children('div').first().addClass('slide-inner2');
callback();
}
},
getOrder: function(callback){
var self = this;
var gapDays = 90;
var today = new Date();
var endDay = new Date(+today + 24*3600*1000),
startDay = new Date(+endDay - 24*3600*1000*gapDays);
var uid = this.dongtai.attr('data-uid');
var endTime = +endDay, startTime = +startDay;
var xhr = $.ajax({
type: 'GET',
url: self.config.getTradeSellerOrderAjaxUrl,
dataType: 'jsonp',
cache: false,
data: {
status: 'SUCCESS',
payStartTime: startTime,
payEndTime: endTime,
loginId: encodeURIComponent(uid)
},
timeout: 3000
});
xhr.done(function(data){
if (data && data.success && data.data.orders){
self._processData(data, callback);
} else {
self._showNoOrders(callback);
}
});
xhr.fail(function(jqXhr,status,error){
self._showNoOrders(callback)
});
},
initScroll:function () {
var self = this;
var orderSize = self.div.find("#order").attr("data-size");
var buyOfferSize = self.div.find("#buyOffer").attr("data-size");
$.use('ui-tabs-effect', function(){
var orderDom = self.div.find('.order-scroll-out');
var orderDom2 = self.div.find('.order-scroll-out2');
var buyOfferDom = self.div.find('.buyOffer-scroll-out');
var buyOfferDom2 = self.div.find('.buyOffer-scroll-out2');
if(orderDom.length > 0 && orderSize && orderSize > 3) {
self.scroll3(orderDom);
}
if(orderDom2.length > 0 && orderSize && orderSize > 7) {
self.scroll6(orderDom2);
}
if(buyOfferDom.length > 0 &&buyOfferSize && buyOfferSize > 3) {
self.scroll3(buyOfferDom);
}
if(buyOfferDom2.length > 0 &&buyOfferSize && buyOfferSize > 7) {
self.scroll6(buyOfferDom2);
}
});
},
scroll3 : function(dom) {
if(dom) {
dom.tabs({
isAutoPlay:true,
boxSelector:".slide-y .ulist",
effect:'scroll',
scrollType:'loop',
perItem:3,
direction:'up'
});
}
},
scroll6 : function(dom) {
if(dom) {
dom.tabs({
isAutoPlay:true,
boxSelector:".slide-y .ulist",
effect:'scroll',
scrollType:'loop',
perItem:7,
direction:'up'
});
}
},
distinct:function(arrObj){
var arr = [],
len = arrObj.length;
for ( var i = 0; i < len; i++ ){
for( var j = i+1; j < len; j++ ){
if( arrObj[i] === arrObj[j] ){
j = ++i;
}
}
arr.push( arrObj[i] );
}
return arr;
},
initMemberStatus: function() {
var self = this;
var ulists = self.div.find(".ulist");
var ids = [];
ulists.each(function(k,v){
if($(v).data("vaccountids")){
ids.push($(v).data("vaccountids"))
}
});
ids = self.distinct(ids);
var data = {"vaccountIds":ids.toString()};
// $.ajax({
// url: self.config.buyerStatusListAjaxUrl,
// data:data,
// dataType:"jsonp",
// success: function(o) {
// if(o.success){
// $(o.data.BuyerStatusList).each(function(k,v){
// var dom = self.div.find('.vac_'+v.vaccountId);
// dom.each(function(a,b){
// $(b).find(".td3").append(self.createLogos(v));
// });
//
// });
// }else{
// }
// }
// });
},
createLogos:function(v){
var html = '';
if(v.isVip){
html = html+ '
'
}else if(v.isTp){
html = html+ '
'
}else if(v.isTmall){
html = html+ '
'
}else if(v.isTaobao){
html = html+ '
'
}
if(v.ov){
html = html+ '
'
}else if(v.av){
html = html+ '
'
}else if(v.cna){
html = html+ '
'
}else if(v.pna){
html = html+ '
'
}
return html;
}
};
AppContext.register('view', 'bingRecordFull', BingRecordFull);
});
/**
* Created by liying.ly@alibaba-inc.com on 14-9-24.
*/
define(['jquery','fui/timer/1.0','AppContext'],function($,Timer,AppContext){
AppContext.register('view','industryDHOffer',function(app){
var app = $('.app-industryDHOffer',app),
countdown = $('#app-industryDHOffer-timer'),
overTime = parseInt( countdown.data('time'));
var timer = new Timer({
to: new Date(overTime),
useServerTime:true,
el: '#app-industryDHOffer-timer'
});
var tabCont = $('.offer-container',app),
tabScreen = $('.offer-screen',app),
tabControl = $('.offer-control',tabCont),
tabItems = $('.offer-item',tabControl),
offset = tabItems.outerWidth(true),
tabNext = $('.next',tabCont),
tabPrev = $('.prev',tabCont),
itemsLength = tabItems.length,
screenNu = 3,
totalWidth = 0,
index = 0;
function listInit(){
var w = 0;
tabNext.show();
tabPrev.show();
$('ul',tabControl).append($('ul',tabControl).html())
for(var i = 0 ;i
=itemsLength){
tabScreen.stop().animate({
'scrollLeft':offset*index+'px'
},function(){
index = 0;
tabScreen.scrollLeft(0);
});
}else{
tabScreen.stop().animate({
'scrollLeft':offset*index+'px'
});
}
}
function doNext(e){
e.preventDefault();
index++;
animate();
}
function doPrev(e){
e.preventDefault();
index--;
animate();
}
var init = function(){
if(itemsLength>screenNu){
listInit();
tabNext.on('click',doNext);
tabPrev.on('click',doPrev);
}
}();
});
});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/20220421073705/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/20220421073705/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/20220421073705/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/20220421073705/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/20220421073705/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/20220421073705/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);
});
/**
* @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', '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/20220421073705/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20220421073705/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);
});
/**
* ��˾��̬
* @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', 'AppContext', 'Class'], function($, AppContext, Class) {
var View = new Class({
/**
* @param {jquery} mod ��Ҫ��ʼ���İ��ڵ�
* @param {object} config ������ viewConfig�еIJ���
* @param {object} appdata ��� viewConfig.showReulst=true, ���������ȡ��appdata�� ����Ϊundefined
*/
init: function(mod, config, appdata) {
var contents=$('div.tab-content',mod);
if(contents.length>1){
$.use('ui-tabs',function(){
mod.tabs({
'isAutoPlay':true,
'timeDelay':4,
'currentClass':'active',
'titleSelector':'ul.tab-index li',
'boxSelector':'div.tab-content'
});
});
}
}
});
AppContext.register('view', 'overAmountFreeShippingBig', View);
});define(["jQuery","AppContext","part.SiteAlitalk2"],function(i,e){var t={init:function(){}};e.register("view","supplierInfoSmall",t)});/**
* @fileoverview ��ͨ��Ӧ����Ϣ��飨���š�����ͨ�����ƹ�Ӧ�̣�
*
* @author qijun.weiqj
* @update by jun.qij on 2011.12.12
* @update by peng.gongp on 2012.2.21
* @update by yefei.niuyf on 2012.5.29
* @update by haiwei.shw on 2015.8.11
*/
define(['jQuery', 'AppContext', 'part.SiteAlitalk', 'widget.FloatPanel', 'require'],
function($, AppContext, SiteAlitalk, FloatPanel, require) {
var SupplierInfo = {
init: function(div, config) {
this.div = div;
this.config = config;
this._initParts();
},
/**
* ��ʼ������tips
*/
initTips: function(root, handler, panel) {
root = $(root, this.div);
if (!root.length) {
return;
}
handler = $(handler, root);
panel = $(panel || 'div.common-tips', root);
new FloatPanel(panel, {
handler: handler,
event: 'mouseenter',
autoClose: 300
});
},
_parts: [
'CompanyName',
'CertifyItems',
'SatRate',
'TradeMedal',
'SupplyGrade',
'BizType',
// 'CollectWinport'
],
_initParts: function() {
var div = this.div,
config = this.config;
var o = {
div: div,
config: config,
fragment: this.fragment,
initTips: $.proxy(this, 'initTips')
};
$.each(this._parts, function(index, name) {
require('app.common_supplierInfoSmall.' + name, function(Part) {
$.extend(Part, o);
Part.init(div, config);
});
});
}
};
//~ SupplierInfo
AppContext.register('view', 'common_supplierInfoSmall', SupplierInfo);
});/**
* @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/20220421073705/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);
});*/
});/*
* JS �ļ�
* �� radiance_init ����
* ��� http://web.npm.alibaba-inc.com/package/@ali/radiance_init
*/
define(['jQuery', 'Log', 'core.Remote', 'core.Component', 'core.StyleLoader', 'core.AppUtil'], function($, Log, Remote, Component, StyleLoader,
AppUtil) {
var log = new Log('core.AppLoader');
var fragmentUrl = Component.getGlobalViewConfig('fragmentUrl');
fragmentUrl = fragmentUrl || '/fragment/index.htm';
if(fragmentUrl.indexOf("apps.1688.com")==-1&&fragmentUrl.indexOf("design.1688.com")==-1){
fragmentUrl=fragmentUrl+"?_server_name={serverName}";
}
/**
* �ӿ�������Ϣ
*/
$.extend(Remote.config, {
'app.load3': {
url: fragmentUrl,
type: 'get',
dataType: 'jsonp',
pageAware: true
}
});
var Loader = {
/*
* ������
* 1. ������(����box)��regionָ��index
* 2. �����ָ��region, ���������
* @param {object}
* - region {jquery} �����鵽������, �����ָ��������ŵ���������
* - index {number} �����鵽region��λ��, ��ѡ
* - appName {string}
* - appKey {string}
* - appStyles {array} app��ʽ��Ϣ, ����appǰ����Ҫ������ʽ��JS
*/
load: function(options) {
this.request($.extendIf({
appName: options.appName,
success: function(app, box, html) {
// �ȵ���success����Ϊ��success�У�Ҫ��app�ŵ�ҳ���к�ų�ʼ��app
options.success && options.success(app, box, html);
}
}, options));
},
/**
* ����һ�����
* @param {object}
* - appName {string}
* - appKey {string}
*
* - appStyles
*
* - success {function(app, box, html)}
* - error
*/
request: function(options) {
var self = this,
appdata = options.appdata;
if (appdata && $.isPlainObject(appdata)) {
appdata = JSON.stringify(appdata);
}
return Remote.call('app.load3', $.extendIf({
data: $.extend({
site_id: Component.getSiteId(),
apps: JSON.stringify([{
appName: options.appName,
app_key: options.appKey,
mode:options.mode,
appdata: appdata
}]),
is_diy: Component.getUserContext().diy
}, options.data),
success: $.proxy(this, '_requestSuccess', options, null)
}, options));
},
_requestSuccess: function(options, defer, html) {
options.success(html);
return;
}
};
$(function(){
var container = $(".trade-medal-container");
var params=$(".trade-medal-async");
Loader.load({
appName: 'winport_components',
mode: 'trademedal',
serverName:params.attr("data-currentDomainUrl")?params.attr("data-currentDomainUrl"):params.attr("currentDomainUrl"),
data: {
"type": params.attr("data-type")
},
csrf_token: true,
success: function (html) {
if(html.isSuccess && html.result[0].html!=""){
container[0].outerHTML=html.result[0].html;
}
}
});
})
});
define(["jquery","core.Remote","util.Util","widget.Dialog","lofty/alicn/aliuser/1.0/aliuser","AppContext","core.Component"],function(e,t,i,s,r,a,n){var o={init:function(e,t){void 0==window.isGetBsrFlag&&(window.isGetBsrFlag=!1),this.div=e,this.config=t,window.isGetBsrFlag||this.showBsr()},showBsr:function(){if(!window.isGetBsrFlag){window.isGetBsrFlag=!0;var i=this,s=n.getGlobalViewConfig("eventUrl"),r=e(".app-industry_topbar"),a=e(".no-winport-search-wp-btn");if(s||a.length){if(a.length)s+="/event/app/winport_bsr/getBsrData.htm?memberId="+i.config.memberId+"&site_id=winport";else if(r.length){var o=i.config.industryEventUrl;s=o}else{var c=e("#content").data("viewConfig").domainUrl;s+="/event/app/winport_bsr/getBsrData.htm?_server_name="+c}e.ajax(s,{dataType:"jsonp",success:function(e){e&&e.isSuccess&&i.compBsr(e)},error:function(){}})}else t.call(i.config.currentDomainUrl+"/event/app/winport_bsr/getBsrData.htm",{pageAware:!0,csrfToken:!0,type:"post",success:function(e){e&&e.isSuccess&&i.compBsr(e.result)},error:function(){}})}},compBsr:function(t){var i=-1,s=0;if(t&&t.bsrDataList){var r=t.bsrDataList;if(r&&r.length>0)for(var a=0;a 0) {
var o = {
div: div,
config: config,
fragment: self.fragment,
initTips: $.proxy(self, 'initTips')
};
require('app.common_supplierInfoSmall.HonorFeature', function(Part) {
$.extend(Part, o);
Part.init(div, config);
});
}
});
},
initName: function(){
var self = this;
var nameContainer=$('.nameArea', this.div),
name = $('.name',this.div);
name.text(this.stringCut(name.text(), nameContainer)); // ֧�ֶ��нض�
},
stringCut: function(str, c){
if(!str){
return;
}
if(!this.el){
this.el = $('').appendTo(document.body);
}
var ret, i = 1, l = str.length, c=$(c);
this.el.css({
position: "absolute",
top: 0,
visibility: "hidden",
width: c.width(),
fontFamily: c.css("fontFamily"),
fontSize: c.css("fontSize"),
lineHeight : c.css("lineHeight"),
wordBreak: "break-all"
});
while (i <= l) {
this.el.text( ret = str.substring(0, i++) );
if (this.el.height() > parseInt(c.css("max-height"))) {
return ret.replace(/..$/, '...');
}
}
}
};
return CompanyName;
});/**
* ��Ʒ������
*/
define('app.common_supplierInfoSmall.SatRate', ['jQuery'], function($) {
return {
init: function() {
var self = this,
root = $('div.sat-rate', this.div),
url = this.config.satisfactionTradeUrl;
if (!root.length || !url) {
return;
}
$.ajax(url, {
data: {
memberId: this.config.context.uid,
sati:1
},
dataType: 'jsonp',
success: function(ret) {
ret.success && self.success(root, ret.data);
}
});
},
success: function(root, data) {
var span = $('a.rate-value', root),
rate = parseFloat(data.sati.satisfaction);
if (rate <= 0) {
span.replaceWith('
-----');
return;
}
rate && span.text(rate);
root.show();
}
};
//~ SatRate
});
/**
* trade-medal ����ѫ��
*/
define('app.common_supplierInfoSmall.TradeMedal', ['jQuery'], function($){
var TradeMedal = {
init: function(){
/**
* init tips
*/
this.initTips('.item.trade-medal', 'a.image');
}
}
return TradeMedal;
});/**
* supply-grade ��Ӧ�ȼ�
*/
define('app.common_supplierInfoSmall.SupplyGrade', ['jQuery'], function($){
var SupplyGrade = {
init: function(){
/**
* init tips of ����ѫ��
*/
this.initTips('.item.supply-grade', 'a.image');
}
}
return SupplyGrade;
});/**
* ��Ӧ����Ϣ�����������
*/
define('app.common_supplierInfoSmall.HonorFeature', ['jQuery', 'core.Remote'], function($, Remote) {
return {
init: function(div, config) {
var self = this,
honorFeature = $('dl.honorfeature', this.div);
if(honorFeature.length <= 0) return;
// Remote.callEvent('common_supplierInfoSmall', 'getHonors', {
// success: function(o) {
// var result = o.result;
// if (result.success && result.memberMedalList && result.memberMedalList.length > 0) {
// self.render(honorFeature, result.memberMedalList);
// } else {
// honorFeature.remove();
// }
// },
// error: function() {
// honorFeature.remove();
// }
// });
jQuery.ajax({
url: '//web.archive.org/web/20220421073705/http://apps.1688.com/event/app/common_supplierInfoSmall/getHonors.htm',
dataType: 'jsonp',
data: {
site_id: config.context.siteId,
memberId: config.context.uid,
site_key: config.context.siteKey,
page_type: config.context.pageType,
_csrf_token: config.context.csrfToken || (iDetailConfig && iDetailConfig._csrf_token)
},
success: function(result) {
if (result.success && result.memberMedalList && result.memberMedalList.length > 0) {
self.render(honorFeature, result.memberMedalList);
} else {
honorFeature.remove();
}
},
error: function() {
honorFeature.remove();
}
})
},
notEmpty: function(o) {
if (o) {
for (var k in o) {
return true;
}
}
return false
},
render: function(honorFeature, data) {
var self = this,
ul = $('ul', honorFeature),
template = '
{name}',
count = 0,
parts = null;
parts = $.map(data, function(item) {
var info = self.map[item.medalCode];
if (!info) {
return;
}
count++;
return $.util.substitute(template, {
type: info.type,
targetUrl: info.targetUrl,
name: info.name
});
});
if(parts != null && parts.length > 0) {
ul.append(parts.join(''));
honorFeature.closest('div.company-name').addClass('honor-count-' + count);
honorFeature.show();
} else {
honorFeature.remove();
}
},
map: {
// ����ͨ������
'CXT_START': {
name: '������',
type: 'honor-sponsor',
targetUrl: '//web.archive.org/web/20220421073705/http://view.1688.com/cms/company/winport/icon_introduce.html#winprot-trust1'
},
// ����ͨ�ռ��淢����
'CXT_NORMAL_START': {
name: '������',
type: 'honor-sponsor-popular',
targetUrl: '//web.archive.org/web/20220421073705/http://view.1688.com/cms/company/winport/icon_introduce.html#winprot-trust2'
},
// ��ҵ�ȷ�
'UNDERTAKING_PIONEER': {
name: '��ҵ�ȷ�',
type: 'honor-syb',
targetUrl: '//web.archive.org/web/20220421073705/http://view.1688.com/cms/company/winport/icon_introduce.html#winprot-chuangye'
}
}
};
});
/**
* certify-items ��֤��Ϣ����
*/
define('app.common_supplierInfoSmall.CertifyItems', ['jQuery'], function($) {
var CertifyItems = {
init: function() {
if (this.fragment) {
this.fragment('certify-items', $.proxy(this, '_init'));
} else {
this._init();
}
},
_init: function() {
/**
* ���ƹ�Ӧ��
*/
this.initTips('.item.goldsupplier', '.icon');
/**
* ��ұ���
*/
this.initTips('.item.promise', '.icon');
/**
* ��֤��Ϣ
*/
this.initTips('.item.auth', '.icon');
}
};
return CertifyItems;
});
/**
* վ������
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.InstantValidator', 'widget.PlaceHolder'],
function($, AppContext, InstantValidator, PlaceHolder) {
var SearchInSite = {
init: function(div) {
this.div = div;
this.initPriceInput();
this.searchText = $('div.search-text input', div);
new PlaceHolder(this.searchText, { placeholder: '�������Ʒ����' })
this.initSubmit();
},
/**
* ���Ƽ۸������
*/
initPriceInput: function() {
var inputs = $('input.price-low,input.price-high', this.div);
new InstantValidator(inputs, 'price');
},
initSubmit:function(){
$("input.search-btn-big").on("click",function(){
var submitCotent = $("input.search-keywords-big").val().trim();
if (submitCotent == "�������Ʒ����" || submitCotent == "") {
$("input.search-keywords-big").val("");
}else {
$("input.search-keywords-big").val(submitCotent.replace('%',''));
}
});
}
}
//~
AppContext.register('view', 'searchInSite', SearchInSite);
});define([ 'jQuery', 'AppContext', 'widget.UI' ], function($, AppContext, UI) {
var CategorySmallView = ({
init : function(div, config, data) {
this.div = div;
this.resizeImages();
this.initCats();
this.initCollapse();
},
/**
* ����ͼƬ�������>150��Ҫ��С
*/
resizeImages : function() {
var imgs = $('li a img', this.div);
UI.resizeImage(imgs, {
width : 150
});
},
/**
* ��ʼ����Ŀ��״�ṹ
*/
initCats : function() {
var self = this, root = $('ul:first>li', this.div);
// ����Ŀ
root.eq(-1).addClass('last-cat');
root.each(function() {
var elm = $(this), lis = $('li', elm);
if (!lis.length) {
return;
}
elm.addClass('expand');
lis.eq(-1).addClass('last');
});
},
initCollapse : function() {
$(this.div).delegate('.expand', 'click', function(event) {
$(this).children('.cat-hd').toggleClass('collapse');
$(this).children('.cat-bd').toggle();
if($('.shop-category>div.bd>ul',CategorySmallView.div).attr('class') == "vas"){
if(!$(this).children('.cat-hd').hasClass('collapse')){
$(this).children('.cat-hd').css({
'background-position':'0 -28px'
});
}else{
$(this).children('.cat-hd').css({
'background-position':'0 0'
});
}
}
});
$(this.div).delegate('.cat a', 'click', function(event) {
event.stopPropagation();
return true;
});
}
});
AppContext.register('view', 'categorySmall', CategorySmallView);
});
define([ 'jQuery', 'AppContext', 'Class'], function($, AppContext, Class) {
var CategorySmallView = new Class({
init : function(div, config, data) {
this.div = div;
this.config = config;
//�����װ��̨�������ظ���Ч��
if(!config.context.diy){
this.showSubCategory();
}
},
//����������Ŀ
showSubCategory:function(){
var self = this;
var firstCategory = $('li.sec', self.div);
//������һ����Ŀչʾ������Ŀ����
self.div.on('mouseenter','li.sec', function(){
var className = $(this).data("index");
if(self.subCategory && self.subCategory.length > 0){
self.subCategory.css("display","none");
}
var position = $(this).position();
var subSize = $("input[name=subSize]",$(this)).val();
var left = position.left + 189;
self.hoverClass = "rhover";
if(self.div.is('div.layout-m0s5 .grid-sub div.mod') || self.div.is('div.layout-s5m0s5 .grid-extra div.mod')){
//������ң�����߸���
if(subSize > 10){
left = position.left - 402;
} else{
left = position.left - 202;
}
self.hoverClass = "lhover";
}else{
//����������ұ߸���
}
if(!$(this).hasClass(self.hoverClass)){
$(this).addClass(self.hoverClass);
}
self.subCategory = $("div." + className, self.div).css({
'display':'block',
'left':left,
'top':position.top + 1
});
self.subCategory.bind('mouseleave', function(){
$(this).css("display","none");
firstCategory.removeClass(self.hoverClass);
});
});
//����뿪һ����Ŀ���ض�����Ŀ����
self.div.on('mouseleave','li.sec', function(){
var handler = this;
var className = $(this).attr("data-index");
self.timeOut = setTimeout(function(){
$("div." + className, self.containerDiv).css("display","none");
//�˳�һ����Ŀȥ��hoverЧ��
$(handler).removeClass(self.hoverClass);
},20);
//��һ����Ŀ���������Ŀ����ʱ�����ֶ�����Ŀ���㲻����
self.subCategory.bind('mouseenter', function(){
clearTimeout(self.timeOut);
});
});
}
});
AppContext.register('view.emersion', 'categorySmall', CategorySmallView);
});
define(['jQuery', 'AppContext', 'widget.UI'], function($, AppContext, UI) {
var SalesRankingSmall = ({
init:function(div, config, data){
this.div = div;
if (!config.context.diy) {
var ele = $('input.offer-count-hidden-side', div);
var offerCount = ele.val();
if(offerCount > 0){
this.showSalesRankingSmall(div, config, data);
}
}else{
this.showSalesRankingSmall(div, config, data);
}
this.handleBigImage(div);
$(function() {
UI.resizeImage($('div.image img', div), 40);
UI.resizeImage($('div.big-image img', div), 100);
});
},
handleBigImage: function(div) {
var getBigImage = function(elm) {
var wrap = $(elm).closest('div.image-wrap');
return $('div.big-image', wrap);
};
var timer = null;
$('div.image img', this.div).on('mouseenter', function() {
var big = getBigImage(this);
timer && clearTimeout(timer);
timer = setTimeout(function() {
big.removeClass('fd-hide');
}, 200);
});
$('div.image img', this.div).on('mouseleave', function() {
timer && clearTimeout(timer);
var big = getBigImage(this);
big.addClass('fd-hide');
});
},
showSalesRankingSmall : function(div, config, data){
if($.util.ua.ie67){
div.css("display", "block").nextAll("div.mod");
div.each(function() {
var _elm = $(this);
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
});
}
div.css("display", "block");
}
});
AppContext.register('view', 'salesRankingSmall', SalesRankingSmall);
});
}
/*
FILE ARCHIVED ON 07:37:05 Apr 21, 2022 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 16:36:59 Nov 18, 2023.
JAVASCRIPT APPENDED BY WAYBACK MACHINE, COPYRIGHT INTERNET ARCHIVE.
ALL OTHER CONTENT MAY ALSO BE PROTECTED BY COPYRIGHT (17 U.S.C.
SECTION 108(a)(3)).
*/
/*
playback timings (ms):
captures_list: 307.281
exclusion.robots: 0.142
exclusion.robots.policy: 0.131
cdx.remote: 0.07
esindex: 0.01
LoadShardBlock: 184.467 (3)
PetaboxLoader3.datanode: 116.738 (4)
load_resource: 548.794
PetaboxLoader3.resolve: 446.731
*/