").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/20220125223106/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/20220125223106/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/20220125223106/http://astyle.alicdn.com/fdevlib/js/lofty/util/messageproxy/1.0/messageproxy.js",function(){i.getScript("https://web.archive.org/web/20220125223106/http://astyle.alicdn.com/sys/js/purchaselist/v1/core.js",function(){i.getScript("https://web.archive.org/web/20220125223106/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(["jQuery","AppContext","widget.Util","widget.UI","util.SlsLogger"],function(e,i,t,o,a){var n={renderAStoreShopSign:function(){jQuery(".app-shopSigns").width("100%");var e="wp_pc_common_shopsign",i="astore-shopsign",t=window.__astorePageData__||jQuery(".app-topbar").data("viewConfig").astorePageData;window.__oldPcWeb__&&window.__oldPcWeb__.renderModule&&window.__oldPcWeb__.renderModule(i,e,t)},init:function(i,t){if(t.useAStorePageData)return void this.renderAStoreShopSign();this.view=i;var n=e("div.logo img",i);o.resizeImage(n,80),this.initFlash(),a.setConfig({shopId:t.memberId,userNick:t.userLoginId}),a.log("shopSignsInfo",{templateName:t.templateName,isImall:t.isImall})},initFlash:function(){var i=this.view,t=e(".adv .flash",i),o=t.data("url");o&&e.use("ui-flash",function(){t.flash({swf:o,wmode:"transparent",width:952,height:t.data("height")})})}};i.register("view","shopSigns",n)});/**
* ��Ʒ���ม��
* @author zengpan.zhengzp
*/
define(['jQuery', 'AppContext', 'widget.FloatPanel', 'lofty/util/template/2.0/template'], function ($, AppContext, FloatPanel, Template) {
var BrandCategory = {
init: function (div, config, data) {
this.resizeTopNav();
if (config.context.diy) {
$('#topnav').on('click', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
$('#topnav').on('mouseenter', 'a', function (e) {
e.stopPropagation();
e.preventDefault();
})
return;
}
this.log('start');
this.renderUtil = null;
this.fullCategory = [];
this.winportUserId = config.userId;
this.initHtmlCompiler();
this.hasShowCategory = false;
this.loadMtop(this.initTarget);
},
resizeTopNav: function () {
jQuery('.segment-box').first().addClass('segment-box-fluid')
},
loadFirstCategory: function (cb) {
BrandCategory.fetchChildrenCategory(
{
winportUserId: BrandCategory.winportUserId,
parentGroupId: '-1'
},
function (res) {
BrandCategory.fullCategory = res.category || [];
cb && cb();
});
},
loadMtop: function (cb) {
$.getScript('//web.archive.org/web/20220125223106/http://g.alicdn.com/mtb/lib-mtop/2.5.8/mtop.js', function () {
cb && cb();
});
},
initTarget: function () {
$('a.allSpuList').on('mouseenter', function (e) {
if (BrandCategory.hasShowCategory) {
return;
}
BrandCategory.hasShowCategory = true;
e && (e.preventDefault(), e.stopPropagation());
BrandCategory.loadFirstCategory(function () {
var covertedData = BrandCategory.convertToRenderData(BrandCategory.fullCategory || []);
var renderData = {
firstCategory: covertedData,
secondCategory: [],
thirdCategory: [],
firstIndex: -1,
secondIndex: -1,
};
BrandCategory.render('.brand-first-category', BrandCategory.renderUtil.firstHtmlRender, renderData);
})
})
},
log: function (str) {
console.log('---topNav---', str);
},
logTree: function (list, tab) {
function logTree(list, tab) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(tab + cur.groupId);
if (cur.children && cur.children.length > 0) {
logTree(cur.children, tab + '--')
}
}
}
logTree(list, tab);
},
fetchChildrenCategory: function (params, cb) {
lib.mtop.config.prefix = 'h5api'
lib.mtop.config.mainDomain = '1688.com'
lib.mtop.config.subDomain = 'm';
lib.mtop.request({
api: 'mtop.1688.imall.itemdigital.productgroup.listChildGroup', // 必须
v: '1.0',
data: params,
ecode: 0,
type: 'GET',
dataType: 'jsonp',
timeout: 20000,
},
function (result) {
cb({
parentGroupId: params.parentGroupId,
category: (result.data && result.data.result) || []
});
})
},
checkChildren: function (fullCategory, parentId, cb) {
function addChildrenToTree(list, parentId, children) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var curItem = list[i];
var groupId = curItem.groupId;
if (groupId === parentId) {
curItem.children = children;
return list;
}
if (curItem.children && curItem.children.length > 0) {
addChildrenToTree(curItem.children, parentId, children);
}
}
return list;
}
function findNode(list, id) {
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
console.log(cur.groupId);
if (cur.groupId === id) {
return cur;
}
if (cur.children && cur.children.length > 0) {
var res = findNode(cur.children, id);
if (res) {
return res;
}
}
}
return null;
}
var parent = findNode(fullCategory, parentId);
if (!parent) {
return;
}
if (parent.children && parent.children.length > 0) {
cb(fullCategory);
return;
}
this.fetchChildrenCategory(
{
winportUserId: this.winportUserId,
parentGroupId: parentId
},
function (res) {
var parentGroupId = res.parentGroupId;
var category = res.category;
var newCategory = addChildrenToTree(fullCategory, parentGroupId, category);
cb(newCategory);
}
);
},
convertToRenderData: function (fullCategory) {
function genDataConvert() {
return function (item) {
item = item || {};
var groupId = item.groupId;
var groupName = item.groupName;
var leafNode = item.leafNode;
var res = {
groupId: groupId,
title: groupName,
leafNode: (leafNode + '') === 'true',
};
if (!leafNode) {
res.children = [];
}
return res;
}
}
function recursive(list, dataConvert) {
var newList = [];
if (!list) {
return [];
}
for (var i = 0, len = list.length; i < len; i++) {
var newItem = dataConvert(list[i]);
if (list[i].children && list[i].children.length > 0) {
newItem.children = recursive(list[i].children, dataConvert);
}
newList.push(newItem);
}
return newList;
}
function resetLink(list, level, parentId) {
list = list || [];
for (var i = 0, len = list.length; i < len; i++) {
var cur = list[i];
if (cur.leafNode) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
} else {
if (level === 1) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(cur.groupId);
}
if (level === 2) {
cur.link = '/page/allSpuList.html?groupId=' + encodeURIComponent(parentId) + '&twoCateId=' + encodeURIComponent(cur.groupId);
}
if (level === 3) {
cur.link = '/page/spuDetail.html?groupId=' + encodeURIComponent(cur.groupId);
}
}
if (cur.children && cur.children.length > 0) {
resetLink(cur.children, level + 1, cur.groupId);
}
}
return list;
}
var covertedData = recursive(fullCategory, genDataConvert());
return resetLink(covertedData, 1, -1);
},
initHtmlCompiler: function () {
var firstCategory = "\
\
\
\
{{if firstCategory && firstCategory.length > 0}}\
\
{{/if}}\
\
";
var secondCategory = "\
\
{{if secondCategory && secondCategory.length > 0}}\
\
{{selectedFirstCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
\
";
var thirdCategory = "\
{{if thirdCategory && thirdCategory.length > 0}}\
\
{{selectedSecondCat.title}}
\
�鿴ȫ�� >
\
\
\
{{/if}}\
";
this.renderUtil = {
firstHtmlRender: Template.compile(firstCategory),
secondHtmlRender: Template.compile(secondCategory),
thirdHtmlRender: Template.compile(thirdCategory),
};
},
bindCategoryClickEvent: function (html) {
if (!html) {
return;
}
function genthrottling(func, time) {
var timer = null;
var valid = true;
return {
enter: function (e) {
if (!valid) {
return;
}
valid = false;
if (timer) {
clearTimeout(timer);
}
timer = setTimeout(function () {
valid = true;
func(e);
}, time);
},
leave: function (e) {
clearTimeout(timer);
valid = true;
},
}
}
var _this = this;
function eventHandler(e) {
e && (e.preventDefault(), e.stopPropagation());
var groupId = e.target.getAttribute('group-id');
var leafNode = e.target.getAttribute('leaf-node') === 'true';
var level = e.target.getAttribute('category-level');
var firstIndex = e.target.getAttribute('first-index');
var secondIndex = e.target.getAttribute('second-index');
var arrayIndex = e.target.getAttribute('array-index');
if (leafNode && level === '0') {
_this.clear('.brand-second-category');
_this.clear('.brand-third-category');
return
}
if (leafNode && level === '1') {
_this.clear('.brand-third-category');
return
}
if (level === '0' && arrayIndex === firstIndex) {
return
}
if (level === '1' && arrayIndex === secondIndex) {
return
}
_this.checkChildren(
_this.fullCategory,
groupId,
function (newCategory) {
var coverted = _this.convertToRenderData(newCategory);
var renderData = {
firstCategory: coverted,
secondCategory: [],
thirdCategory: [],
};
if (level === '0') {
renderData.firstIndex = arrayIndex;
renderData.selectedFirstCat = coverted[arrayIndex];
renderData.selectedSecondCat = null;
renderData.secondIndex = null;
renderData.secondCategory = coverted[arrayIndex].children;
renderData.thirdCategory = [];
_this.render('.brand-second-category', _this.renderUtil.secondHtmlRender, renderData);
_this.clear('.brand-third-category');
}
if (level === '1') {
renderData.firstIndex = firstIndex;
renderData.secondIndex = arrayIndex;
renderData.secondCategory = coverted[firstIndex].children;
renderData.selectedSecondCat = renderData.secondCategory[arrayIndex];
renderData.thirdCategory = coverted[firstIndex].children[arrayIndex].children;
_this.render('.brand-third-category', _this.renderUtil.thirdHtmlRender, renderData);
}
});
}
var headlers = genthrottling(eventHandler, 300);
html.on('mouseenter', '.category-item-title', headlers.enter);
html.on('mouseleave', '.category-item-title', headlers.leave);
},
bindCloseButtonClickEvent: function (html) {
if (!html) {
return;
}
var _this = this;
html.on('click', '.close-button', function (e) {
_this.hasShowCategory = false;
e && (e.preventDefault(), e.stopPropagation());
$('.brand-first-category').empty();
$('.brand-second-category').empty();
$('.brand-third-category').empty();
})
},
render: function (containerId, compiler, renderData) {
var htmlStr = compiler(renderData);
var html = $(htmlStr);
this.bindCategoryClickEvent(html);
if (containerId === '.brand-first-category') {
this.bindCloseButtonClickEvent(html);
}
var contain = $(containerId);
contain.empty().append(html);
},
clear: function (containerId) {
var contain = $(containerId);
contain.empty();
}
};
var OfferCategory = {
renderAStorePageTopNav: function () {
jQuery('.app-topNav').width('100%');
var moduleName = 'wp_pc_common_topnav';
var containNode = 'astore-topnav';
var pageData = window.__astorePageData__ || jQuery('.app-topbar').data('viewConfig').astorePageData;
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, pageData);
},
init: function (div, config, data) {
if (config.useAStorePageData) {
this.renderAStorePageTopNav();
return;
}
if (config.brandPlusTopNav) {
BrandCategory.init(div, config, data);
return;
}
this.pageSize = 10;
this.config = config;
this.div = div;
this.handler = $('a.show-category', div);
this.supHandler = $('.other-cat-link', div);
this.bindEvent();
this.pageGoldClick();
// �������Ŀ��������ʾ
this.bindOtherCatState();
// �������Ŀ����������ҳʱ����Ĭ����ʾ
this.checkNavPosition();
},
bindEvent: function () {
var self = this;
this.handler.one('mouseenter', function () {
self.showCategoryDiv();
});
},
bindOtherCatState: function () {
var self = this;
if (self.config.context.diy !== 'true') {
this.supHandler.on('mouseenter', function () {
self.showOtherCatDiv();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
self.hideOtherCatDiv();
// self.supHandler.removeClass('active');
});
}
},
checkNavPosition: function () {
var self = this;
if (self.config.isDiy !== 'true' && self.config.nowPageName === 'index') {
// self.supHandler.addClass('active')
self.showOtherCatDiv();
}
},
pageGoldClick: function () {
$('.top-nav-bar-box li').click(function () {
var page_id;
var pageName = $(this).data('page-name');
if (window.dmtrack_pageid) {
page_id = dmtrack_pageid;
}
if (window.goldlog) {
goldlog.record('/1688-winport-element.click.shopclick', 'CLK', 'click_type=page' + '&page_type=' + pageName + '&page_id=' + page_id, 'H1511971673');
}
});
},
//����������Ŀ
showSubCategory: function () {
var self = this;
firCategory = $('li.sec', self.containerDiv);
//������һ����Ŀչʾ������Ŀ����
self.containerDiv.on('mouseenter', 'li.sec', function () {
//��һ����Ŀ������������data-index�����Կ������һ����Ŀ��Ӧ�Ķ�����Ŀdiv
var subClassName = $(this).attr("data-index");
var position = $(this).position();
var left = position.left + 192;
self.hoverClass = " rhover";
var topNavIndex = $('input[name=topNavIndex]', self.containerDiv).val();
//����Ӧ��Ʒ��Ŀҳ�ڵ�������ǰ�ĸ�ʱ������Ŀ���Ҹ�������������
if (topNavIndex > 4) {
//��������Ŀ�����Ҷ�����Ŀ��������10��������Ҫ�ֳ����У�ÿ�п�200px������λ����Ҫ�����ƽ�400px
var subSize = $("input[name=subSize]", $(this)).val();
if (subSize > 10) {
left = position.left - 402;
} else {
left = position.left - 202;
}
self.hoverClass = " lhover";
}
//����һ����Ŀ����hoverЧ��
var firClassName = $(this).attr("class");
if (firClassName.indexOf(self.hoverClass) == -1) {
$(this).addClass(firClassName + self.hoverClass);
}
//�ҵ�Ҫչʾ�Ķ�����Ŀdivչʾ֮
self.subCategory = $("div." + subClassName, self.containerDiv).css({
'display': 'block',
'left': left,
'top': position.top
});
self.subCategory.bind('mouseleave', function () {
$(this).css("display", "none");
//�˳�������Ŀȥ��һ����Ŀ��hoverЧ��
self.delHover(firCategory, self.hoverClass);
});
});
//����뿪һ����Ŀ���ض�����Ŀ����
self.containerDiv.on('mouseleave', 'li.sec', function () {
var handler = this;
var className = $(this).attr("data-index");
self.timeOut = setTimeout(function () {
$("div." + className, self.containerDiv).css("display", "none");
//�˳�һ����Ŀȥ��hoverЧ��
self.delHover($(handler), self.hoverClass);
}, 20);
//��һ����Ŀ���������Ŀ����ʱ�����ֶ�����Ŀ���㲻����
self.subCategory.bind('mouseenter', function () {
clearTimeout(self.timeOut);
});
});
},
//��ҳ
changePage: function () {
var self = this;
var upPage = $('a.up', self.containerDiv);
var downPage = $('a.down', self.containerDiv);
//���Ϸ�ҳ
upPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == 1) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
//���Ϸ�ҳҳ����1
pageNum = pageNum - 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
//���·�ҳ
downPage.bind('click', function () {
var $pageNum = $('input[name=pageNum]', self.containerDiv);
var $pages = $('input[name=pages]', self.containerDiv);
var pageNum = $pageNum.val();
var pages = $pages.val();
pageNum = parseInt(pageNum);
pages = parseInt(pages);
if (pageNum == pages) {
return false;
}
//������һҳ
var shows = $('li.show', self.containerDiv);
var start = (pageNum - 1) * self.pageSize + 1;
for (var i = start; i < start + self.pageSize; i++) {
self.switchClass($(shows[i - start]), "category-hide" + i);
}
shows.css("display", "none");
pageNum = pageNum + 1;
$pageNum.val(pageNum);
self.showPageNum(pageNum);
//չʾ��һҳ
var nextStart = (pageNum - 1) * self.pageSize + 1;
var nextEnd = nextStart + self.pageSize;
if (pageNum == pages) {
nextEnd = nextStart + self.pageSize + 1
}
for (var i = nextStart; i < nextEnd; i++) {
var hidden = $('li.category-hide' + i, self.containerDiv);
if (hidden.length == 0) {
return false;
}
hidden.css("display", "block");
self.switchClass(hidden, "show");
}
});
},
//����Ŀ��������չʾҳ��
showPageNum: function (pageNum) {
var $pageNum = $('span[name=pageNum]', this.containerDiv);
$pageNum.html(pageNum);
},
//���hover��
delHover: function (obj, hoverClass) {
var firClassName = obj.attr("class");
obj.removeClass(hoverClass);
},
//�л�class show hidden
switchClass: function (obj, replacement) {
var className = obj.attr("class");
if (!className) {
return;
}
if (replacement == "show") {
className = className.replace(/category-hide\d+/, 'show');
} else {
className = className.replace("show", replacement);
}
obj.attr("class", className);
},
ajaxCategoryLoader: function (callback) {
var config = this.config;
if (!config.categoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.categoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
topNavIndex: config.topNavIndex
},
success: function (_data) {
callback(_data);
}
});
},
showCategoryDiv: function () {
var self = this;
this.ajaxCategoryLoader(
function (categoryDiv) {
var offset = self.handler.offset();
self.containerDiv = $('
');
self.containerDiv.appendTo('body');
//��ȡ��div���Ҳ�λ��
var topNavBar = $('.top-nav-bar');
var winWidth = topNavBar.width() + topNavBar.offset().left;
var divWidth = 192;
if (offset.left + divWidth > winWidth) {
offset.left = winWidth - divWidth - 2;
}
self.containerDiv.css({
'display': 'none',
'left': offset.left,
'top': offset.top + self.handler.height()
});
self.containerDiv.html(categoryDiv);
//�Զ�̬���ɵ�div���Ӵ��
site.trigger('widget-tracelog', self.containerDiv);
//��ҳ
self.changePage();
//����������Ŀ
self.showSubCategory();
//���Ƹ��㸡��ʱ�����ʧʱ��
new FloatPanel(self.containerDiv, {
handler: self.handler,
event: 'mouseenter',
autoClose: 300,
delay: 300
});
self.handler.trigger('mouseenter');
}
);
},
showOtherCatDiv: function () {
var self = this;
var supList = $('#sup-store-container');
if (supList.length === 0) {
this.getOtherCatDiv(function (supDiv) {
// var offset = self.supHandler.offset();
self.supMainDiv = $('
');
self.supMainDiv.appendTo(self.supHandler.parent());
self.supMainDiv.css({
'position': 'absolute',
'left': 0,
'top': self.supHandler.height(),
"zIndex": 2000
});
self.supMainDiv.html(supDiv);
self.supMainDiv.on('mouseenter', function () {
self.supMainDiv.stop(true, true).show();
// self.supHandler.addClass('active');
}).on('mouseleave', function () {
// self.supHandler.removeClass('active');
// self.supMainDiv.delay(100).fadeOut(50);
self.fadeOutOtherCatDiv(100, 50);
})
});
} else {
supList.stop(true, true).fadeIn();
}
},
hideOtherCatDiv: function () {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.hide();
}
},
fadeOutOtherCatDiv: function (delay, time) {
var self = this;
if (self.config.nowPageName !== 'index') { // ����ҳʱ������������ʧ
var supList = $('#sup-store-container');
supList.delay(delay).fadeOut(time)
}
},
getOtherCatDiv: function (callback) {
var self = this;
var config = this.config;
var selectedCats = config.selectedCats;
// try {
// selectedCats = this.config.selectedCats
// } catch(e) {}
if (!config.otherCategoryUrl || !config.uid || !config.domainId) {
return;
}
$.ajax(config.otherCategoryUrl, {
dataType: 'jsonp',
data: {
uid: config.uid,
domainId: config.domainId,
selectedCats: selectedCats
},
success: function (_data) {
callback(_data);
},
error: function () {
// ������⣬ֱ�ӷ�����100%��ʧ�ܣ��������Ի���
self.showOtherCatDiv();
}
});
}
};
AppContext.register('view', 'topNav', OfferCategory);
});
define(["jQuery","AppContext","widget.Util","widget.UI"],function(i,t){var n={init:function(i,t,n){this.div=i,this.config=t,this.data=n,this.initOnload()},initOnload:function(){var t=this,n=i(".img-container",t.div);if(t.data.linkObj&&t.data.image){var a=i('
');a.on("load",function(){var i=a.width();n.css({marginLeft:"-"+i/2+"px",visibility:"visible"})}),n.prepend(a)}}};t.register("view","fullscreenImg",n)});/**
* ????????
*/
define(['jQuery', 'AppContext', 'fui/tabs/2.0','fui/timer/1.0'], function($, AppContext, Tabs, Timer) {
var timerInit = function(_time, el) {
var _timer = new Timer({
to: _time,
el: el, //'#remain-timer'
maxUnit: 'day',
useServerTime: true,
fixInterval: true
});
};
var view = {
init: function (div, config) {
this.div = div;
this.config = config;
if (this.div.find(".app-shop-promotion").length > 1) {
this.initTab();
}
var actives = $('.shopPromotion-activeWrap');
for(var i=0;i
new Date()){
timerInit(_startTime, el);
}else {
$(actives[i]).find('.shopPromotion-remain')[0].innerText = '��Ѿ�����';
$(actives[i]).find('.shopPromotion-remain')[0].style.marginBottom = '50px';
$(actives[i]).find('.shopPromotion-remainTime')[0].style.display = 'none';
}
}
var card = $($(actives[i]).find('.shopPromotion-info')[0]);
var outUrl = $($(actives[i]).find('.shopPromotion-more')[0]).attr('href');
card.click(function(){
window.open(outUrl);
});
})(i);
}
},
initTab: function () {
var tab = new Tabs({
tpl: "#shopPromotionContainer",
event: 'click',
boxSelector: '.app-shop-promotion',
effect: 'leftright',
prev: '.left-btn',
next: '.right-btn',
overflowContainer: '.app-shop-promotion-over-flow-container',
currentCls: 'active'
});
}
};
AppContext.register('view', 'shopPromotion', view);
});
/**
* ȫ���ֲ�
* @author zengpan.zhengzp
*/
define([ 'jQuery', 'AppContext'],
function($, AppContext) {
var FullScreenRoll = {
init:function (div, config, data) {
this.div = div;
this.initArrow();
},
initArrow: function(){
var self = this,
designBox = $('.design-box', this.div);
designBox.on('mouseenter', function(){
$('.fx-prev,.fx-next', self.div).show();
});
designBox.on('mouseleave', function(){
$('.fx-prev,.fx-next', self.div).hide();
});
}
};
AppContext.register('view', 'fullScreenRoll', FullScreenRoll);
});
define(["jquery","AppContext","util/date/1.0","core.Remote"],function(n,t,o,e){var i={name:"marketing_wp_coupon",init:function(n,t){this.loginFlag=t.hasLogin,this.div=n,this.config=t,this.initTime(),this.bindGetCouponEvent()},bindGetCouponEvent:function(){var t=this;n(".receiveCoupon",t.div).on("click",function(o){var e=n(this);t.config.context.isTopDomain||"index"===t.config.context.pageType||(o.preventDefault(),t.loginFlag?t.getCoupon(e):t.login(t.getCoupon,e))})},login:function(){n.add("wp-logist",{css:["//web.archive.org/web/20220125223106/http://astyle.alicdn.com/sys/css/logist/logist.css"],js:["//web.archive.org/web/20220125223106/http://astyle.alicdn.com/sys/js/logist/logist.js"],ver:"1.0"}),n.use("wp-logist",function(){FE.sys.logist({onLoginSuccess:function(){window.location.reload()},onRegistSuccess:function(){window.location.reload()}})})},getCoupon:function(t){var o=this,i=n(t),s=i.data("couponId"),a=i.data("couponType");e.callEvent("marketing_wp_coupon","getCoupon",{data:{couponId:s,couponType:a,_csrf_token:o.config.context.csrfToken},type:"post",success:function(n){n.result&&n.result.success?i.hide().closest(".priceContet").find(".watermark").addClass("watermarkMove"):alert(n.result&&n.result.errorMsg)},error:function(){alert("\u7f51\u7edc\u9519\u8bef\u8bf7\u91cd\u8bd5")}})},initTime:function(){var t=this,e=t.div.find(".couponItem");e.each(function(t,e){var i=n(e),s=i.data("start"),a=i.data("end"),c=o.format(new Date(parseInt(s)),"yyyy.MM.dd"),r=o.format(new Date(parseInt(a)),"yyyy.MM.dd");i.find(".timeCondition span").html(c+"-"+r)})}};t.register("view",i.name,i)});/**
* �Ż�ȯ
*/
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', '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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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' ], function($, AppContext) {
var CategoryBigView = ({
init : function(div, config, data) {
this.div = div;
//ȥ�������һ�з����µĺ�����ʽ
this.removeSplitStyle();
this.switchChildrenCategroy();
},
removeSplitStyle : function(){
var self = this;
var lastCategoryMainUl = $('ul.category-main',$('.m-content', self.div)).last();
if(lastCategoryMainUl.hasClass('category-main')){
lastCategoryMainUl.addClass('last-category-main');
}
},
switchChildrenCategroy : function() {
var self = this;
$('.arrowhead', self.div).bind('click',
function() {
//console.log($(this));
//��ȡ��ǰ���Ԫ�ص�index
var index = $(this).closest('li').index();
//console.log(index);
var currentliEle = $(this).closest('li');
var currentUlEle = $(this).closest('li').closest('ul');
//console.log(currentUlEle);
//��ȡ��Ҫ�����ĵ�ul
var showEle = currentUlEle.next('div.children-categories').find('ul.children-category').eq(index);
//console.log(showEle);
//���ϴ���ʾ��dom�ڵ��������
if(self.lastShowEle && self.lastShowEle[0] !== showEle[0]){
self.lastShowEle.hide();
}
//�Ƴ��ϴε�ѡ��Ч��
if(self.lastliEle && self.lastliEle[0] !== currentliEle[0]){
self.lastliEle.removeClass("select-li");
}
//�Ƴ��ϴεļ�ͷЧ��
if(self.lastSpanEle && self.lastSpanEle[0] !== $(this)[0]){
self.lastSpanEle.removeClass("hide-children-categroy");
self.lastSpanEle.addClass("show-children-categroy");
}
//�л�class
currentliEle.toggleClass("select-li");
//�л�������ʾЧ��
showEle.toggle();
//�л���ͷ�ķ���Ч��
if($(this).hasClass("show-children-categroy")){
$(this).removeClass("show-children-categroy");
$(this).addClass("hide-children-categroy");
}else{
$(this).removeClass("hide-children-categroy");
$(this).addClass("show-children-categroy");
}
//�ѱ�����ʾ��dom���浽ȫ�ֱ�����
self.lastShowEle = showEle;
self.lastliEle = currentliEle;
self.lastSpanEle = $(this);
}
);
}
});
AppContext.register('view', 'categoryBig', CategoryBigView);
});
define([ 'jQuery', 'AppContext' ], function($, AppContext) {
var CategoryBigView = ({
init : function(div, config, data) {
this.div = div;
this.config = config;
this.data = data;
//��ʼ�����ĸ߶�
this.initModHeight();
//����������ࡱ��ť��������
// this.showMoreChildrenCategroy();
//���·���ʾ���а�ť��������
this.showAllCategroies();
},
//�������С��6����ʼ���߶ȣ�����ʹ����ʽ���190px�ĸ߶�
initModHeight : function(){
var self = this;
if($('.fold-lines-count',self.div).val() < 6){
$('.category-main',self.div).height($('.category-main-height',self.div).val());
}
},
showMoreChildrenCategroy : function() {
var self = this;
$('.more-arrowhead-icon', self.div).bind('click',
function() {
//�������С��6��ʱ���ִ����
if($('.fold-lines-count',self.div).val() < 6){
//�л������ࡱ��ͷ����ʽ
$(this).toggleClass('arrowhead-up');
var currentCategroyDiv = $(this).closest('div');
//�л�������ʾ�Ĵ�С��ʽ
currentCategroyDiv.toggleClass('children-categroy-more-than-two-lines');
//��������ĸ߶����Զ�
$('.category-main',self.div).css("height","auto");
return;
}
//����ͷ�����������·��İ�ť����ʾ�����ʱ��ִ�еĺ���
if(!$(this).hasClass('arrowhead-up') && !$('.show-all-categroies',self.div).hasClass('hide-some-categroies')){
//�������������ʱ������������߶����ó��Զ�
$('.category-main', self.div).toggleClass('category-main-more');
//�ѵײ��ĸ��ఴť���ó��������ʽ
$('.show-all-categroies', self.div).toggleClass('hide-some-categroies');
}
var currentCategroyDiv = $(this).closest('div');
//�л�������ʾ�Ĵ�С��ʽ
currentCategroyDiv.toggleClass('children-categroy-more-than-two-lines');
//�л������ࡱ��ͷ����ʽ
$(this).toggleClass('arrowhead-up');
}
);
},
showAllCategroies : function() {
var self = this;
$('.show-all-categroies', self.div).bind('click',
function() {
// console.log($('.fold-lines-count', self.div).val())
var content = $(this).closest('div');
//�л���ʾ����Ĵ�С
$('.category-main', content).toggleClass('category-main-more');
//�л���ť�����ࡱ�͡���������ͼƬ��css
$(this).toggleClass('hide-some-categroies');
}
);
}
});
AppContext.register('view.tiled', 'categoryBig', CategoryBigView);
});
define([ 'jQuery', 'AppContext', 'Class', 'widget.VideoPlay', 'core.Remote'],function($, AppContext, Class, VideoPlay, Remote) {
var videoBig = new Class ({
init : function(div, config, data){
this.config = config;
this.isEdit = config.context.diy;
this.isTopDomain = config.context.isTopDomain;
this.data = data;
this.div = div;
this.mediaServer = config.mediaServer;
this._init();
},
_init:function(){
var self = this ;
if(self.data&&self.data.videoId){
Remote.callEvent('videoInfo', 'getVideoById', {
data: {
videoId: self.data.videoId,
_csrf_token: self.config.context.csrfToken
},
type: 'post',
success: function(data) {
if (data.result) {
self.render(data.result);
self.view(data.result);
}
},
error: function() {
}
})
} else{
if(self.isEdit){
$('.vas_video_view', self.div).html("�㻹û�в���ʹ����Ƶ������Ҳ����ð�ť�����ɲ�����Ƶ
");
self.view();
}
}
},
render:function(data){
var self = this;
if(self.data&&self.data.videoId) {
var self = this;
var config = data;
var a = [];
if(config.status=="online"){
a.push('');
if(!self.isTopDomain){
a.push('����������������Ƶ���泡�ء����ϼ��ز��ɻ�Ա�ṩ����Ƶ֮��ʵ�ԡ��Ϸ��Լ���������ɻ�Ա���и���
');
}
}else{
a.push('');
a.push('
');
if ($.isEmptyObject(config)) {
a.push('');
a.push('������Ƶ�Ҳ����ˣ���ȥ��Ƶ������̨����������Ƶ��
');
} else if(config.status=="failed"){
a.push('');
a.push('��Ƶ��˲�ͨ����
');
}else {
a.push('');
a.push('�����Ƶ��������У�������Ա����1~2���������������ɡ�
');
}
a.push('
');
a.push('
');
}
$('.vas_video_view',this.div).html(a.join(''));
if(config.status=="failed"){
// $($('.vas_video_view_content')).css({padding:"0 0 0 "+(392-196-config.refuseMessage.length*14)/2+"px"});
}
}
},
view:function(config){
var self = this;
if(self.data&&self.data.videoId) {
if(!self.isEdit){
if(config&&config.status=="online"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
config && !$.isEmptyObject(config) && self.playVideo(config);
} else {
if(!self.isEdit){
if(config&&config.auditStatus=="approved"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
}
},
playVideo: function(data) {
var self = this;
var maxWidth = 1190; // Ĭ����Ƶ��������
var maxHeight = 600; // Ĭ����Ƶ�����߶�
// �ڲ�ͬ��region�µ������Ƶ�������
if(self.config && self.config.regionType == "full"){
maxWidth = 952;
maxHeight = 500;
}else if(self.config && self.config.regionType == "big"){
maxWidth = 752;
maxHeight = 400;
}
var options = {
width: maxWidth,
height: maxHeight,
adaptShape: true, // ��Ƶ����Ĭ������Ӧ��ֻ����������
autoplay: false,
loop: false,
controls: true,
poster: data.extendInfo && data.extendInfo.coverImg || 'https://web.archive.org/web/20220125223106/https://img.alicdn.com/tfs/TB1RUrPaBTH8KJjy0FiXXcRsXXa-1125-618.png'
}
var video = new VideoPlay($('.video-show', self.div), data.address, options);
var videoEle = $('.video-show', self.div).find('video');
// ������adaptShape:true����Ӧ��width��height��ת��Ϊ max-*** ,����video��ǩ��Ȼ��Ҫ����������һ�Σ���Ȼ����width��Ϊ��
if (options.adaptShape) {
videoEle.css({'max-width':options.width, 'max-height': options.height});
video.isFull = false;
// ����ȫ��ʱ����max-xxx���ԣ������Ӱ�쵽ȫ������
video.on('video:enterFullscreen', function() {
if (!video.isFull) {
videoEle.css({'max-width':'initial', 'max-height': 'initial'});
video.isFull = true;
} else {
videoEle.css({'max-width':options.width, 'max-height': options.height});
video.isFull = false;
}
});
// exit api��bug��ȫ����������enter�¼����Ժ�butterfly���������������������bug����Ҫ�õ�����Ĵ�����
// video.on('video:exitFullscreen', function() {
// videoEle.css({'max-width':options.width, 'max-height': options.height});
// });
}
}
});
AppContext.register('view', 'videoBig', videoBig);
});
/**
* վ������
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.InstantValidator', 'widget.PlaceHolder'],
function($, AppContext, InstantValidator, PlaceHolder) {
var SearchInSite = {
init: function(div) {
this.div = div;
this.initPriceInput();
this.searchText = $('div.search-text input', div);
new PlaceHolder(this.searchText, { placeholder: '�������Ʒ����' })
this.initSubmit();
},
/**
* ���Ƽ۸������
*/
initPriceInput: function() {
var inputs = $('input.price-low,input.price-high', this.div);
new InstantValidator(inputs, 'price');
},
initSubmit:function(){
$("input.search-btn-big").on("click",function(){
var submitCotent = $("input.search-keywords-big").val().trim();
if (submitCotent == "�������Ʒ����" || submitCotent == "") {
$("input.search-keywords-big").val("");
}else {
$("input.search-keywords-big").val(submitCotent.replace('%',''));
}
});
}
}
//~
AppContext.register('view', 'searchInSite', SearchInSite);
});define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var AutoOfferBig = new Class({
init : function(div, config, data) {
if(data.sortType !== 'recommend'){
return;
}
this.div = div;
this.config = config;
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $('.offer-list-row li', this.div),
offers = this.config.offer;
offers && $.each(offers, function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleExposureTrace: function() {
var self = this,
lis = $('.offer-list-row li', this.div),
offers = [];
lis.each(function(index) {
offers.push($(this).data('offer'));
});
var page = RecUtil.getPageParams(),
objectIds = $.map(offers, function(item) {
return item.id + ',' + (item.alg || 0);
}).join(';'),
params = {
ctr_type: page.nowinport ? 3 : 32,
page_area: page.recid,
interface_id: page.recid,
page_id: page.pageid,
object_type: 'offer',
object_ids: objectIds,
ctr_ns:'',
uid: Aliuser.getLastMemberId(),
time: $.now()
};
var sendExposure = function(){
var img = new Image();
img.src = Util.formatUrl('//web.archive.org/web/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/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/20220125223106/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(gmParams)) + '&time=' + $.now();
});
}
});
var RecUtil = {
getPageParams: function() {
var nowinport = Component.getUserContext().siteId === 'nowinportoffer',
recid = '7103';
return {
recid: recid,
pageid: window.dmtrack_pageid,
nowinport:nowinport
}
}
};
AppContext.register('view.detail', 'autoOfferBig', AutoOfferBig);
});
define(['jQuery', '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'], function($, AppContext) {
var SalesRankingBig = ({
init:function(div, config, data){
if (!config.context.diy) {
var ele = $('input.offer-count-hidden-main', div);
var offerCount = ele.val();
if(offerCount > 0){
this.showSalesRankingBig(div, config, data);
}
}else{
this.showSalesRankingBig(div, config, data);
}
},
showSalesRankingBig : 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', 'salesRankingBig', SalesRankingBig);
});
/**
* @fileoverview ����֤����
*
*/
define(['jQuery','AppContext', 'Class', 'core.Component', 'core.Remote'],
function($, AppContext, Class, Component, Remote) {
var CertificateBig = new Class({
template:
'<% if (certs.length) { %>\
\
\
֤��ͼƬ | \
֤������ | \
��֤���� | \
���� | \
\
<% jQuery.each(certs, function(index, cert) { %>\
\
| \
<%= cert.name %> | \
<%= cert.origin %> | \
<%= cert.dateDesc %> | \
\
<% }); %>\
\
\
<% } else { %>\
����֤������
\
<% } %>',
init: function(div, config, data) {
this.div = div;
this.config = config;
var self = this;
if (!data.maxNum) {
data.maxNum = 4;
}
var url = Component.getGlobalViewConfig('eventUrl');
if(url) {
url += '/event/app/certificateSmall/getCertificate.htm';
$.ajax(url, {
data: {
// _csrf_token: Component.getUserContext('csrfToken'),
_server_name: Component.getGlobalViewConfig('domainUrl'),
memberId: config.context.uid,
maxNum: data.maxNum
},
dataType: 'jsonp',
success: function(ret) {
ret.success && self.render(ret.cert_data || [], config.context.uid);
}
});
} else {
Remote.callEvent('certificateSmall','getCertificate',{
pageAware: true,
data: {
memberId: config.context.uid,
maxNum: data.maxNum
},
type: 'post',
success: function(ret) {
ret.result && ret.result.success && self.render(ret.result.cert_data || [], config.context.uid);
}
});
}
},
render: function(certs, memberId) {
var self = this,
content = $('div.m_container', this.div);
this.filterData(certs, memberId);
var data = {
certs: certs,
moreUrl: self.config.moreUrl
}
var html = FE.util.sweet( self.template).applyData(data);
content.html(html);
},
filterData: function(certs, memberId) {
var self = this,
detailBase = self.config.creditDetailBaseUrl,
detailUulBase = self.config.certificateDetailUrl;
$.each(certs, function() {
var cert = this;
cert.name = $.util.escapeHTML(cert.name);
cert.origin = $.util.escapeHTML(cert.origin);
cert.detailUrl = detailUulBase + '?memberId=' + memberId + '&certifyInfoId=' + cert.certifyInfoId;
cert.smallImg = cert.imgPath;
cert.dateDesc = self.formatDateDesc(cert);
});
},
formatDateDesc: function(cert) {
var startDate = new Date(parseInt(cert.dateStart));
var endDate = new Date(parseInt(cert.dateEnd));
return this.dateFormat(startDate, 'yyyy-MM-dd') + (cert.dateEnd ? ' �� ' + this.dateFormat(endDate, 'yyyy-MM-dd') : ' ��');
},
dateFormat: function(date, fmt) { //java Dateת��Ϊfmt��ʽ��String
var o = {
"M+": date.getMonth() + 1, //�·�
"d+": date.getDate(), //��
"h+": date.getHours(), //Сʱ
"m+": date.getMinutes(), //��
"s+": date.getSeconds(), //��
"q+": Math.floor((date.getMonth() + 3) / 3), //����
"S": date.getMilliseconds() //����
};
if (/(y+)/.test(fmt)) fmt = fmt.replace(RegExp.$1, (date.getFullYear() + "").substr(4 - RegExp.$1.length));
for (var k in o)
if (new RegExp("(" + k + ")").test(fmt)) fmt = fmt.replace(RegExp.$1, (RegExp.$1.length == 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
return fmt;
}
});
AppContext.register('view', 'certificateBig', CertificateBig);
});
/**
* @fileoverview �Ƽ������
*
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.Util', 'widget.UI', 'widget.Paging', 'part.Album'],
function($, AppContext, Util, UI, Paging, album) {
var initConfig = {
"maxNum": "10",
"hasAlbums":true
};
var ManualAlbum = {
init : function(context,config,data){
$.extend(data,initConfig);
new album(context,config,data);
}
}
/**
* �������
*/
AppContext.register('view', 'manualAlbum', ManualAlbum);
});
define(['jQuery', 'AppContext', 'app.bingCreatedBig.view.Dialog', 'app.bingCreatedBig.view.Upload','app.bingCreatedBig.view.Verify'],
function ($, AppContext,dialog, uploader,verify) {
var BingCreatedBig = {
init: function(app, config) {
this.app = app;
this.prepare();
this.bindE();
this.verify23();
this.delegateE();
this.upload();
this.xjSubmit();
},
prepare: function() {
var app = this.app;
this.config = {
bingCreateBig: app,
offerTable:$(".offer-list tbody" ,app),
addoffer : $(".add-offer", app),
actionCell : $(".action-cell", app),
lxBlock:$(".lx-block", app),
bcBlock:$(".bc-block", app),
submit:$(".submit", app),
uploadContent:$(".upload", app),
uploadURL:$(".uploadURL", app),
offerItemsInput:$(".offer-items-input", app),
offerSubjectInput:$(".offer-items-subject", app),
form:$(".xunjia-form", app)
};
},
verify23:function(){
var self = this;
self.config.lxBlock.find(".item-people").bind("blur",function(){
var value = $(this).val().trim();
if(value ==''){
$(this).parents(".bck").find(".msg").empty();
$(this).parents(".bck").find(".msg").append(self.createTip('��ϵ�˲���Ϊ��'));
$(this).attr("vg","0");
}else{
$(this).parents(".bck").find(".msg").empty();
$(this).attr("vg","1");
}
});
self.config.lxBlock.find(".item-tel").bind("blur",function(){
var value = $(this).val().trim();
if(value =='' || value.lenght < 7 || !(/^\d/.test(value))){
$(this).parents(".bck").find(".msg").empty();
$(this).parents(".bck").find(".msg").append(self.createTip('����ȷ��д�绰����'));
$(this).attr("vg","0");
}else{
$(this).parents(".bck").find(".msg").empty();
$(this).attr("vg","1");
}
});
self.config.bcBlock.find(".ta-detail").bind("blur",function(){
var value = $(this).val().trim();
$.ajax({
dataType:"jsonp",
url:$(".mod-bingCreatedBig .subjectVerifyDetail").val(),
data:{
"subject":value
},
success:function(o){
if(o.data.forbidden == "true"){
self.config.bcBlock.find(".shuomingError").empty();
self.config.bcBlock.find(".shuomingError").append(self.createTip('�зǷ��ؼ���'));
}else{
self.config.bcBlock.find(".shuomingError").empty();
}
}
});
});
self.config.bcBlock.find(".ta-detail").bind("keyup",function(){
var value = $(this).val().trim();
if(value.length > 500){
$(this).val($(this).val().cut(500));
}
});
},
delegateE:function(){
var self = this;
self.config.offerTable.delegate(".del","click",function(){
$(this).parents("tr").remove();
if(self.config.offerTable.find("tr").length == 1){
self.config.offerTable.find(".del").css("display","none");
}
});
self.config.offerTable.delegate(".item-title","blur",function(){
var it = $(this);
var value = $(this).val().trim();
if(value !=''){
$(this).attr("vg","1");
$.ajax({
dataType:"jsonp",
url:$(".mod-bingCreatedBig .subjectVerify").val(),
data:{
"subject":value
},
success:function(o){
if(o.data.forbidden == "true"){
if(o.data.prompt == "dpp.title.simple"){
it.parents(".relative").find(".vgMsg").empty();
it.parents(".relative").find(".vgMsg").append(self.createTip('���ı�����ڼ��ή�ͱ���Ч�����벹������'));
}else{
it.parents(".relative").find(".vgMsg").empty();
it.parents(".relative").find(".vgMsg").append(self.createTip('�зǷ��ؼ���'));
}
}else{
it.parents(".relative").find(".vgMsg").empty();
}
}
});
}
});
self.config.offerTable.delegate(".item-amount","blur",function(){
var value = $(this).val().trim();
if(verify.verifyRules.posInt.test(value)){
$(this).attr("vg","1");
$(this).parents(".relative").find(".vgMsg").empty();
}else{
$(this).parents(".relative").find(".vgMsg").empty();
$(this).parents(".relative").find(".vgMsg").append(self.createTip('������������'));
$(this).attr("vg","0");
}
});
self.config.offerTable.delegate(".item-unit","blur",function(){
var value = $(this).val().trim();
if(/^[^0-9]*$/.test(value) && value != ''){
$(this).attr("vg","1");
$(this).parents(".relative").find(".vgMsg").empty();
}else{
$(this).parents(".relative").find(".vgMsg").empty();
$(this).parents(".relative").find(".vgMsg").append(self.createTip('����Ϊ���ֺͿ�'));
$(this).attr("vg","0");
}
});
},
upload: function () {
var config = this.config;
new uploader({
container: config.uploadContent,
uploadUrl: config.uploadURL.val(),
dataInput: config.bingCreateBig.find(".uploadData")
});
},
bindE:function(){
var self = this;
self.config.addoffer.bind("click",function(){
self.config.offerTable.find(".del").css("display","block");
if(self.config.offerTable.find("tr").length >= 30){
self.config.actionCell.find(".themost").empty();
self.config.actionCell.find(".themost").append(self.createTip('���ֻ������30���Ʒ'));
setTimeout(function(){
self.config.actionCell.find(".themost").empty();
},2000);
}else{
self.config.offerTable.append(self.createClip());
}
});
},
createTip:function(info){
return $(''+info+'');
},
offerItemsToInput:function(arr){
var self = this;
var str = JSON.stringify(arr);
self.config.offerItemsInput.val(str);
},
offerSubjectToInput:function(arr){
var self = this;
var str = "";
if(arr.length > 1){
str = str+"�ɹ�";
str = str+arr[0].subject;
str = str + '�ȹ�' +arr.length+'���Ʒ';
}else{
str = str+arr[0].subject;
}
self.config.offerSubjectInput.val(str);
},
verifyOfferList:function(){
var self = this;
self.config.offerTable.find("tr").each(function(){
if($(this).find(".input-item[vg=1]").length == 3){
$(this).attr("vg","1");
$(this).attr("effect","1");
}else if($(this).find(".input-item[vg=0]").length == 3){
$(this).attr("vg","1");
$(this).attr("effect","0");
}else{
$(this).attr("vg","0");
$(this).attr("effect","0");
}
});
if(self.config.offerTable.find("tr[vg=0][effect=0]").length > 0){
return false;
}
if(self.config.offerTable.find("tr[effect=1]").length > 0){
var arr = [];
self.config.offerTable.find("tr[effect=1]").each(function(k,v){
var obj = {};
obj.subject = $(v).find(".item-title").val();
obj.purchaseAmount = $(v).find(".item-amount").val();
obj.unit = $(v).find(".item-unit").val();
arr.push(obj);
});
self.offerItemsToInput(arr);
self.offerSubjectToInput(arr);
return true;
}else{
return false;
}
},
verifyConnect:function(){
var self = this;
if(self.config.lxBlock.find(".input-item[vg=0]").length > 0){
return false;
}else{
return true;
}
},
verifyShuoming:function(){
var self = this;
if(self.config.bcBlock.find(".ta[vg=0]").length > 0){
return false;
}else{
return true;
}
},
xjSubmit:function(){
var self = this;
self.config.submit.find(".submit-btn").bind("click",function(e){
e.preventDefault();
//console.log('1'+self.verifyOfferList());
//console.log('2'+self.verifyShuoming());
//console.log('3'+self.verifyConnect());
if(self.verifyOfferList() && self.verifyShuoming() && self.verifyConnect()){
// self.config.bcBlock.find(".ta-detail").val(self.config.bcBlock.find(".ta-detail").val().cut(30));
var str = self.config.form.serialize();
//console.log(str);
$.ajax({
url: $(".mod-bingCreatedBig .sendXunjiaAjax").val(),
data:str,
dataType:"jsonp",
success: function(o) {
if(o.c == "E00002"){
$.add('wp-logist', { 'css': ['//web.archive.org/web/20220125223106/http://astyle-src.alicdn.com/sys/css/logist/logist-min.css'], 'js': ['//web.archive.org/web/20220125223106/http://astyle-src.alicdn.com/sys/js/logist/logist-min.js'] });
$.use('wp-logist', function() {
FE.sys.logist({
source: 'test', //����ҳ�����Դ
onLoginSuccess: function(){ //��½�ɹ���ص�����
FE.sys.logist('close');
self.config.submit.find(".submit-btn").trigger("click");
},
onRegistSuccess: function(){ //ע��ɹ���ص�����
window.location.reload();
}
});
});
}else{
if(o.c == "0"){
window.location.href = o.d;
}else{
if(o.c == "E00102"){
dialog.alert({content:'�û��ں������У�',btnCancel:'ȷ��'});
}else if(o.c == "E00101"){
dialog.alert({content:'�û����췢����ѯ�۵��Ѿ��������ޣ�',btnCancel:'ȷ��'});
}else if(o.c == "E00001"){
dialog.alert({content:'ϵͳ��æ����ˢ��ҳ�����ԣ�',btnCancel:'ȷ��'});
}else{
dialog.alert({content:'ϵͳ��æ����ˢ��ҳ�����ԣ�',btnCancel:'ȷ��'});
}
}
}
},error:function(o){
dialog.alert({content:'�½�ѯ�۵�ʧ�ܣ�',btnCancel:'ȷ��'});
}
});
}else{
if(!self.verifyOfferList()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('ѯ�۵���Ʒ��֤��ͨ��'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
if(!self.verifyShuoming()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('����˵����֤��ͨ��'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
if(!self.verifyShuoming()){
self.config.submit.find(".submitError").empty();
self.config.submit.find(".submitError").append(self.createTip('����ȷ��д��ϵ��ʽ'));
setTimeout(function(){
self.config.submit.find(".submitError").empty();
},6000);
return false;
}
}
});
},
createClip:function(){
return $(' \
\
\
| \
\
\
| \
\
\
| \
');
}
};
AppContext.register('view', 'bingCreatedBig', BingCreatedBig);
});
define(['jQuery', 'Class', 'AppContext', '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/20220125223106/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20220125223106/http://style.c.aliimg.com/sys/js/logist/logist-min.js'],
ver: '1.0'
});
phoneLoginContaner.click(function(e) {
$.use("wp-logist", function(){
FE.sys.logist({
onLoginSuccess: function(){ //��½�ɹ���ص�����
window.location.reload();
},
onRegistSuccess: function(){ //ע��ɹ���ص�����
window.location.reload();
}
});
});
return false;
});
}
},
initAlitalk: function() {
var alitalk = $('a[data-alitalk]', this.div);
new SiteAlitalk(alitalk);
}
});
AppContext.register('view', 'contactBig', ContactBig);
});
/**
* @anchor han.hsh
* @date 2015.8.12
* ʹ���°�������� 2017-12-22 zhao.zdw
*/
define([ 'jQuery', 'core.Remote', 'core.Component','lofty/alicn/aliuser/1.0/aliuser', '//web.archive.org/web/20220125223106/http://g.alicdn.com/aliww/ww-light-cbu/index.js' ],
function($, Remote, Component,AliUser, Aliww ) {
/*var domainUrl = $('.wp-aliwangwang input.currentdomain').val();
var self = this;
var eventUrl = Component.getGlobalViewConfig('eventUrl');
if(typeof domainUrl == 'undefined'){
return;
}
$('.gold-wangwang').click(function(){
var page_id;
var wangSource = $(this).data('wangsource');
if(window.dmtrack_pageid){
page_id = dmtrack_pageid;
}
if(window.goldlog){
goldlog.record('/1688-winport-element.click.shopclick','CLK','click_type=' + wangSource + '&page_id=' + page_id,'H1511971673');
}
});
$('.wp-aliwangwang').each(function(index, item) {
var href = $(item).attr('href');
var alitalk = $(item).data('alitalk');
if (AliUser.isLogin()) {
href = href.replace(/fromid\=(.*)$/ig, "fromid=cnalichn" + encodeURIComponent(AliUser.getLoginId()));
alitalk.fromid = "cnalichn" + AliUser.getLoginId();
}else{
var lastId = AliUser.getLastLoginId();
if(lastId){
lastId = lastId.replace(/"/g, "")
href = href.replace(/fromid\=(.*)$/ig, "fromid=cnalichn" + encodeURIComponent(lastId));
alitalk.fromid = "cnalichn" + lastId;
}else{
href = href.replace(/fromid\=(.*)$/ig, "fromid=");
alitalk.fromid = "";
}
}
$(item).data("alitalk", alitalk);
$(item).attr("href", href);
});*/
});define(["jQuery","AppContext","part.SiteAlitalk2"],function(i,c,l){var o={init:function(c,o){this.div=c,this.config=o,this.collectShopGoldClick(c,o),new l(i("a.wangwang",c))},collectShopGoldClick:function(c){i(".collect\uff0dwp",c).click(function(){var i;window.dmtrack_pageid&&(i=dmtrack_pageid),window.goldlog&&goldlog.record("/1688-winport-element.click.shopclick","CLK","click_type=collectshop&page_id="+i,"H1511971673")})}};c.register("view","supplierInfoSmall",o)});
define([ 'jQuery', 'AppContext', 'Class', 'widget.VideoPlay', 'core.Remote'],function($, AppContext, Class, VideoPlay, Remote) {
var VideoSmall = Class({
init : function(div, config, data){
this.config = config;
this.isEdit = config.context.diy;
this.isTopDomain = config.context.isTopDomain;
this.data = data;
this.div = div;
this.mediaServer = config.mediaServer;
this._init();
},
_init:function(){
var self = this ;
if(self.data&&self.data.videoId){
/*Remote.callEvent('videoInfo', 'getVideoById', {
data: {
videoId: self.data.videoId,
_csrf_token: self.config.context.csrfToken
},
type: 'post',
success: function(data) {
if (data.result) {
self.render(data.result);
self.view(data.result);
}
},
error: function() {
}
})*/
jQuery.ajax({
url: '//web.archive.org/web/20220125223106/http://apps.1688.com/event/app/videoInfo/getVideoById.htm',
dataType: 'jsonp',
data: {
site_id: 'winport',
memberId: self.config.context.uid,
videoId: self.data.videoId,
_csrf_token: self.config.context.csrfToken || (iDetailConfig && iDetailConfig._csrf_token)
},
success: function(data) {
if (data && data.videoId) {
self.render(data);
self.view(data);
}
}
})
} else{
if(self.isEdit){
$('.vas_videoside_view', self.div).html('�㻹û�в���ʹ����Ƶ
');
self.view();
}
}
},
render:function(data){
var self = this;
if(self.data&&self.data.videoId) {
var config = data;
var a = [];
if(config.status=="online"){
a.push('');
if(!self.isTopDomain){
a.push('����������������Ƶ���泡�ء����ϼ��ز��ɻ�Ա�ṩ����Ƶ֮��ʵ�ԡ��Ϸ��Լ���������ɻ�Ա���и���
');
}
}else{
a.push('');
a.push('
');
a.push('- ');
a.push('
');
a.push('
');
}
$('.vas_videoside_view', self.div).html(a.join(''));
}
},
view:function(data){
var self = this;
if(self.data&&self.data.videoId) {
var self = this;
if(!self.isEdit){
if(data&&data.status=="online"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
/**
* ��Ƶ��ַ������swf,mp4,swf�ж�Ӧmp4��ַ
* cloud.video.taobao.com/play/u/959738568/p/1/e/1/t/1/46206138.swf �ж�Ӧ��MP4
* cloud.video.taobao.com/video/play/sid/26927/uid/Y254dWFud3UjODg=/from/3/v/1001/f/f.swf ��Ӧ��MP4��ʽ
* player.ku6.com/refer/GGLxHM3hCzOK77js/v.swf ��ӦMP4
*/
data && !$.isEmptyObject(data) && self.playVideo(data);
} else {
if(!self.isEdit){
if(data&&data.auditStatus=="approved"){
var elm = self.div.css("display","block").nextAll("div.mod");
if($.util.ua.ie67){
elm.each(function(){
var _elm = $(this);
//if(_elm.find(".wp-offerlist-windows").children().length>0){
var postition = _elm.css("position");
_elm.css("position","relative");
_elm.css("position",postition);
//}
});
}
}
}else{
self.div.closest('div.mod').css("display","block");
}
}
},
playVideo: function(data) {
var self = this;
var options = {
width: 190,
height: 184,
autoplay: false,
loop: false,
controls: true,
poster: data.extendInfo && data.extendInfo.coverImg || 'https://web.archive.org/web/20220125223106/https://img.alicdn.com/tfs/TB1RUrPaBTH8KJjy0FiXXcRsXXa-1125-618.png'
}
new VideoPlay($('.video-show', self.div), data.address, options);
}
});
AppContext.register('view', 'videoSmall', VideoSmall);
});
/**
* @fileoverview ��˾�����
*
* @author yefei.niuyf
*/
define(['jQuery', 'AppContext', 'widget.Util', 'widget.UI', 'widget.Paging', 'part.Album'],
function($, AppContext, Util, UI, Paging, album) {
var initConfig = {
"maxNum": "8",
"hasAlbums":true
};
var AutoAlbum = {
init : function(context,config,data){
$.extendIf(data,initConfig);
new album(context,config,data);
}
}
/**
* �������
*/
AppContext.register('view', 'autoAlbum', AutoAlbum);
});
/**
* �Ż�ȯ
*/
define(['jQuery', 'AppContext', 'Class'], function($, AppContext, Class) {
var View = new Class({
init: function(app, config) {
this.app = app;
this.handleHover();
this.initTabs();
},
handleHover: function() {
this.app.on('mouseenter', 'div.info', function() {
$(this).addClass('hover');
});
this.app.on('mouseleave', 'div.info', function() {
$(this).removeClass('hover');
});
},
initTabs: function() {
var self = this;
// tab����ڰ���첽��Ⱦʱ�����������������
// �������ӳٳ�ʼ��
setTimeout(function() {
$.use('ui-tabs-effect', $.proxy(self, '_initTabs'));
}, 2000);
},
_initTabs: function() {
var coupon = $('div.coupon', this.app),
items = $('ul.items', coupon);
items.tabs({
isAutoPlay: false,
boxSelector: 'li.item',
effect: 'scroll',
scrollType: 'loop'
});
coupon.on('click', 'a.prev', function(e) {
e.preventDefault();
items.tabs('prev');
});
coupon.on('click', 'a.next', function(e) {
e.preventDefault();
items.tabs('next');
});
}
});
//~ View
AppContext.register('view', 'productCoupon', View);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var IntelligentOfferSmall = new Class({
init : function(div, config, data) {
this.div = div;
this.config = config;
this.liSelector = '.offer-list-sub li';
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $(this.liSelector, this.div),
offers = this.config.offer;
offers && $.each(offers,function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleClickTrace: function() {
var self = this,
page = RecUtil.getPageParams();
$('li div.image,li div.title a',this.div).click(function(){
var item = $(this).closest('li').data('offer') || {};
// params = {
// page: page.nowinport ? 3 : 32, // same as ctr_type, which is 32 in free wp
// pid: page.pid,
// objectId: item.id,
// recId: page.recid,
// alg: item.alg || 0,
// objectType: 'offer',
// st_page_id: page.pageid,
// ver: 30, // default 30
// uid: Aliuser.getLastMemberId(),
// time: $.now()
// }
// var img = new Image();
// img.src = Util.formatUrl('//web.archive.org/web/20220125223106/http://stat.1688.com/bt/1688_click.html', params || {});
var param = {
page: page.nowinport ? 3 : 32, // same as ctr_type, which is 32 in free wp
pid: page.pid,
objectId: item.id,
recId: page.recid,
alg: item.alg || 0,
objectType: 'offer',
st_page_id: page.pageid,
ver: 30, // default 30
uid: Aliuser.getLastMemberId()
}
var gmImg = new Image();
gmImg.src = '//web.archive.org/web/20220125223106/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(param)) + '&time=' + $.now();
});
},
handleExposureTrace: function() {
var self = this,
lis = $(self.liSelector, 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,
page_id: page.pageid,
category_id: '',
object_type: 'offer',
object_ids: objectIds,
keyword: '',
page_size: '',
page_no: '',
uid: Aliuser.getLastMemberId(),
time: $.now()
};
var sendExposure = function(){
new Image().src = Util.formatUrl('//web.archive.org/web/20220125223106/http://ctr.1688.com/ctr.html', params || {});
new Image().src = '//web.archive.org/web/20220125223106/http://gm.mmstat.com/ctr.1688.2?gokey=' + encodeURIComponent($.param(param));
};
new LazyInitializer(this.div, sendExposure);
}
});
var RecUtil = {
getPageParams: function() {
var detail = window.iDetailConfig,
context = Component.getUserContext(),
memberId = context.uid,
nowinport = context.siteId === 'nowinportoffer',
pid = nowinport ? '819093_1008' :
detail ? '819095_1008' : '819094_1008',
recid = '1063';
return {
detail: detail,
uid: FE.util.loginId || -1,
recid: recid,
pageid: window.dmtrack_pageid,
pid: pid,
memberId: memberId,
nowinport:nowinport
}
}
};
AppContext.register('view', 'intelligentOfferSmall', IntelligentOfferSmall);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer', 'lofty/alicn/aliuser/1.0/aliuser'], function($, Class, AppContext, Component, Util, LazyInitializer, Aliuser) {
var AutoOfferSmall = new Class({
init : function(div, config, data) {
if(data.sortType !== 'recommend'){
return;
}
this.div = div;
this.config = config;
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $('.offer-list-sub li', this.div),
offers = this.config.offer;
offers && $.each(offers, function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleExposureTrace: function() {
var self = this,
lis = $('.offer-list-sub li', this.div),
offers = [];
lis.each(function(index) {
offers.push($(this).data('offer'));
});
var page = RecUtil.getPageParams(),
objectIds = $.map(offers, function(item) {
return item.id + ',' + (item.alg || 0);
}).join(';'),
params = {
ctr_type: page.nowinport ? 3 : 32,
page_area: page.recid,
interface_id: page.recid,
page_id: page.pageid,
object_type: 'offer',
object_ids: objectIds,
ctr_ns:'',
uid: Aliuser.getLastMemberId(),
time: $.now()
};
var sendExposure = function(){
new Image().src = Util.formatUrl('//web.archive.org/web/20220125223106/http://ctr.1688.com/ctr.html', params || {});
new Image().src = '//web.archive.org/web/20220125223106/http://gm.mmstat.com/ctr.1688.2?gokey=' + encodeURIComponent($.param(param));
}
new LazyInitializer(this.div, sendExposure);
},
handleClickTrace: function() {
var self = this,
page = RecUtil.getPageParams();
$(this.div).delegate('li div.image,li div.title a', 'click', function(){
var item = $(this).closest('li').data('offer') || {};
// params = {
// page: page.nowinport ? 3 : 32,
// objectId: item.id,
// recId: page.recid,
// interface_id: page.recid,
// alg: item.alg || 0,
// objectType: 'offer',
// st_page_id: page.pageid,
// ctr_ns:'',
// uid: Aliuser.getLastMemberId(),
// time: $.now()
// }
// var img = new Image();
// img.src = Util.formatUrl('//web.archive.org/web/20220125223106/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/20220125223106/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(gmParams)) + '&time=' + $.now();
});
}
});
var RecUtil = {
getPageParams: function() {
var nowinport = Component.getUserContext().siteId === 'nowinportoffer',
recid = '7103';
return {
recid: recid,
pageid: window.dmtrack_pageid,
nowinport:nowinport
}
}
};
AppContext.register('view', 'autoOfferSmall', AutoOfferSmall);
});
define(['jQuery', 'Class', 'AppContext', 'core.Component', 'widget.Util', 'widget.LazyInitializer'], function($, Class, AppContext, Component, Util, LazyInitializer) {
var AutoOfferSmall = new Class({
init : function(div, config, data) {
if(data.sortType !== 'recommend'){
return;
}
this.div = div;
this.config = config;
this._offerInfoProcess();
this.handleClickTrace();
this.handleExposureTrace();
},
_offerInfoProcess:function(){
var self = this,
lis = $('.offer-list-sub li', this.div),
offers = this.config.offer;
offers && $.each(offers, function(index, offer) {
lis.eq(index).data('offer', offer);
});
},
handleExposureTrace: function() {
var self = this,
lis = $('.offer-list-sub li', this.div),
offers = [];
lis.each(function(index) {
offers.push($(this).data('offer'));
});
var page = RecUtil.getPageParams(),
objectIds = $.map(offers, function(item) {
return item.id + ',' + (item.alg || 0);
}).join(';'),
params = {
ctr_type: page.nowinport ? 3 : 32,
page_area: page.recid,
interface_id: page.recid,
page_id: page.pageid,
object_type: 'offer',
object_ids: objectIds,
ctr_ns:'',
time: $.now()
};
var sendExposure = function(){
var img = new Image();
img.src = Util.formatUrl('https://web.archive.org/web/20220125223106/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/20220125223106/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/20220125223106/http://gm.mmstat.com/btob.35?gokey=' + encodeURIComponent($.param(gmParams)) + '&time=' + $.now();
});
}
});
var RecUtil = {
getPageParams: function() {
var nowinport = Component.getUserContext().siteId === 'nowinportoffer',
recid = '7103';
return {
recid: recid,
pageid: window.dmtrack_pageid,
nowinport:nowinport
}
}
};
AppContext.register('view', 'autoOfferSmall.detail', AutoOfferSmall);
});
/**
* ���ݰ�չ��
*/
define(['jQuery', 'Class', 'AppContext', 'widget.Util','widget.Dialog', 'core.Component'],
function($, Class, AppContext, Util, Dialog, Component) {
var OfferPackage = new Class({
init : function(div, config) {
var self = this;
self.config = config;
this.initDowload(div);
},
initDowload: function(div){
var self = this,
isLogin = Component.isLogin(),
isDiy = this.config.context.diy,
isTopDomain = this.config.context.isTopDomain;
//�����ذ�ť
if(isLogin && !isDiy){
//���ж��ļ��Ƿ�����¼�
$('a.fileName', div).bind('click',function(e){
e.preventDefault();
var url = $(this).data('fileurl');
self.checkExsitDialog(self,url);
});
}
if (isTopDomain) { //��������
var login = $('a.fileName', self.div),
loginUrl = null;
if (login.length) {
loginUrl = Util.formatUrl(login.attr('href'), {
targetUrl: window.location.href
});
login.attr('href', loginUrl);
}
} else {
if(!isLogin && !isDiy){
//��������
var login = $('.fileName', self.div);
if (login.length) {
$.add('wp-logist', {
css: ['https://web.archive.org/web/20220125223106/http://style.c.aliimg.com/sys/css/logist/logist.css'],
js: ['https://web.archive.org/web/20220125223106/http://style.c.aliimg.com/sys/js/logist/logist-min.js'],
ver: '1.0'
});
login.click(function(e) {
$.use("wp-logist", function(){
FE.sys.logist({
onLoginSuccess: function(){ //��½�ɹ���ص�����
window.location.reload();
},
onRegistSuccess: function(){ //ע��ɹ���ص�����
window.location.reload();
}
});
});
return false;
});
}
}
}
},
checkExsitDialog:function(self,url){
//�������
aliclick(this,'?tracelog=wp_widget_offerpackage_download');
//�����ж��ļ��Ƿ��������
$.ajax(self.config.checkUrl, {
dataType: 'jsonp',
data:{
url:encodeURI(url),
_input_charset:'UTF-8'
},
success:function(result) {
if(result === 'success'){
window.location.href = url;
window.location.target = "_blank";
}else if(result === 'failed'){
self.showDialog(self.configMap['exsitTip']);
}
},
error:function() {}
});
},
showDialog:function(dialogConfig){
var self = this;
var config = {
title:dialogConfig.dialogTitle,
className:'mod-uploader-dialog',
content: self.exsitContent(),
width:dialogConfig.width,
contentSuccess:$.proxy(self, dialogConfig.contentSuccess, this),
buttons:dialogConfig.buttons
};
self.dialog = new Dialog(config);
},
exsitContent:function(dialogConfig){
var template1 = ["
",
"
",
"
",
"
",
"
"].join('');
var template2 = ["
",
"
",
"
"].join('');
return template1 + "����ʧ�ܣ������صIJ�Ʒ���ݰ��ѱ�����ɾ�����ƶ�������ϵ����" + template2;
},
configMap: {
exsitTip:{
'dialogTitle':'��ʾ',
'width':450,
'contentHandler':'exsitContent',
'buttons':[{name: 'submit', text: 'ȷ��'}, {name: 'cancel', text:'ȡ��'}],
'beforeOpen':'closeDialog'
}
},
//�رնԻ���
closeDialog:function(dialog){
if(dialog){
dialog.close();
}
}
});
AppContext.register('view', 'offerPackage', OfferPackage);
});
define(['jQuery', 'Class', 'AppContext', 'widget.UI'],
function($, Class, AppContext,UI) {
var WinportFooter = new Class({
init : function(div, config) {
this.initShield(div);
this.bindEvent();
this.resetCss(div);
//�÷����dz���� ��Ϊ��������Ҳ��һ���ײ����� ��Ҫ��offerdetail�ĵ��������ص�
if(config.isJkWp){
$('#site_footer .app-footerNavigation .m-content').addClass('fd-hide');
}
},
initShield : function(div){
var imgs = $('img.shield-img',div);
UI.resizeImage(imgs, {height:70});
},
resetCss:function(div){
var layout_type=$("#site_footer").attr("data-layout-type");
if(layout_type&&"fluid"==layout_type){
//�����ȫ�����֣���û�б�Ҫ���ּ��
$(div).addClass("mod-winport_footer_no_margin");
}
//�����footNav app��û�б�Ҫ���ּ��
var footerNavigation=$("#site_footer").find(".app-footerNavigation");
if(footerNavigation.length>0){
$(div).addClass("mod-winport_footer_no_margin");
}
},
bindEvent:function(){
var self = this;
$('.icphref',this.div).on('click',function(e){
e.preventDefault();
var url = $(this).data('url');
if(url){
window.open(url);
}
});
}
});
AppContext.register('view', 'winport_footer', WinportFooter);
});
/**
* ʵ���̼�����ͷ��
* @author qijun.weiqj
*/
define(['jQuery', 'AppContext', 'core.AppLoader', 'widget.PlaceHolder', 'core.StyleLoader', 'core.Component', 'core.Remote', 'lofty/alicn/aliuser/1.0/aliuser', 'part.SiteAlitalk2'],
function ($, AppContext, AppLoader, PlaceHolder, StyleLoader, Component, Remote, Aliuser, SiteAlitalk) {
var Topbar = {
init: function (div, config) {
this.div = div;
this.config = config;
console.log('[TopNav] ===> config', config);
if (config.useAStorePageData) {
this.renderAStoreHeader(this.config);
return;
}
this.initDesignBar(); //��ʼ��designbar���������Ҳม��
this.initWW();
},
initDesignBar: function () {
var self = this,
designBar = $('
'),
siteContent = $('div#site_content');
if (this.config.context.uid === Aliuser.getLastMemberId() && this.config.context.pageType === 'index') {
$(this.div).append(designBar);
if (siteContent.length > 0) {
$(window).resize(function () {
designBar.css({right: ($('body').width() - siteContent.width()) / 2 - 10 - designBar.width()});
});
$(window).resize();
}
designBar.show();
}
},
initWW: function () {
new SiteAlitalk($("a.wangwang", this.div));
},
renderAStoreHeader: function (config) {
console.log('[TopNav] ===> render new page header', config);
// ��ҳ�����ݷŵ�ȫ��
AppContext.__astorePageData__ = config.astorePageData;
window.__astorePageData__ = config.astorePageData;
var moduleName = 'wp_pc_common_header';
var containNode = 'astore-header';
window.__oldPcWeb__
&& window.__oldPcWeb__.renderModule
&& window.__oldPcWeb__.renderModule(containNode, moduleName, config.astorePageData);
}
};
AppContext.register('view', 'topbar', Topbar);
});
define(["jquery","AppContext","Class","widget.VideoPlay","core.Remote","util.Util"],function(i,e,t,o,s,a){var l=new t({init:function(i,e){var t=this;t.config=e,t.div=i,s.callEvent("shopPropaganda","getPropaganda",{data:{memberId:t.config.context.uid,_csrf_token:t.config.context.csrfToken},type:"post",success:function(e){if(e.result){var s='
';if(s+='
',s+='
',s+='
'+a.escape(e.result.name)+"
",s+='
',s+='
',s+="
",s+="
",s+="
",t.div.append(s),t.container=i.find(".video-container"),t.videoInfo=e.result||{},"online"===e.result.status){var l=t.options={width:250,height:250,autoplay:!0,loop:!1,controls:!0,poster:e.result&&e.result.extendInfo&&e.result.extendInfo.coverImg||"https://web.archive.org/web/20220125223106/https://img.alicdn.com/tfs/TB1RUrPaBTH8KJjy0FiXXcRsXXa-1125-618.png",adaptShape:!0};t.smallVideo=new o(t.container,t.videoInfo.address,l),t.addSmallBtnEvent(),t.addBigBtnEvent(),t.adaptVerticalVideoSize(),t.bindPlayStatus()}else t.div.remove()}},error:function(){}})},addSmallBtnEvent:function(){var i=this;this.container.find(".vjs-control-bar").append('
'),this.container.find(".vjs-control-bar").append('
'),this.container.find(".show-big-video").on("click",function(){i.smallVideo.getVideoEl().muted=!1,i.clickShowBig()}),this.container.find(".close").fadeIn().on("click",function(){i.smallVideo.destroy(),i.div.remove()})},clickShowBig:function(){var i=this;i.toggleShowArrow(),i.showBigShadow(),i.smallVideo.getVideoEl().volume=i.volume||.5,i.volume=i.smallVideo.getVideoEl().volume,i.smallVideo.play(),i.playStatus="play"},addBigBtnEvent:function(){var i=this;this.container.find(".big-close").on("click",function(){i.playStatus="pause",i.container.find(".show-small-video").trigger("click"),setTimeout(function(){i.container.find(".show-small-video").removeClass("show-table-cell")})}),this.container.find(".show-small-video").on("click",function(){i.toggleShowArrow(),i.hideBigShadow(),i.volume=i.smallVideo.getVideoEl().volume,i.smallVideo.play(),i.smallVideo.getVideoEl().muted="play"==i.playStatus?!1:!0})},toggleShowArrow:function(){this.container.find(".show-big-video, .show-small-video").toggleClass("show-table-cell"),this.container.find(".close, .big-close").toggle()},hideBigShadow:function(){var e=this;this.div.removeClass("is-big"),i(".video-player",this.container).css({"max-width":""+this.options.width+"px","max-height":""+this.options.height+"px"}),e.isVerticalVideo&&i(e.smallVideo.video).css("max-height",""+this.options.height+"px")},showBigShadow:function(){var e=this;e.div.addClass("is-big"),i(".video-player",this.container).css({"max-height":"600px","max-width":"1000px"}),e.isVerticalVideo&&i(e.smallVideo.video).css("max-height","600px")},bindPlayStatus:function(){var i=this;i.smallVideo.on("video:play",function(){i.playStatus="play"}),i.smallVideo.on("video:pause",function(){i.playStatus="pause"})},adaptVerticalVideoSize:function(){var e=this;this.smallVideo.on("video:play",function(){setTimeout(function(){var t=i(e.smallVideo.video),o=t.data("has-fixed");!o&&t.height()>=t.width()?(e.isVerticalVideo=!0,t.css({width:"auto","max-height":""+e.options.height+"px"}),t.data("has-fixed",!0),e.container.css("visibility","visible")):o||(t.data("has-fixed",!0),e.container.css("visibility","visible"))},1e3)})}});e.register("view","shopPropaganda",l)});define(["jquery","AppContext","core.AppLoader"],function(i,e){var n={init:function(i,e){this.div=i,this.config=e,console.log("...invite diaolog ....."),e.hasInviteResult&&this.bindMsgRecive()},bindMsgRecive:function(){var i=this;window.addEventListener("message",function(e){var n=e.data||{};"inviteDialog"===n.origin&&"close"===n.action&&i.div.remove()})}};e.register("view","invite_dialog",n)});define(["jquery","AppContext"],function(n,o){var i={init:function(n,o){this.div=n,this.config=o,o.requestFromSync||(this.bindMsgRecive(),this.monitorScroll(o))},bindMsgRecive:function(){var n=this;window.addEventListener("message",function(o){var i=o.data||{};if("winportIframe"===i.origin&&"open"===i.action&&n.div.show().css(i.style),"winportIframe"===i.origin&&"close"===i.action&&n.div.empty().hide(),"winportIframe"===i.origin&&"login"===i.action){const e=window.location.href,t="https://web.archive.org/web/20220125223106/https://login.1688.com/member/signin.htm?Done="+encodeURIComponent(e);window.location.href=t}})},monitorScroll:function(o){o&&o.context&&"merchants"===o.context.pageType&&n(window).on("scroll",function(){document.querySelector("#embed_iframe").contentWindow.postMessage({type:"daifa"},"https://web.archive.org/web/20220125223106/https://tao.1688.com")})}};o.register("view","common_dialog",i)});
}
/*
FILE ARCHIVED ON 22:31:06 Jan 25, 2022 AND RETRIEVED FROM THE
INTERNET ARCHIVE ON 17:27:37 Nov 05, 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: 321.593
exclusion.robots: 0.076
exclusion.robots.policy: 0.068
cdx.remote: 0.056
esindex: 0.01
LoadShardBlock: 228.25 (3)
PetaboxLoader3.datanode: 60.424 (4)
load_resource: 107.553
PetaboxLoader3.resolve: 58.854
*/