layout.hbs 6.52 KB
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>{{title}}</title>
        <meta name="keywords" content="{{keywords}}">
        <meta name="description" content="{{description}}">
        {{#if cononicalURL}} <link rel="cononical" href="{{cononicalURL}}"/> {{/if}}
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
        <meta http-equiv="cleartype" content="on">
        <meta name="apple-mobile-web-app-status-bar-style" content="black" />
        <meta content="telephone=no" name="format-detection" />
        <meta content="email=no" name="format-detection" />
        <meta name="applicable-device"content="pc">
    {{#if mobileRefer}}
        <link rel="alternate" media="only screen and(max-width: 640px)" href="{{mobileRefer}}">
        <meta name="mobile-agent" content="format=html5;url={{mobileRefer}}">
    {{/if}}
        {{#dnsPrefetch.hosts}}
            <link rel="dns-prefetch" href="{{this}}">
        {{/dnsPrefetch.hosts}}
        <!--[if lt IE 9]>
        <script src="//cdn.yoho.cn/yohobuy-node/static/json2.js"></script>
        <![endif]-->
        <script>
            window._timeStart = Date.now();
            {{#ifand isProduction pc.open.bughd}}
            window._yohoAppName = 'yohobuy-node';
            
            !function(e){function t(n){if(r[n])return r[n].exports;var o=r[n]={exports:{},id:n,loaded:!1};return e[n].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){String.prototype.trim||(String.prototype.trim=function(){return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"")});var n=r(13),o=r(14);n.init(),o.init()},function(e,t){e.exports=function(e,t,r){if("undefined"==typeof t){var n=null;if(document.cookie)for(var o=document.cookie.split(";"),i=0;i<o.length;i++){var a=(o[i]||"").trim();if(a.substring(0,e.length+1)==e+"="){n=decodeURIComponent(a.substring(e.length+1));break}}return n}r=r||{},null===t&&(t="",r.expires=-1);var d="";if(r.expires&&("number"==typeof r.expires||r.expires.toUTCString)){var u;"number"==typeof r.expires?(u=new Date,u.setTime(u.getTime()+24*r.expires*60*60*1e3)):u=r.expires,d="; expires="+u.toUTCString()}var s=r.path?"; path="+r.path:"",p=r.domain?"; domain="+r.domain:"",c=r.secure?"; secure":"";document.cookie=[e,"=",encodeURIComponent(t),d,s,p,c].join("")}},,function(e,t,r){var n=r(1),o=window._yohoAppName||"unknown",i={config:{reportUrl:"//badjs.yoho.cn/apm/yas.gif"},stringify:function(e){for(var t=[],r=0;r<e.length;r++){var n=e[r],o=[];for(var i in n)n.hasOwnProperty(i)&&o.push(i+"::"+n[i]);t.push(o.join("$$"))}return t.join("**")},report:function(e,t){if(e){var r=new Image;r.src=this.config.reportUrl+"?s="+o+"&l="+e+"&t="+(new Date).getTime(),t&&t()}},getUdid:function(){var e=(n("yohobuy_session")||"").slice(2).split(".")[0];return e||0},getUid:function(){var e=(n("_UID")||"").split("::")[1];return e||0},getReqId:function(){return n("docreqid")||0}};e.exports=i},,,,,,,,,,function(e,t,r){var n=r(1),o=r(3),i="_errLog",a={writeError:function(e,t,r,a,d){var u=JSON.parse(n(i)||"[]");u.push({tp:"err",msg:e,sc:t,ln:r,cn:a,pt:encodeURIComponent(location.href),u:o.getUid(),ud:o.getUdid(),rid:o.getReqId(),st:JSON.stringify(d&&d.stack)}),n(i,JSON.stringify(u)),u.length>=5&&this.reportError()},clearError:function(){n(i,"[]")},reportError:function(){var e=this,t=JSON.parse(n(i)||"[]"),r=o.stringify(t);o.report(r,function(){e.clearError()})},init:function(){var e=this;window.onerror=function(t,r,n,o,i){e.writeError(t,r,n,o,i)},this.reportError()}};e.exports=a},function(e,t,r){function n(e){var t=e.offsetTop;return null!==e.offsetParent&&(t+=n(e.offsetParent)),t}var o=r(3),i=window.screen.height,a=[],d=!1,u=!1,s=0,p=setInterval(function(){var e,t;if(d){if(a.length)for(e=0;e<a.length;e++){if(t=a[e],!t.complete){u=!1;break}u=!0}else u=!0;u&&(s=(new Date).getTime()-_timeStart,clearInterval(p))}else{var r=document.body&&document.body.querySelectorAll("img")||[];for(e=0;e<r.length;e++){t=r[e];var o=n(t);if(o>i){d=!0;break}o<=i&&!t.hasPushed&&(t.hasPushed=1,a.push(t))}}},0),c={reportTime:function(e){var t=o.stringify(e);o.report(t)},addEvent:function(){var e=this,t=[],r=encodeURIComponent(location.href),n=o.getUid(),i=o.getUdid(),a=o.getReqId(),c=window.performance&&window.performance.timing.navigationStart||0;_timeStart=window._timeStart||0,document.addEventListener&&document.addEventListener("DOMContentLoaded",function(e){t.push({tp:"dcl",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:i,rid:a});var o=document.body&&document.body.querySelectorAll("img")||[];o.length||(d=!0)},!1),window.addEventListener&&window.addEventListener("load",function(o){t.push({tp:"ld",t:(new Date).getTime()-_timeStart,pt:r,u:n,ud:i,rid:a}),u=!0,d=!0,p&&clearInterval(p),s&&t.push({tp:"fs",t:s,pt:r,u:n,ud:i,rid:a}),t.push({tp:"pf",dcl:(window.performance&&window.performance.timing.domComplete||0)-c,ld:(window.performance&&window.performance.timing.loadEventStart||0)-c,pt:r,u:n,ud:i,rid:a}),e.reportTime(t)},!1)},init:function(){this.addEvent()}};e.exports=c}]);

            {{/ifand}}
        </script>

        {{#if devEnv}}
            <link rel="stylesheet" href="//{{devHost}}:5002/base.css">
            <link rel="stylesheet" href="//{{devHost}}:5002/{{#if cssModule}}{{cssModule}}.css{{^}}{{module}}.css{{/if}}">
        {{^}}
            <link rel="stylesheet" href="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/base.css">
            <link rel="stylesheet" href="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/{{#if cssModule}}{{cssModule}}.css{{^}}{{module}}.css{{/if}}">
        {{/if}}
    </head>
    <body>
        {{> mobile-refer}}

        {{> header}}
        {{> common/simple-header}}
        {{#if pageErr}}
            {{> 404}}
        {{^}}
            {{{body}}}
        {{/if}}
        {{> footer}}

        {{#if devEnv}}
            <script src="//{{devHost}}:5002/libs.js"></script>
            <script src="//{{devHost}}:5002/{{module}}.{{page}}.js"></script>
        {{^}}
            <script src="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/libs.js" crossorigin="anonymous"></script>
            <script src="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/{{module}}.{{page}}.js" crossorigin="anonymous"></script>
            {{> analysis}}
        {{/if}}

        <script>window.cdn='{{cdn}}';</script>
        <script>window._version='{{version}}';</script>
    </body>
</html>