//html root的字体计算应该放在最前面,这样计算就不会有误差了/ //2016.3.23 wjq update 之所以要加个判断返回一个20.5,是因为当用户在谷歌等浏览器直接输入手机端网站网址时,如果用户设置模块自定义样式的高度比较小,由于这时候的clientWidth为1920px,及返回的_htmlFontSize为40,这时候就会使模块太小,展示不完全,因此先取一个较为准确的值去展示。Mobi.resetHtmlFontSize()顺便也加了 var _htmlFontSize = (function(){ var clientWidth = document.documentElement ? document.documentElement.clientWidth : document.body.clientWidth; //if(clientWidth > 768) clientWidth = 768; if(clientWidth > 768 && clientWidth < 1280){ clientWidth = 768; }else if(clientWidth >= 1280){ clientWidth = 512; } document.documentElement.style.fontSize = clientWidth * 1/16+"px"; return clientWidth * 1/16; })();
//管理态下的预览页面提前作处理 之前这里的g_viewMode先去掉 if( !false && window.top !== window.self){ var g_className = document.getElementById("g_body").className; document.getElementById("g_body").className = g_className + " "; } var _oem = true; //用于iframe显示手机模板的时候 给g_web加上width var g_webWidth = 0; if(g_webWidth == 0){ g_webWidth = window.localStorage? localStorage.getItem("g_webWidth"): Cookie.read("g_webWidth"); if(g_webWidth != null){ document.getElementById("g_web").style.width = g_webWidth + "px"; } } else{ document.getElementById("g_web").style.width = g_webWidth + "px"; if (window.localStorage) { localStorage.setItem("g_webWidth", g_webWidth); } else { Cookie.write("g_webWidth", g_webWidth); } } var _faiAjax = function(){ //for regexp var r = /\?/; var _o = { type:"get", url:"", data:"", error:function(){}, success:function(){} }; var _sendRequest=function(o) { var xmlhttp = null; //init option code o.type = o.type || _o.type; o.url = o.url || _o.url; o.data = o.data || _o.data; o.error = o.error || _o.error; o.success = o.success || _o.success; if (window.XMLHttpRequest) { // code for IE7+, Firefox, Chrome, Opera, Safari xmlhttp = new XMLHttpRequest(); }else{ return; } //the instructions param takes the form of an eval statement if(o.type != "post") { o.url += ( this.r.test( o.url ) ? "&" : "?" ) + o.data; xmlhttp.open("GET", o.url, true); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { o.success( xmlhttp.responseText ); }else if( o.error ){ o.error(); } } xmlhttp.send(); } else { xmlhttp.open("POST", o.url, true); //Send the proper header information along with the request xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlhttp.onreadystatechange=function() { if (xmlhttp.readyState==4 && xmlhttp.status==200) { o.success( xmlhttp.responseText ); }else{ o.error(); } } xmlhttp.send(o.data); } } return { ajax:function(option){ try { //此次调用的错误不让抛出给window。防止函数重入 _sendRequest(option); }catch(e){ //alert(e); } } }; }(); var _jsErrCahche = []; window.onerror = function(sMsg,sUrl,sLine){ if (typeof Mobi == 'undefined') { if((window.DocumentTouch && document instanceof window.DocumentTouch) || 'ontouchstart' in document.documentElement){ alert('您的网页未加载完成,请尝试按“刷新”重新加载。'); }else{ alert('您的网页未加载完成,请尝试按“CTRL+功能键F5”重新加载。'); } } if( sLine < 1 || typeof sMsg != 'string' || sMsg.length < 1 ){ return; } var log = "Error:" + sMsg + ";Line:" + sLine + ";Url:" + sUrl + ";UserAgent:" + navigator.userAgent; var alertLog = "Error:"+sMsg+"\n" + "Line:" + sLine + "\n" + "Url:" + sUrl + "\n"; var encodeUrl = function (url){ return typeof url === "undefined" ? "" : encodeURIComponent(url); }; var ajax = true; var obj = { 'm' : sMsg, 'u' : sUrl, 'l' : sLine }; for( var i = 0; i < _jsErrCahche.length; i ++ ){ if( _jsErrCahche[i].m == obj.m && _jsErrCahche[i].u == obj.u && _jsErrCahche[i].l == obj.l ){ ajax = false; break; } } if( ajax ){ _jsErrCahche.push( obj ); _faiAjax.ajax({ type : "post", url : "ajax/logJsErr.jsp?cmd=jsErr", data : 'msg='+ encodeUrl(/Other/m/log/index.html) }); } if(false){ console.log( alertLog ); } }; if (typeof Fai == 'undefined'){ Fai = {}; //解决页面被嵌套在iframe的场景 Fai.top = window; } Fai.top._isFaiHost = false; Fai.top._bannerData = {"h":false,"bn":2,"b":[{"i":"50001","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50001.jpg","du":"&v=","p":"http:/image/banners/50001.jpg?v=20121209","w":640,"h":300},{"i":"50004","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50004.jpg","du":"&v=","p":"http:/image/banners/50004.jpg?v=20121209","w":640,"h":300}],"showType":2,"st":8,"et":13,"c":[],"atOnce":false}; //横幅数据 Fai.top._resRoot = 'http://mo.faisys.com'; Fai.top._templateFrameId = 341; Fai.top._templateLayoutId = 4; Fai.top._mobiSiteTitleChanged = 0; //用于记录网站标题是否有改动 Fai.top._mobiSiteTitle = {"fontType":0,"align":0,"font":{"size":12,"family":"","colorType":0,"color":"#000"},"bgType":"0","bgFont":{"color":"#000","alpha":100},"bgImgFileId":"","bgImgStyle":"1","name":"北京网站建设公司(威思瑞)","mbt":0,"mbc":{"color":"#000","alpha":100},"mbi":"","mbit":1,"mths":0}; //网站标题数据 Fai.top._onlineServiceJson = {"phone":{"open":true,"type":1,"fName":"电话咨询","phoneInfo":[{"name":"电话咨询","number":"13681092967"}],"typeStr":"phone","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-call1","content":"\\e62c","color":"","iconFileId":""}},"sms":{"open":true,"name":"信息咨询","number":"13681092967","type":2,"typeStr":"sms","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-mail1","content":"\\e6a0","color":"","iconFileId":""}},"map":{"open":false,"name":"在线地图","city":"","mark":"","d_address":"","type":3,"typeStr":"map","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-gps1","content":"\\e67c","color":"","iconFileId":""}},"msg":{"open":true,"name":"在线留言","type":4,"typeStr":"msg","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-message1","content":"\\e6b2","color":"","iconFileId":""}},"qq":{"open":true,"type":5,"fName":"QQ客服","qqInfo":[{"name":"QQ客服","number":"563277797"}],"typeStr":"qq","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-qq1","content":"\\e6ca","color":"","iconFileId":""}},"open":true,"order":[2,1,5,4,3],"serviceId":{"serviceId":6},"baiduBridge":{"open":false,"name":"百度商桥","type":-1,"codes":"","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-scBdsq2","content":"\\eada","color":"","iconFileId":"iconFileId"}},"weChat":{"open":false,"name":"微信客服","type":-2,"code":"","baseSetting":{"c":0,"i":0,"id":0,"iconType":0,"colIconType":0,"colIconCusType":0,"classname":"faisco-icons-M001038","content":"\\eb25","color":"","iconFileId":""}}};//在线客服 Fai.top._openOnlineService = true; Fai.top._manageMode = false; Fai.top.sessionMemberId = 0; Fai.top.memberName = ""; Fai.top._colInfo = {"aid":9116660,"wid":0,"id":3,"type":3,"flag":0,"moduleList":[306,302,301],"moduleHidden":[],"createTime":1460447290000,"updateTime":1486528783000,"authMemberLevelId":0,"extId":0,"other":{"pgt":0,"pgb":{"type":0,"catalogList":[],"s":4}},"name":"首页","defaultName":"首页","url":"/index.jsp","valid":true,"baseSetting":{"c":0,"i":0,"iconType":0,"id":0,"content":"","classname":"","color":"","colIconType":0,"colIconCusType":0,"iconFileId":"","jumpCtrl":{"ide":"","columnType":0}},"columnStyle":{"s":2},"title":{"fontType":0,"align":0,"font":{"size":12,"family":"","colorType":0,"color":"#000"},"bgType":"0","bgFont":{"color":"#000","alpha":100},"bgImgFileId":"","bgImgStyle":"1","mbt":0,"mbc":{"color":"#000","alpha":100},"mbi":"","mbit":1,"mths":0},"logo":{"i":"","h":true,"a":1,"style":0,"marginType":0,"margin":{"top":0,"bottom":0,"left":0,"right":0}},"banner":{"showType":0,"h":false,"bn":1,"b":[{"i":"1","t":0}],"st":6,"et":1,"c":[]},"independent":false,"allowed":true,"selectable":true,"forbid":false}; Fai.top._lcid = 2052; // 当前的语言版本 Fai.top._serviceList = [{"serviceType":"0","serviceAccount":"10000","showFont":"QQ客服","showType":true,"isFontIcon":"true","color":"rgb(238, 82, 102)","fileId":"","classname":"faisco-icons-scQq","filePath":""}]; //商城主题在线客服 Fai.top._mallService = 0; Fai.top.inTabMaqueeHelper = {}; // 记录标签模块内子模块的动画函数 Fai.top._webDebug = false; // 本地环境(独立开发也是true) jm(document).ready(function() { Mobi.ajaxLoadModuleDom(3, 0, {"_ajaxLoadModuleIDList":[],"fullUrl":"http://m.veeceri.com/index.jsp","topBarOptionInfo":{"mobiMallOpen":false}}); //判断该栏目是否被删除 if(jm.isEmptyObject(Fai.top._colInfo)){ alert("该栏目已经删除,点击确定后,将返回到首页"); document.location.href = "/index.jsp" } //Mobi.viewPageBeforeInit(); // 绑定退出事件 jm(window).bind("load", function() { //当前模块 start //Mobi.initSwipe('bannerSwipe',{"h":false,"bn":2,"b":[{"i":"50001","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50001.jpg","du":"&v=","p":"http:/image/banners/50001.jpg?v=20121209","w":640,"h":300},{"i":"50004","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50004.jpg","du":"&v=","p":"http:/image/banners/50004.jpg?v=20121209","w":640,"h":300}],"showType":2,"st":8,"et":13,"c":[],"atOnce":false}); if(!Mobi.bannerAnimate.init( {"h":false,"bn":2,"b":[{"i":"50001","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50001.jpg","du":"&v=","p":"http:/image/banners/50001.jpg?v=20121209","w":640,"h":300},{"i":"50004","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50004.jpg","du":"&v=","p":"http:/image/banners/50004.jpg?v=20121209","w":640,"h":300}],"showType":2,"st":8,"et":13,"c":[],"atOnce":false})){ Mobi.initBannerDefaultDom({"h":false,"bn":2,"b":[{"i":"50001","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50001.jpg","du":"&v=","p":"http:/image/banners/50001.jpg?v=20121209","w":640,"h":300},{"i":"50004","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50004.jpg","du":"&v=","p":"http:/image/banners/50004.jpg?v=20121209","w":640,"h":300}],"showType":2,"st":8,"et":13,"c":[],"atOnce":false}); Mobi.initSwipe('bannerSwipe',{"h":false,"bn":2,"b":[{"i":"50001","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50001.jpg","du":"&v=","p":"http:/image/banners/50001.jpg?v=20121209","w":640,"h":300},{"i":"50004","t":0,"lt":0,"u":"","ide":"","col":0,"aj":"","tp":"http:/image/bannerPreview/50004.jpg","du":"&v=","p":"http:/image/banners/50004.jpg?v=20121209","w":640,"h":300}],"showType":2,"st":8,"et":13,"c":[],"atOnce":false}); }; //调整导航栏与g_web的top值 //部分主题有css3动画,所以会导致计算失误,需要等css3动画执行完之后计算 Mobi.autoFixGWebTop(4); Mobi.initBgmCookie(); Mobi.initFooterHeight(); }); //手机视图初始化函数 Mobi.initMobiPage({"id":341,"createTime":"2014-09-28","preview":"http:/image/template/341/341.jpg","previewGif":"","color":32,"style":"http://mo.faisys.com/css/template/341.min.css?v=201711250607","type":0,"moduleStyle":0,"designType":0,"presetIndex":0,"cube":3,"layout":4,"imagePage":310,"backgroundImage":0,"colors":[32],"colorsName":["黄橙"]}); // 取统计数据 if(true) { Mobi.statisticalMobiVisitors({colId:3, pdId:-1, ndId:-1, sc:0, rf:"http://www.veeceri.com/", statId:-1}); if(!false){ //统计访问时长 Mobi.mobiStatVisitTime(); } } //前端性能数据上报 Mobi.report(); // 用于添加分销的标识码 dannel Mobi.addDistCode(); Mobi.initShare('footerShareWeixin','footerShareWeibo','footerShareQQ'); Mobi.initFooterLanguageEvent(); Mobi.showQqBg(); Mobi.showPhonesBg(); Mobi.unLoadForWechat(); Mobi.setShowSiteTitleBgFlag('0'); Mobi.changeSiteTitleBg('null','null','null','null','null'); Mobi.logoSizeCompressByMargin(); Mobi.titlePositionRefreshByLogo(); Mobi.initModuleCubeNavItemHeight(3,306); Mobi.loadImgAlone(306);Mobi.fixIphoneMargin({moduleId:302}); Mobi.showMallCartScreen(301,'¥',false,100.0,"\x3cdiv class=\x27productMallOptionHead\x27\x3e\x3cdiv class=\x27productMallOptionImage\x27\x3e\x3cdiv class=\x27productMallOptionImageContent\x27\x3e\x3cspan class=\x22imageMiddleSpan\x22\x3e\x3c/span\x3e\x3cimg class=\x27mallOptionImg\x27 src=/Other/m/x27/x27/index.html /\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\x27productDetail\x27\x3e\x3cdiv class=\x27productDetailName\x27\x3e\x3c/div\x3e\x3cdiv class=\x27productDetailMallAmount\x27\x3e\x3cdiv class=\x27productMallAmount\x27 style=\x27float:left\x27\x3e\x3c/div\x3e\x3cdiv class=\x27productMallWeight\x27 style=\x27float:left;margin-left:0.5rem;\x27\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\x27g_separator separatorLine\x27\x3e\x3c/div\x3e\x3cdiv class=\x27mallOptionAndNumBox\x27 id=\x27mallOptionAndNumContainer\x27 \x3e \x3cdiv id=\x27mallOptionAndNumBox\x27 \x3e\x3cdiv class=\x27mallNewOptionBox mallOptionBox J-op-box\x27\x3e\x3c/div\x3e\x3cdiv class=\x27g_separator separatorLine\x27 style=\x27margin-left: 0.5rem;\x27\x3e\x3c/div\x3e\x3cdiv class=\x27productNumberPanel g_middleColor\x27\x3e\x3cspan\x3e购买数量\x3c/span\x3e\x3cdiv id=\x27limitAmountDiv\x27 style=\x27line-height:0.7rem; font-family:微软雅黑; color:#828282; width:9rem;\x27\x3e\x3c/div\x3e\x3cdiv class=\x27productNumberContent\x27\x3e\x3cspan id=\x27g_decrease\x27 class=\x27g_decrease g_opacity50 icon-decrease g_iconMiddle\x27\x3e\x3c/span\x3e\x3cinput type=\x27number\x27 class=\x27g_buyNumber\x27 id=\x27productNum\x27 autocomplete=\x27off\x27 value=\x271\x27 min=\x271\x27 max=\x279999999\x27 /\x3e\x3cspan id=\x27g_increase\x27 class=\x27g_increase icon-increase g_iconMiddle\x27\x3e\x3c/span\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3c/div\x3e\x3cdiv class=\x27productMallShop\x27\x3e\x3cdiv id=\x27productBuy\x27 class=\x27productAddMall g_mallButton2 g_color g_bdColor\x27\x3e加入购物车\x3cspan class=\x27\x27\x3e\x3c/span\x3e\x3c/div\x3e\x3cdiv id=\x27g_web\x27 class=\x27J_productImmediatelyBug productImmediatelyBug g_mallButton2 g_bdColor g_bgColor\x27\x3e立即购买\x3c/div\x3e\x3c/div\x3e"); Mobi.loadImgAlone('301'); // 访客态页面提示错误 if(!Fai.top._manageMode ){ errnoIng(); } setTimeout("hasOpenFaiscoBaiduBridge()",1000);//延迟一秒,等待百度商桥加载完成 initManagePage(); }); //针对管理态做初始化 by jser 2017-10-23 function initManagePage(){ var isManageMode = (Fai.top._manageMode === true); if(!isManageMode){ return; } Fai.top.Mobi.logDogWithInitManagePage(); } // 获取url参数 function getUrlQueryString(name){ var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if(r!= null){ return unescape(r[2]); } return null; } // 页面错误提示 function errnoIng(){ // 获取参数errno var errno = getUrlQueryString("errno"); if(errno == 14){ Mobi.ing(LS.memberLoginNoPermission); } } //Mobi.preventScroll(document.getElementById("g_body"));//阻止滚轮事件冒泡 //访客态下,统计微信浏览器的使用情况 if(Mobi.isWechat()){ Mobi.logDog(200055, 1); }else{ Mobi.logDog(200055, 0); } //管理下,禁止点击跳转外链 //接入我们的百度商桥才隐藏默认的图标 function hasOpenFaiscoBaiduBridge(){ if (Fai.top._mallService == 2) { //商城主题 for(var i in Fai.top._serviceList) { if ( Fai.top._serviceList[i].serviceType == 2) { if ( Fai.top._serviceList[i].showType == true) { Fai.top.Mobi.getPreviewWindow().jm("ins#newBridge").hide(); break; } else { Fai.top.Mobi.getPreviewWindow().jm("ins#newBridge").show(); break; } } else { Fai.top.Mobi.getPreviewWindow().jm("ins#newBridge").show(); } } } else { //非商城主题 if (Fai.top._onlineServiceJson.baiduBridge.open == true) { Fai.top.Mobi.getPreviewWindow().jm("ins#newBridge").hide(); } else { Fai.top.Mobi.getPreviewWindow().jm("ins#newBridge").show(); } } //百度商桥统计 jm("#newBridge #nb_icon_wrap").off('click.log').on('click.log', function(){ Mobi.logDog(200171, 5); }); } //解决苹果手机浏览模板网站,右下角的手机模板显示不正常的bug