Showing
4 changed files
with
33 additions
and
9 deletions
@@ -7,17 +7,30 @@ | @@ -7,17 +7,30 @@ | ||
7 | 7 | ||
8 | const mRoot = '../models'; | 8 | const mRoot = '../models'; |
9 | const plusstarModel = require(`${mRoot}/plusstar`); | 9 | const plusstarModel = require(`${mRoot}/plusstar`); |
10 | - | 10 | +const headerModel = require('../../../doraemon/models/header'); // 头部model |
11 | /** | 11 | /** |
12 | * 潮流优选首页 | 12 | * 潮流优选首页 |
13 | */ | 13 | */ |
14 | exports.index = (req, res, next) => { | 14 | exports.index = (req, res, next) => { |
15 | + let isApp = req.query.app_version || req.query.appVersion || false; | ||
16 | + let parameter = {}; | ||
17 | + let title = '潮流优选'; | ||
18 | + | ||
19 | + if (isApp === false) { | ||
20 | + parameter = { | ||
21 | + pageHeader: headerModel.setNav({ | ||
22 | + navTitle: title | ||
23 | + }), | ||
24 | + pageFooter: true | ||
25 | + }; | ||
26 | + } | ||
27 | + | ||
15 | plusstarModel.getAllChannels({}).then(result => { | 28 | plusstarModel.getAllChannels({}).then(result => { |
16 | - res.render('plusstar/index', { | 29 | + res.render('plusstar/index', Object.assign({ |
17 | page: 'plusstar-index', | 30 | page: 'plusstar-index', |
18 | result: result, | 31 | result: result, |
19 | - title: '潮流优选' | ||
20 | - }); | 32 | + title: title |
33 | + }, parameter)); | ||
21 | }).catch(next); | 34 | }).catch(next); |
22 | }; | 35 | }; |
23 | 36 |
@@ -11,10 +11,18 @@ lazyLoad($('img.lazy')); | @@ -11,10 +11,18 @@ lazyLoad($('img.lazy')); | ||
11 | 11 | ||
12 | plusstar = { | 12 | plusstar = { |
13 | init: function() { | 13 | init: function() { |
14 | - var that = this, $liDom; | 14 | + var that = this, |
15 | + $liDom, | ||
16 | + $tabUlDom; | ||
17 | + | ||
18 | + $tabUlDom = $('.plusstar-page .tab-nav ul'); | ||
19 | + | ||
20 | + $tabUlDom.find('li').css({ | ||
21 | + width: 100 / $tabUlDom.find('li').length + '%' | ||
22 | + }); | ||
15 | 23 | ||
16 | // 事情委托机制 | 24 | // 事情委托机制 |
17 | - $('.plusstar-page .tab-nav ul').bind('click', function(event) { | 25 | + $tabUlDom.bind('click', function(event) { |
18 | $liDom = $(event.target).closest('li'); | 26 | $liDom = $(event.target).closest('li'); |
19 | 27 | ||
20 | if ($liDom.hasClass('focus')) { | 28 | if ($liDom.hasClass('focus')) { |
@@ -38,7 +46,7 @@ plusstar = { | @@ -38,7 +46,7 @@ plusstar = { | ||
38 | $liDom = $('.plusstar-page .tab-nav ul li:eq(0)'); | 46 | $liDom = $('.plusstar-page .tab-nav ul li:eq(0)'); |
39 | break; | 47 | break; |
40 | } | 48 | } |
41 | - $('.plusstar-page .tab-nav ul').find('li').removeClass('focus'); | 49 | + $tabUlDom.find('li').removeClass('focus'); |
42 | $liDom.addClass('focus'); | 50 | $liDom.addClass('focus'); |
43 | that.tabNav($liDom.data('code')); | 51 | that.tabNav($liDom.data('code')); |
44 | 52 |
@@ -117,13 +117,16 @@ | @@ -117,13 +117,16 @@ | ||
117 | 117 | ||
118 | .good-detail-text { | 118 | .good-detail-text { |
119 | .name a { | 119 | .name a { |
120 | - display: block; | ||
121 | margin: 15px 0 10px; | 120 | margin: 15px 0 10px; |
122 | min-height: 50px; | 121 | min-height: 50px; |
123 | color: #444; | 122 | color: #444; |
124 | font-size: 22px; | 123 | font-size: 22px; |
125 | line-height: 30px; | 124 | line-height: 30px; |
126 | padding: 5px 0; /* 商品标题限制行数的bug修复 增加元素的clientHeight */ | 125 | padding: 5px 0; /* 商品标题限制行数的bug修复 增加元素的clientHeight */ |
126 | + display: -webkit-box; | ||
127 | + -webkit-box-orient: vertical; | ||
128 | + -webkit-line-clamp: 2; | ||
129 | + overflow: hidden; | ||
127 | } | 130 | } |
128 | 131 | ||
129 | .price { | 132 | .price { |
-
Please register or login to post a comment