(function(){ var loc = window.location, host = loc.host, port = loc.port, $website = 'https://www.welan.com/', $staticWebsite = 'http://static.welan.com/', $ssologin = 'https://www.welan.com/passport/tologin'; $imgSite = 'http://img.welan.com/'; //开发状态 $basePath= '/resources/js/'; //KISSY.config("debug",true); $libUrl= '/resources/'; //部署状态 //$basePath= 'http://static.welan.com/resources/build/js/'; KISSY.config("debug",false); //$libUrl= 'http://static.welan.com/resources/build/'; PW_CONFIG = { host : host, website: $website, ssoLogin:$ssologin, imgSite:$imgSite, libUrl : $libUrl, libTag:'2016110213', appTag: '2016110213', pkgs:[{ name:'app', path: $basePath + 'mall/', charset:'utf-8' }], appParams:{ //登录 login:{ loginCheckUrl: '/user/isLogin' //接口具体使用参看接口文档 }, //收藏 fav:{ favAddUrl: '/vip/bookmark/ajax/add' }, //获取银行列表 bank: { //获取在线支付银行列表 olPayListUrl: '/order/orderpay/getPayTypesByType' }, cart: { add: '/order/cart/ajax/add', batchAdd: '/order/cart/batch/ajax/add' }, book:{ //判断一本书是否还可以购买 bookAvlb: '/order/cart/ajax/currentUserAvailableBookNum' } }, modSettings:{ dialog:{ maskOpacity: 0.2, position: 'fixed', top: 150, header: true, themeUrl: '/resources/css/mall/dialog.css' }, pagination: { themePackage: { "default": { "showCounter": true, "themeCounter": "共{pageCount}页", "showJump": true, "themeJump": "到第{input}页{button}", "showPageNum": true, "themeCss": "J_pagination_theme1", "firstPageTip": "首页", "lastPageTip": "尾页", "showFirst": false, "showLast": false, "prevPageTip": "上一页", "nextPageTip": "下一页" }, "b": { "themeCounter": "{page}/{pageCount}", "showJump": false, "themeJump": "跳到第{input}页{button}", "showPageNum": false, "themeCss": "J_pagination_theme2", "firstPageTip": "<<", "lastPageTip": ">>", "showFirst": false, "showLast": false, "prevPageTip": "<", "nextPageTip": ">" }, "a": { "showCounter": true, "themeCounter": "{page}/{pageCount}", "showJump": true, "themeJump": " goto{input}页{button}", "showPageNum": true, "themeCss": "J_pagination_theme5", "firstPageTip": "首页", "lastPageTip": "尾页", "showFirst": true, "showLast": true, "prevPageTip": "<", "nextPageTip": ">" }, "c": { "showCounter": true, "themeCounter": "{page}/{pageCount}", "showJump": true, "themeJump": " 跳到第{input}页{button}", "showPageNum": true, "themeCss": "J_pagination_theme3", "firstPageTip": "<<", "lastPageTip": ">>", "showFirst": true, "showLast": true, "prevPageTip": "<", "nextPageTip": ">" }, "d": { "showCounter": true, "themeCounter": "{page}/{pageCount}", "showJump": true, "themeJump": " goto{input}页{button}", "showPageNum": true, "themeCss": "J_pagination_theme4", "firstPageTip": "<<", "lastPageTip": ">>", "showFirst": true, "showLast": true, "prevPageTip": "<", "nextPageTip": ">" }, "e": { "showCounter": true, "themeCounter": "{page}/{pageCount}", "showJump": true, "themeJump": " goto{input}页{button}", "showPageNum": true, "themeCss": "J_pagination_theme4", "firstPageTip": "<<", "lastPageTip": ">>", "showFirst": true, "showLast": true, "prevPageTip": "<", "nextPageTip": ">" } } } } }; })(); (function(S) { //构建基础类中最重要PW类,基础库将许多第三方库和插件合并到PW上,供同意调用 window.PW = PW = S.mix(S,{},true,[],true); //获取配置信息 S.mix(PW,PW_CONFIG); //第三方类库包 var libTag = (PW.libTag && S.isString(PW.libTag))? PW.libTag : 'stable', appTag = (PW.appTag && S.isString(PW.appTag))? PW.appTag : 'stable'; S.config({ packages : [{ name : "thirdparty", //包名 tag : libTag, //时间戳, 添加在动态脚本路径后面, 用于更新包内模块代码 path : $basePath + "base/lib/", //包对应路径, 相对路径指相对于当前页面路径 charset : "utf-8" //包里模块文件编码格式 }] }); //引入的插件包 S.config({ packages : [{ name : "plugins", //包名 tag : libTag, //时间戳, 添加在动态脚本路径后面, 用于更新包内模块代码 path : PW.libUrl + "js/base/", //包对应路径, 相对路径指相对于当前页面路径 charset : "utf-8" //包里模块文件编码格式 }] }); //引入模块包 S.config({ packages : [{ name : "mod", //包名 tag : libTag, //时间戳, 添加在动态脚本路径后面, 用于更新包内模块代码 path : $basePath + "base/", //包对应路径, 相对路径指相对于当前页面路径 charset : "utf-8" //包里模块文件编码格式 }] }); //根据项目配置的静态资源地址写入app包路径 S.config({ packages : [{ name : "app", //包名 tag : appTag, //时间戳, 添加在动态脚本路径后面, 用于更新包内模块代码 path : PW.staticWebsite + "js/", //包对应路径, 相对路径指相对于当前页面路径 charset : "utf-8" //包里模块文件编码格式 }] }); //如果pkgs存在,则自动配置包,这是对蔚蓝整体项目的一个高级配置,或者叫妥协吧 if(PW_CONFIG.pkgs && S.isArray(PW_CONFIG.pkgs)){ S.each(PW_CONFIG.pkgs,function(o){ S.config({ packages : [{ name : o.name, //包名 tag : appTag, //时间戳, 添加在动态脚本路径后面, 用于更新包内模块代码 path : o.path, //包对应路径, 相对路径指相对于当前页面路径 charset : o.charset //包里模块文件编码格式 }] }); }) } //预加载配置中定义的模块 var preprcs = 0, l = 0; if(S.isArray(PW.preload) && PW.preload.length > 0) { l = PW.preload.length; for(var i in PW.preload) { S.use(PW.preload[i],function(){preprcs++;}); } } function ready(callback){ if(l <=0) {callback(); return;} var check = function(){ if(preprcs == l){ stop(); callback(); } }, timer = window.setInterval(check,100), stop = function(){ window.clearInterval(timer); } } PW.ready = ready; })(KISSY); //百度统计代码 (function() { console.log("一张网页,要经历怎样的过程,才能抵达用户面前?\n一位新人,要经历怎样的成长,才能站在技术之巅?\n探寻这里的秘密;\n体验这里的挑战;"); console.log("惊不惊喜?意不意外?"); try { var $_console$$ = console; Object.defineProperty(window, "console", { get: function() { if ($_console$$._commandLineAPI) throw "抱歉, 为了用户安全, 本网站已禁用console脚本功能"; return $_console$$ }, set: function($val$$) { $_console$$ = $val$$ } }) } catch ($ignore$$) { } })();