layout.hbs 5.65 KB
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <title>{{title}}</title>
        <meta name="keywords" content="{{keywords}}">
        <meta name="description" content="{{description}}">
        <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" />
        {{#dnsPrefetch.hosts}}
            <link rel="dns-prefetch" href="{{this}}">
        {{/dnsPrefetch.hosts}}

        <script type="text/javascript">
            var isWechat = /micromessenger/i.test(navigator.userAgent || '');
            if (isWechat) document.title =document.title.replace(' | Yoho!Buy有货 | 潮流购物逛不停', '');
        </script>

        {{#if width750}}
        <script type="text/javascript">
            (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=750){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/750)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
        </script>
        {{^}}
        <script type="text/javascript">
            (function(d,c){var e=d.documentElement,a="orientationchange" in window?"orientationchange":"resize",b=function(){var f=e.clientWidth;if(!f){return}if(f>=640){e.style.fontSize="40px"}else{e.style.fontSize=40*(f/640)+"px"}};if(!d.addEventListener){return}b();c.addEventListener(a,b,false);d.addEventListener("DOMContentLoaded",b,false)})(document,window);
        </script>
        {{/if}}

        {{#if isWechat}}
        {{!--Android机器页面不再受到用户字体缩放强制改变大小 http://m.blog.csdn.net/article/details?id=51275080 --}}
        <script type="text/javascript">
            (function(){if(typeof(WeixinJSBridge)=="undefined"){document.addEventListener("WeixinJSBridgeReady",function(a){setTimeout(function(){WeixinJSBridge.invoke("setFontSizeCallback",{fontSize:0},function(b){})},0)})}else{setTimeout(function(){WeixinJSBridge.invoke("setFontSizeCallback",{fontSize:0},function(a){})},0)}})();
        </script>
        {{/if}}

        {{#if devEnv}}
            {{#if localCss}}
                <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/common.css">
            {{/if}}
            {{#ifor localCss vue}}
                <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
            {{^}}
                {{#if shopPage}}
                    <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/shop.css">
                {{^}}
                    <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css">
                {{/if}}
             {{/ifor}}
        {{^}}

            {{#if localCss }}
                <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/common.css">
            {{/if}}
            {{#ifor localCss vue}}
                <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
            {{^}}
                {{#if shopPage}}
                    <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/shop.css">
                {{^}}
                    <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/index.css">
                {{/if}}
            {{/ifor}}
        {{/if}}
        <link rel="apple-touch-icon-precomposed" href="http://static.yohobuy.com/m/v1/img/touch/apple-touch-icon-144x144-precomposed-new.png">
        <link rel="apple-touch-startup-image" sizes="640x920" href="http://static.yohobuy.com/m/v1/img/startup/startup-retina.png" media="screen and (max-device-width: 480px) and (-webkit-min-device-pixel-ratio: 2)">
        <link rel="apple-touch-startup-image" sizes="320x460" href="http://static.yohobuy.com/m/v1/img/startup/startup.png" media="screen and (max-device-width: 320)">
    </head>
    <body class="{{pageStyle}} {{#if isWechat}}wechat-body{{/if}} {{#if width750}}width750{{/if}} {{#if isPassportPage}}passport-body{{/if}} {{#if isStarIndexPage}}star-index-bg{{/if}} {{#if isStarDetailPage}}star-class-body{{/if}} {{#if isInstallmentPage}}installment-body{{/if}}">
        <div class="main-wrap">
            {{#if systemUpdate}}
                {{> updata}}
            {{/if}}

            {{#if showHeader}}
                {{#unless isApp}}
                    {{> header}}
                {{/unless}}
            {{/if}}

            {{{body}}}

            {{#unless isApp}}
                {{> footer}}
            {{/unless}}
        </div>

        {{> download-app}}
        {{#wechatShare}}
            <script type="text/javascript" src="//res.wx.qq.com/open/js/jweixin-1.1.0.js"></script>
        {{/wechatShare}}
        {{#if devEnv}}
            <script>var STATIC_RESOURCE_PATH = '//{{devHost}}:5001';</script>
            <script src="//{{devHost}}:5001/libs.js"></script>
            <script src="//{{devHost}}:5001/{{module}}.{{page}}.js"></script>
        {{^}}
            <script>var STATIC_RESOURCE_PATH = '//cdn.yoho.cn/m-yohobuy-node/assets';</script>
            <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/libs.js"></script>
            <script src="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
        {{/if}}
        {{#unless devEnv}}
        {{> analysis}}
        {{/unless}}
    </body>
</html>