Showing
23 changed files
with
83 additions
and
111 deletions
@@ -5,45 +5,12 @@ | @@ -5,45 +5,12 @@ | ||
5 | <meta name="apple-mobile-web-app-capable" content="yes"> | 5 | <meta name="apple-mobile-web-app-capable" content="yes"> |
6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0 user-scalable=no"> | 6 | <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0 user-scalable=no"> |
7 | <meta content="telephone=no" name="format-detection"> | 7 | <meta content="telephone=no" name="format-detection"> |
8 | - <script type="text/javascript"> | ||
9 | - (function (doc, win) { | ||
10 | - var docEl = doc.documentElement, | ||
11 | - resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | ||
12 | - recalc = function () { | ||
13 | - var clientWidth = docEl.clientWidth; | ||
14 | - if (!clientWidth) { | ||
15 | - return; | ||
16 | - } | ||
17 | - docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
18 | - }; | ||
19 | - | ||
20 | - if (!doc.addEventListener) { | ||
21 | - return; | ||
22 | - } | ||
23 | - win.addEventListener(resizeEvt, recalc, false); | ||
24 | - doc.addEventListener('DOMContentLoaded', recalc, false); | ||
25 | - })(document, window); | ||
26 | - </script> | ||
27 | - <link rel="stylesheet" href="../css/detail.css"> | 8 | + {{> header}} |
28 | </head> | 9 | </head> |
29 | <body> | 10 | <body> |
30 | - <div id="detail-container" class="detail-container" style="display:none"> | 11 | + <div id="container" class="hide"> |
31 | {{{body}}} | 12 | {{{body}}} |
32 | </div> | 13 | </div> |
33 | </body> | 14 | </body> |
34 | - <script src="//localhost:5000/dist/all-debug.js"></script> | ||
35 | - <script type="text/javascript"> | ||
36 | - seajs.use(['jquery/1.8.3/jquery-debug', | ||
37 | - 'yohobuy-mobile/1.0.0/public/js/article-type-three-debug', | ||
38 | - 'yohobuy-mobile/1.0.0/public/js/detail-debug'], function($, article, detail) { | ||
39 | - $(".detail-container").show(); | ||
40 | - if (article) { | ||
41 | - article.init(); | ||
42 | - } | ||
43 | - | ||
44 | - if(detail) { | ||
45 | - detail.init(); | ||
46 | - } | ||
47 | - }); | ||
48 | - </script> | 15 | + {{> footer}} |
49 | </html> | 16 | </html> |
mobile/public/js/detail-footer.js
0 → 100644
1 | +seajs.use(['jquery/1.8.3/jquery-debug', | ||
2 | + 'yohobuy-mobile/1.0.0/public/js/article-type-three-debug', | ||
3 | + 'yohobuy-mobile/1.0.0/public/js/detail-debug'], function($, article, detail) { | ||
4 | + | ||
5 | + $("#container").removeClass('hide'); | ||
6 | + | ||
7 | + if (article) { | ||
8 | + article.init(); | ||
9 | + } | ||
10 | + | ||
11 | + if(detail) { | ||
12 | + detail.init(); | ||
13 | + } | ||
14 | +}); |
mobile/public/js/detail-optimize-footer.js
0 → 100644
1 | +seajs.use(['jquery/1.8.3/jquery-debug', | ||
2 | + 'yohobuy-mobile/1.0.0/public/js/article-type-three-optimize-debug', | ||
3 | + 'yohobuy-mobile/1.0.0/public/js/detail-debug'], function($, article, detail) { | ||
4 | + | ||
5 | + $("#container").removeClass('hide'); | ||
6 | + | ||
7 | + if (article) { | ||
8 | + article.init(); | ||
9 | + } | ||
10 | + | ||
11 | + if(detail) { | ||
12 | + detail.init(); | ||
13 | + } | ||
14 | + | ||
15 | +}); |
@@ -6,15 +6,19 @@ | @@ -6,15 +6,19 @@ | ||
6 | var data = require('../../public/js/data.js')(); | 6 | var data = require('../../public/js/data.js')(); |
7 | 7 | ||
8 | exports.show = function(req, res) { | 8 | exports.show = function(req, res) { |
9 | - res.render('detail', { | 9 | + res.render('guang/detail', { |
10 | detail: data, | 10 | detail: data, |
11 | - layout: '../layouts/layout' | 11 | + layout: '../layouts/layout', |
12 | + css: '../css/detail.css', | ||
13 | + usejs: 'detail-footer' | ||
12 | }); | 14 | }); |
13 | }; | 15 | }; |
14 | 16 | ||
15 | exports.optimize = function(req, res) { | 17 | exports.optimize = function(req, res) { |
16 | - res.render('detail-optimize', { | 18 | + res.render('guang/detail-optimize', { |
17 | detail: data, | 19 | detail: data, |
18 | - layout: '../layouts/layout-optimize' | 20 | + layout: '../layouts/layout', |
21 | + css: '../css/detail.css', | ||
22 | + usejs: 'detail-optimize-footer' | ||
19 | }); | 23 | }); |
20 | } | 24 | } |
mobile/views/detail.html
deleted
100644 → 0
1 | <div id="wrapper"> | 1 | <div id="wrapper"> |
2 | <div id="scroller"> | 2 | <div id="scroller"> |
3 | {{# detail}} | 3 | {{# detail}} |
4 | - {{> article_author}} | ||
5 | - {{> article}} | ||
6 | - {{> related_brand}} | ||
7 | - {{> article_tag}} | ||
8 | - {{> related_post}} | 4 | + {{> guang/article_author}} |
5 | + {{> guang/article}} | ||
6 | + {{> guang/related_brand}} | ||
7 | + {{> guang/article_tag}} | ||
8 | + {{> guang/related_post}} | ||
9 | {{/ detail}} | 9 | {{/ detail}} |
10 | </div> | 10 | </div> |
11 | </div> | 11 | </div> |
mobile/views/guang/detail.html
0 → 100644
mobile/views/partials/article.html
deleted
100644 → 0
1 | -<!DOCTYPE html> | ||
2 | -<html> | ||
3 | - <head> | ||
4 | - <title></title> | ||
5 | - <meta name="apple-mobile-web-app-capable" content="yes"> | ||
6 | - <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0 user-scalable=no"> | ||
7 | - <meta content="telephone=no" name="format-detection"> | ||
8 | - <script type="text/javascript"> | ||
9 | - (function (doc, win) { | ||
10 | - var docEl = doc.documentElement, | ||
11 | - resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | ||
12 | - recalc = function () { | ||
13 | - var clientWidth = docEl.clientWidth; | ||
14 | - if (!clientWidth) { | ||
15 | - return; | ||
16 | - } | ||
17 | - docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; | ||
18 | - }; | ||
19 | - | ||
20 | - if (!doc.addEventListener) { | 1 | +<script type="text/javascript"> |
2 | + (function (doc, win) { | ||
3 | + var docEl = doc.documentElement, | ||
4 | + resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize', | ||
5 | + recalc = function () { | ||
6 | + var clientWidth = docEl.clientWidth; | ||
7 | + if (!clientWidth) { | ||
21 | return; | 8 | return; |
22 | } | 9 | } |
23 | - win.addEventListener(resizeEvt, recalc, false); | ||
24 | - doc.addEventListener('DOMContentLoaded', recalc, false); | ||
25 | - })(document, window); | ||
26 | - </script> | ||
27 | - <link rel="stylesheet" href="../css/detail.css"> | ||
28 | - </head> | ||
29 | - <body> | ||
30 | - <div id="detail-container" class="detail-container" style="display:none"> | ||
31 | - {{{body}}} | ||
32 | - </div> | ||
33 | - </body> | ||
34 | - <script src="//localhost:5000/dist/all-debug.js"></script> | ||
35 | - <script type="text/javascript"> | ||
36 | - seajs.use(['jquery/1.8.3/jquery-debug', | ||
37 | - 'yohobuy-mobile/1.0.0/public/js/article-type-three-optimize-debug', | ||
38 | - 'yohobuy-mobile/1.0.0/public/js/detail-debug'], function($, article, detail) { | ||
39 | - if (article) { | ||
40 | - article.init(); | ||
41 | - } | ||
42 | - | ||
43 | - if(detail) { | ||
44 | - detail.init(); | ||
45 | - } | 10 | + docEl.style.fontSize = 20 * (clientWidth / 320) + 'px'; |
11 | + }; | ||
46 | 12 | ||
47 | - $(".detail-container").show(); | ||
48 | - }); | ||
49 | - </script> | ||
50 | -</html> | ||
13 | + if (!doc.addEventListener) { | ||
14 | + return; | ||
15 | + } | ||
16 | + win.addEventListener(resizeEvt, recalc, false); | ||
17 | + doc.addEventListener('DOMContentLoaded', recalc, false); | ||
18 | + })(document, window); | ||
19 | +</script> | ||
20 | +<script src="//localhost:5000/dist/all-debug.js"></script> | ||
21 | +<script src="//localhost:5000/js/{{usejs}}.js"></script> |
@@ -3,7 +3,7 @@ | @@ -3,7 +3,7 @@ | ||
3 | <h2>相关推荐</h2> | 3 | <h2>相关推荐</h2> |
4 | <div class="good-list clearfix"> | 4 | <div class="good-list clearfix"> |
5 | {{# list}} | 5 | {{# list}} |
6 | - {{> good_info}} | 6 | + {{> guang/good_info}} |
7 | {{/ list}} | 7 | {{/ list}} |
8 | </div> | 8 | </div> |
9 | <div class="more-good clearfix"> | 9 | <div class="more-good clearfix"> |
mobile/views/partials/guang/article.html
0 → 100644
mobile/views/partials/header.html
0 → 100644
1 | +<link rel="stylesheet" href="{{css}}"> |
-
Please register or login to post a comment