Merge branch 'release/4.6'
Showing
18 changed files
with
227 additions
and
131 deletions
@@ -8,35 +8,37 @@ | @@ -8,35 +8,37 @@ | ||
8 | const mRoot = '../models'; | 8 | const mRoot = '../models'; |
9 | const library = '../../../library'; | 9 | const library = '../../../library'; |
10 | const _ = require('lodash'); | 10 | const _ = require('lodash'); |
11 | -const headerModel = require('../../../doraemon/models/header'); | ||
12 | const starModel = require(`${mRoot}/star`); | 11 | const starModel = require(`${mRoot}/star`); |
13 | const helpers = require(`${library}/helpers`); | 12 | const helpers = require(`${library}/helpers`); |
14 | 13 | ||
14 | +// const headerModel = require('../../../doraemon/models/header'); | ||
15 | + | ||
15 | const headTab = [ | 16 | const headTab = [ |
16 | { | 17 | { |
17 | - url: '/guang/star?openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http:\/\/m.yohobuy.com\/guang\/star","param":{}}}', // eslint-disable-line | 18 | + url: '/guang/star', |
18 | name: '全部' | 19 | name: '全部' |
19 | }, | 20 | }, |
20 | { | 21 | { |
21 | - url: '/guang/star/special?openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http:\/\/m.yohobuy.com\/guang\/star\/special","param":{}}}', // eslint-disable-line | 22 | + url: '/guang/star/special', |
22 | name: '星专题' | 23 | name: '星专题' |
23 | }, | 24 | }, |
24 | { | 25 | { |
25 | - url: '/guang/star/collocation?openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http:\/\/m.yohobuy.com\/guang\/star\/collocation","param":{}}}', // eslint-disable-line | 26 | + url: '/guang/star/collocation', |
26 | name: '星搭配' | 27 | name: '星搭配' |
27 | } | 28 | } |
28 | ]; | 29 | ]; |
29 | 30 | ||
30 | -const processPublicData = (req, title, navBtn) => { | ||
31 | - let headerData = headerModel.setNav({ | ||
32 | - navTitle: title, | ||
33 | - navBtn: navBtn | ||
34 | - }); | 31 | +const processPublicData = (req, title) => { |
32 | + // let headerData = headerModel.setNav({ | ||
33 | + // navTitle: title, | ||
34 | + // navBtn: navBtn | ||
35 | + // }); | ||
35 | 36 | ||
36 | let renderData = { | 37 | let renderData = { |
37 | module: 'guang', | 38 | module: 'guang', |
38 | - title: title, | ||
39 | - pageHeader: headerData | 39 | + title: title |
40 | + | ||
41 | + // pageHeader: headerData | ||
40 | }; | 42 | }; |
41 | 43 | ||
42 | if (req.query.app_version || req.query.appVersion) { | 44 | if (req.query.app_version || req.query.appVersion) { |
@@ -71,7 +73,7 @@ exports.getIndexHtml = (req, res, next) => { | @@ -71,7 +73,7 @@ exports.getIndexHtml = (req, res, next) => { | ||
71 | focus: true, | 73 | focus: true, |
72 | data: result.ads | 74 | data: result.ads |
73 | }, | 75 | }, |
74 | - starAvatar: result.starAvatar, | 76 | + starAvatar: result.starAvatar.concat(result.starAvatar).concat(result.starAvatar), // 需要优化,数组重复三次 |
75 | articles: result.articles | 77 | articles: result.articles |
76 | })); | 78 | })); |
77 | }).catch(next); | 79 | }).catch(next); |
@@ -79,7 +79,7 @@ const _processIndexData = (list) => { | @@ -79,7 +79,7 @@ const _processIndexData = (list) => { | ||
79 | 79 | ||
80 | _.forEach(data.ext.tags, (tags) => { | 80 | _.forEach(data.ext.tags, (tags) => { |
81 | avatar.tags.push({ | 81 | avatar.tags.push({ |
82 | - avatarUrl: `/guang/star/detail?tag=${tags.tagName}&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http:\/\/m.yohobuy.com\/guang\/star\/detail","param":{"tag":"${tags.tagName}"}}}`, // eslint-disable-line | 82 | + avatarUrl: `/guang/star/detail?tag=${tags.tagName}&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http://m.yohobuy.com/guang/star/detail","param":{"tag":"${tags.tagName}"}}}`, // eslint-disable-line |
83 | cover: tags.cover, | 83 | cover: tags.cover, |
84 | tagName: tags.tagName | 84 | tagName: tags.tagName |
85 | }); | 85 | }); |
@@ -104,7 +104,7 @@ const _processIndexData = (list) => { | @@ -104,7 +104,7 @@ const _processIndexData = (list) => { | ||
104 | // 首页明星头像数据处理 | 104 | // 首页明星头像数据处理 |
105 | if (list.tags) { | 105 | if (list.tags) { |
106 | _.forEach(list.tags, (data) => { | 106 | _.forEach(list.tags, (data) => { |
107 | - let url = `/guang/star/detail?tag=${data.tagName}&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http:\/\/m.yohobuy.com\/guang\/star\/detail","param":{"tag":"${data.tagName}"}}}`; // eslint-disable-line | 107 | + let url = `/guang/star/detail?tag=${data.tagName}&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"http://m.yohobuy.com/guang/star/detail","param":{"tag":"${data.tagName}"}}}`; // eslint-disable-line |
108 | 108 | ||
109 | formatData.starAvatar.push({ | 109 | formatData.starAvatar.push({ |
110 | url: url, | 110 | url: url, |
@@ -136,6 +136,10 @@ const _processDetailData = (list) => { | @@ -136,6 +136,10 @@ const _processDetailData = (list) => { | ||
136 | if (data.share && data.share.url) { | 136 | if (data.share && data.share.url) { |
137 | data.share.url = _processShareUrl(data); | 137 | data.share.url = _processShareUrl(data); |
138 | } | 138 | } |
139 | + let urlObj = url.parse(data.url); | ||
140 | + let appUrl = `&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"${ urlObj.protocol + '//' + urlObj.host + urlObj.pathname}","param":${JSON.stringify(qs.parse(urlObj.query))}}}`.replace(/\//g, '\/'); // eslint-disable-line | ||
141 | + | ||
142 | + data.url += appUrl; | ||
139 | formatData.push(data); | 143 | formatData.push(data); |
140 | }); | 144 | }); |
141 | 145 | ||
@@ -214,7 +218,10 @@ const getSpecialData = () => { | @@ -214,7 +218,10 @@ const getSpecialData = () => { | ||
214 | // 数据结构嵌套太深 | 218 | // 数据结构嵌套太深 |
215 | _.forEach(result, (data) => { | 219 | _.forEach(result, (data) => { |
216 | _.map(data.data, (item) => { | 220 | _.map(data.data, (item) => { |
217 | - let urlObj = url.parse(item.url); | 221 | + if (!_.isObject(item)) { |
222 | + return; | ||
223 | + } | ||
224 | + let urlObj = url.parse(item.url || ''); | ||
218 | let appUrl = `&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"${ urlObj.protocol + '//' + urlObj.host + urlObj.pathname}","param":${JSON.stringify(qs.parse(urlObj.query))}}}`.replace(/\//g, '\/'); // eslint-disable-line | 225 | let appUrl = `&openby:yohobuy={"action":"go.h5","params":{"id":"","share":"","shareparam":{},"islogin":"N","type":0,"updateflag":"N","url":"${ urlObj.protocol + '//' + urlObj.host + urlObj.pathname}","param":${JSON.stringify(qs.parse(urlObj.query))}}}`.replace(/\//g, '\/'); // eslint-disable-line |
219 | 226 | ||
220 | item.url += appUrl; | 227 | item.url += appUrl; |
1 | -<div class="loading-tip">下拉刷新</div> | ||
2 | -<div class="star-wrap"> | ||
3 | - <div class="star-content"> | ||
4 | - {{#content}} | ||
5 | - {{#if focus}} | ||
6 | - {{> resources/banner-top}} | ||
7 | - {{/if}} | ||
8 | - {{/content}} | ||
9 | - | ||
10 | - <div class="avatar-wrap"> | ||
11 | - <div class="avatar-swiper avatar"> | ||
12 | - <ul class="clearfix swiper-wrapper"> | ||
13 | - {{# starAvatar}} | ||
14 | - <li class="swiper-slide"> | ||
15 | - <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> | ||
16 | - </li> | ||
17 | - {{/ starAvatar}} | ||
18 | - </ul> | ||
19 | - </div> | ||
20 | - </div> | ||
21 | - | ||
22 | - <ul class="star-info clearfix"> | ||
23 | - {{#each articles}} | ||
24 | - <li data-id="{{id}}"> | ||
25 | - <div class="star-avatar"> | ||
26 | - {{#if isSwiper}} | ||
27 | - <div class="article-avatar-swiper"> | ||
28 | - <ul class="clearfix swiper-wrapper"> | ||
29 | - {{#each tags}} | ||
30 | - <li class="swiper-slide"> | ||
31 | - <a href='{{avatarUrl}}'> | ||
32 | - <div data-avatar="{{image cover 100 100}}" class="rank-avatar" ></div> | ||
33 | - <p class="name">{{tagName}}</p> | ||
34 | - </a> | ||
35 | - </li> | ||
36 | - {{/each}} | ||
37 | - </ul> | ||
38 | - </div> | ||
39 | - {{else}} | ||
40 | - {{# tags}} | ||
41 | - <a href="{{avatarUrl}}"> | ||
42 | - <div data-avatar="{{image cover 100 100}}" class="rank-avatar" ></div> | ||
43 | - <p class="name">{{tagName}}</p> | ||
44 | - </a> | ||
45 | - {{/ tags}} | ||
46 | - {{/if}} | ||
47 | - </div> | ||
48 | - <a class="star-article" href='{{url}}'> | ||
49 | - <i class="article-arrow"></i> | ||
50 | - <h2 class="article-title">{{title}}</h2> | ||
51 | - <div class="artice-cont"> | ||
52 | - <p>{{articeTxt}}</p> | ||
53 | - <div class="artice-imgs-area"> | ||
54 | - <img src="{{image src 266 266}}" /> | ||
55 | - | ||
56 | - {{!-- <ul class="artice-imgs"> | ||
57 | - {{#each articeImg}} | ||
58 | - <li><img src="{{image . 640 640}}" /></li> | ||
59 | - {{/each}} | ||
60 | - </ul> --}} | ||
61 | - | ||
62 | - </div> | ||
63 | - </div> | ||
64 | - <div class="artice-o"> | ||
65 | - <span class="time"><i class="iconfont time-ico"></i>{{publishTime}}</span> | ||
66 | - <span class="see"><i class="iconfont see-ico"></i>{{viewsNum}}</span> | ||
67 | - </div> | ||
68 | - </a> | ||
69 | - </li> | ||
70 | - {{/each}} | ||
71 | - </ul> | ||
72 | - </div> | ||
73 | -</div> | ||
74 | - | ||
75 | -{{!-- <div class="view-img"> | ||
76 | - <div class="mask-bg"></div> | ||
77 | - <div class="view-area"> | ||
78 | - <div class="swiper-view"> | ||
79 | - <ul class="clearfix swiper-wrapper"></ul> | ||
80 | - </div> | ||
81 | - </div> | ||
82 | -</div> --}} | 1 | +{{> star/index-html}} |
@@ -3,12 +3,14 @@ | @@ -3,12 +3,14 @@ | ||
3 | <ul class="special-list"> | 3 | <ul class="special-list"> |
4 | {{#each resources}} | 4 | {{#each resources}} |
5 | {{# data}} | 5 | {{# data}} |
6 | + {{#if url}} | ||
6 | <li data-bp-id="guang_subjectList_{{title}}_false" class="buriedpoint"> | 7 | <li data-bp-id="guang_subjectList_{{title}}_false" class="buriedpoint"> |
7 | <a href='{{url}}'> | 8 | <a href='{{url}}'> |
8 | <img class="lazy" data-original="{{image src 640 310}}" alt="{{alt}}"/> | 9 | <img class="lazy" data-original="{{image src 640 310}}" alt="{{alt}}"/> |
9 | <p>{{title}}</p> | 10 | <p>{{title}}</p> |
10 | </a> | 11 | </a> |
11 | </li> | 12 | </li> |
13 | + {{/if}} | ||
12 | {{/ data}} | 14 | {{/ data}} |
13 | {{/each}} | 15 | {{/each}} |
14 | </ul> | 16 | </ul> |
apps/guang/views/partial/star/index-html.hbs
0 → 100644
1 | +<div class="loading-tip">下拉刷新</div> | ||
2 | +<div class="star-wrap"> | ||
3 | + <div class="star-content"> | ||
4 | + {{#content}} | ||
5 | + {{#if focus}} | ||
6 | + {{> resources/banner-top}} | ||
7 | + {{/if}} | ||
8 | + {{/content}} | ||
9 | + | ||
10 | + <div class="avatar-wrap"> | ||
11 | + <div class="avatar-swiper avatar"> | ||
12 | + <ul class="clearfix swiper-wrapper"> | ||
13 | + {{# starAvatar}} | ||
14 | + <li class="swiper-slide"> | ||
15 | + <a class="rank-avatar" href='{{url}}' data-avatar="{{image cover 180 180}}"></a> | ||
16 | + </li> | ||
17 | + {{/ starAvatar}} | ||
18 | + </ul> | ||
19 | + </div> | ||
20 | + </div> | ||
21 | + | ||
22 | + <ul class="star-info clearfix"> | ||
23 | + {{#each articles}} | ||
24 | + <li data-id="{{id}}"> | ||
25 | + <div class="star-avatar"> | ||
26 | + {{#if isSwiper}} | ||
27 | + <div class="article-avatar-swiper"> | ||
28 | + <ul class="clearfix swiper-wrapper"> | ||
29 | + {{#each tags}} | ||
30 | + <li class="swiper-slide"> | ||
31 | + <a href='{{avatarUrl}}'> | ||
32 | + <div data-avatar="{{image cover 100 100}}" class="rank-avatar" ></div> | ||
33 | + <p class="name">{{tagName}}</p> | ||
34 | + </a> | ||
35 | + </li> | ||
36 | + {{/each}} | ||
37 | + </ul> | ||
38 | + </div> | ||
39 | + {{else}} | ||
40 | + {{# tags}} | ||
41 | + <a href="{{avatarUrl}}"> | ||
42 | + <div data-avatar="{{image cover 100 100}}" class="rank-avatar" ></div> | ||
43 | + <p class="name">{{tagName}}</p> | ||
44 | + </a> | ||
45 | + {{/ tags}} | ||
46 | + {{/if}} | ||
47 | + </div> | ||
48 | + <a class="star-article" href='{{url}}'> | ||
49 | + <i class="article-arrow"></i> | ||
50 | + <h2 class="article-title">{{title}}</h2> | ||
51 | + <div class="artice-cont"> | ||
52 | + <p>{{articeTxt}}</p> | ||
53 | + <div class="artice-imgs-area"> | ||
54 | + <img src="{{image src 266 266}}" /> | ||
55 | + | ||
56 | + {{!-- <ul class="artice-imgs"> | ||
57 | + {{#each articeImg}} | ||
58 | + <li><img src="{{image . 640 640}}" /></li> | ||
59 | + {{/each}} | ||
60 | + </ul> --}} | ||
61 | + | ||
62 | + </div> | ||
63 | + </div> | ||
64 | + <div class="artice-o"> | ||
65 | + <span class="time"><i class="iconfont time-ico"></i>{{publishTime}}</span> | ||
66 | + <span class="see"><i class="iconfont see-ico"></i>{{viewsNum}}</span> | ||
67 | + </div> | ||
68 | + </a> | ||
69 | + </li> | ||
70 | + {{/each}} | ||
71 | + </ul> | ||
72 | + </div> | ||
73 | +</div> | ||
74 | + | ||
75 | +{{!-- <div class="view-img"> | ||
76 | + <div class="mask-bg"></div> | ||
77 | + <div class="view-area"> | ||
78 | + <div class="swiper-view"> | ||
79 | + <ul class="clearfix swiper-wrapper"></ul> | ||
80 | + </div> | ||
81 | + </div> | ||
82 | +</div> --}} |
@@ -114,6 +114,7 @@ const convertActicityData = (data) => { | @@ -114,6 +114,7 @@ const convertActicityData = (data) => { | ||
114 | discountText = transDiscountToArr(discountArr[1])[1]; | 114 | discountText = transDiscountToArr(discountArr[1])[1]; |
115 | } | 115 | } |
116 | 116 | ||
117 | + | ||
117 | formatData.push({ | 118 | formatData.push({ |
118 | activityUrl: '/product/outlet/activity?id=' + item.id, | 119 | activityUrl: '/product/outlet/activity?id=' + item.id, |
119 | coverUrl: item.coverUrl, | 120 | coverUrl: item.coverUrl, |
@@ -121,6 +122,7 @@ const convertActicityData = (data) => { | @@ -121,6 +122,7 @@ const convertActicityData = (data) => { | ||
121 | title: item.title, | 122 | title: item.title, |
122 | discountNum: discountNum, | 123 | discountNum: discountNum, |
123 | discountText: discountText, | 124 | discountText: discountText, |
125 | + productPoolId: item.productPoolId || '', | ||
124 | leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime, | 126 | leftTime: item.startLeftTime > 0 ? dateFormate(item.startTime) : item.endLeftTime, |
125 | hide: false | 127 | hide: false |
126 | }); | 128 | }); |
@@ -132,13 +134,13 @@ const convertActicityData = (data) => { | @@ -132,13 +134,13 @@ const convertActicityData = (data) => { | ||
132 | const getActivityDetail = (id) => { | 134 | const getActivityDetail = (id) => { |
133 | var params = { | 135 | var params = { |
134 | method: 'app.outlets.activityGet', | 136 | method: 'app.outlets.activityGet', |
135 | - sort: 2, | 137 | + sort: 1, |
136 | platform: 3, | 138 | platform: 3, |
137 | - yh_channel: 1, | ||
138 | id: id, | 139 | id: id, |
139 | type: 0 | 140 | type: 0 |
140 | }; | 141 | }; |
141 | 142 | ||
143 | + | ||
142 | return api.get('', sign.apiSign(params)).then(res => { | 144 | return api.get('', sign.apiSign(params)).then(res => { |
143 | if (res.code === 200) { | 145 | if (res.code === 200) { |
144 | return convertActicityData(res.data); | 146 | return convertActicityData(res.data); |
@@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
5 | }} | 5 | }} |
6 | {{#data}} | 6 | {{#data}} |
7 | <li class='category'> | 7 | <li class='category'> |
8 | - <a href="{{url}}">{{categoryName}}</a> | 8 | + <a href="{{url}}" {{#if @first}}class="active"{{/if}}>{{categoryName}}</a> |
9 | {{#unless @last}} | 9 | {{#unless @last}} |
10 | <span>|</span> | 10 | <span>|</span> |
11 | {{/unless}} | 11 | {{/unless}} |
@@ -13,8 +13,8 @@ module.exports = { | @@ -13,8 +13,8 @@ module.exports = { | ||
13 | port: 6001, | 13 | port: 6001, |
14 | siteUrl: '//m.yohobuy.com', | 14 | siteUrl: '//m.yohobuy.com', |
15 | domains: { | 15 | domains: { |
16 | - api: 'http://devapi.yoho.cn:58078/', | ||
17 | - service: 'http://devservice.yoho.cn:58077/' | 16 | + api: 'http://testapi.yoho.cn:28078/', |
17 | + service: 'http://testservice.yoho.cn:28077/' | ||
18 | }, | 18 | }, |
19 | useOneapm: false, | 19 | useOneapm: false, |
20 | useCache: false, | 20 | useCache: false, |
@@ -3,6 +3,7 @@ | @@ -3,6 +3,7 @@ | ||
3 | * @return {[type]} | 3 | * @return {[type]} |
4 | */ | 4 | */ |
5 | const headerModel = require('../models/header'); | 5 | const headerModel = require('../models/header'); |
6 | +const logger = require('../../library/logger'); | ||
6 | 7 | ||
7 | exports.notFound = () => { | 8 | exports.notFound = () => { |
8 | return (req, res) => { | 9 | return (req, res) => { |
@@ -39,6 +40,7 @@ exports.serverError = () => { | @@ -39,6 +40,7 @@ exports.serverError = () => { | ||
39 | }); | 40 | }); |
40 | } | 41 | } |
41 | 42 | ||
43 | + logger.error(err); | ||
42 | return res.render('error/500', { | 44 | return res.render('error/500', { |
43 | err: err, | 45 | err: err, |
44 | module: 'common', | 46 | module: 'common', |
This diff could not be displayed because it is too large.

29.2 KB
public/img/product/outlet_sellout_bg.png
0 → 100644

29.2 KB
@@ -9,8 +9,9 @@ var $categoryNavItem = $('.outlet-category-nav a'); | @@ -9,8 +9,9 @@ var $categoryNavItem = $('.outlet-category-nav a'); | ||
9 | var search = require('./sale/search'); | 9 | var search = require('./sale/search'); |
10 | var iscroll = require('./outlet/nav'); | 10 | var iscroll = require('./outlet/nav'); |
11 | 11 | ||
12 | -lazyLoad($('img.lazy')); | 12 | +require('./outlet/fix-nav'); |
13 | 13 | ||
14 | +lazyLoad($('img.lazy')); | ||
14 | 15 | ||
15 | // 搜索条件初始化 | 16 | // 搜索条件初始化 |
16 | function searchInitParam(dom) { | 17 | function searchInitParam(dom) { |
@@ -42,6 +43,8 @@ if ($el.length > 0) { | @@ -42,6 +43,8 @@ if ($el.length > 0) { | ||
42 | }); | 43 | }); |
43 | } | 44 | } |
44 | 45 | ||
46 | +$('.outlet-category-nav').fixNav(); | ||
47 | + | ||
45 | if ($('.swiper-container .swiper-slide').length > 1) { | 48 | if ($('.swiper-container .swiper-slide').length > 1) { |
46 | new Swiper('.swiper-container', { | 49 | new Swiper('.swiper-container', { |
47 | lazyLoading: true, | 50 | lazyLoading: true, |
public/js/product/outlet/fix-nav.js
0 → 100644
1 | +/** | ||
2 | + * make the nav (or any element) to be fixed on top | ||
3 | + * author: Bill.Zhao | ||
4 | + * repository: https://github.com/buildAll/fix-nav.js/blob/master/fix-nav.js | ||
5 | + * license: MIT | ||
6 | + */ | ||
7 | + | ||
8 | +var $ = require('yoho-jquery'); | ||
9 | + | ||
10 | +(function() { | ||
11 | + $.fn.fixNav = function() { | ||
12 | + | ||
13 | + // var defaults = { | ||
14 | + // }; | ||
15 | + | ||
16 | + // var settings = $.extend({}, defaults, options); | ||
17 | + | ||
18 | + var scrollDirection = { | ||
19 | + direction: '', | ||
20 | + preScrollTop: 0, | ||
21 | + curScrollTop: 0, | ||
22 | + getDirection: function() { | ||
23 | + this.curScrollTop = $(window).scrollTop(); | ||
24 | + this.curScrollTop < this.preScrollTop ? | ||
25 | + this.direction = 'up' : | ||
26 | + this.direction = 'down'; | ||
27 | + this.preScrollTop = this.curScrollTop; | ||
28 | + }, | ||
29 | + isUp: function() { | ||
30 | + this.getDirection(); | ||
31 | + return this.direction === 'up'; | ||
32 | + }, | ||
33 | + isDown: function() { | ||
34 | + this.getDirection(); | ||
35 | + return this.direction === 'down'; | ||
36 | + } | ||
37 | + }; | ||
38 | + | ||
39 | + var styleCtrl = { | ||
40 | + isSet: false, | ||
41 | + preStyle: '', | ||
42 | + preTop: null, | ||
43 | + $el: null, | ||
44 | + setFix: function(el, originTop) { | ||
45 | + if (!this.isSet) { | ||
46 | + this.$el = $(el); | ||
47 | + | ||
48 | + this.preStyle = this.$el.attr('style'); | ||
49 | + this.preTop = originTop; | ||
50 | + | ||
51 | + this.$el.css({ | ||
52 | + position: 'fixed', | ||
53 | + top: 0, | ||
54 | + 'z-index': 9999 | ||
55 | + }); | ||
56 | + | ||
57 | + this.isSet = true; | ||
58 | + } | ||
59 | + }, | ||
60 | + clearFix: function() { | ||
61 | + var windowTop; | ||
62 | + | ||
63 | + if (this.$el) { | ||
64 | + windowTop = $(window).scrollTop(); | ||
65 | + | ||
66 | + if (windowTop <= this.preTop) { | ||
67 | + if (this.preStyle) { | ||
68 | + this.$el.attr('style', this.preStyle); | ||
69 | + } else { | ||
70 | + this.$el.removeAttr('style'); | ||
71 | + } | ||
72 | + this.isSet = false; | ||
73 | + } | ||
74 | + } | ||
75 | + } | ||
76 | + }; | ||
77 | + | ||
78 | + return this.each(function(index, el) { | ||
79 | + var viewportOffset = el.getBoundingClientRect(); | ||
80 | + var originPoistion = viewportOffset.top; | ||
81 | + | ||
82 | + $(window).scroll(function() { | ||
83 | + var subViewportOffset = el.getBoundingClientRect(); | ||
84 | + var elementTop = subViewportOffset.top; | ||
85 | + | ||
86 | + if (scrollDirection.isDown() && elementTop <= 0) { | ||
87 | + styleCtrl.setFix(el, originPoistion); | ||
88 | + } else { | ||
89 | + styleCtrl.clearFix(); | ||
90 | + } | ||
91 | + }); | ||
92 | + }); | ||
93 | + | ||
94 | + }; | ||
95 | +}()); |
@@ -92,28 +92,7 @@ function activeNav() { | @@ -92,28 +92,7 @@ function activeNav() { | ||
92 | 92 | ||
93 | } | 93 | } |
94 | 94 | ||
95 | -function fixNav() { | ||
96 | - var navHeight = 0; | ||
97 | - var $navContainer = $('#index_nav'); | ||
98 | - | ||
99 | - if ($navContainer.size() > 0) { | ||
100 | - navHeight = $navContainer.height(); | ||
101 | - | ||
102 | - // 顶部app下载位置 | ||
103 | - $(window).on('scroll', function() { | ||
104 | - var scrollTop = $(window).scrollTop(); | ||
105 | - | ||
106 | - if (scrollTop >= navHeight) { | ||
107 | - $navContainer.addClass('nav-fix'); | ||
108 | - } else { | ||
109 | - $navContainer.removeClass('nav-fix'); | ||
110 | - } | ||
111 | - }); | ||
112 | - } | ||
113 | -} | ||
114 | - | ||
115 | activeNav(); | 95 | activeNav(); |
116 | -fixNav(); | ||
117 | 96 | ||
118 | 97 | ||
119 | module.exports = initNavScroll; | 98 | module.exports = initNavScroll; |
@@ -106,11 +106,9 @@ | @@ -106,11 +106,9 @@ | ||
106 | 106 | ||
107 | .no-storage-img { | 107 | .no-storage-img { |
108 | display: block; | 108 | display: block; |
109 | - width: 90px; | ||
110 | - height: 90px; | ||
111 | - margin-left: 93px; | ||
112 | - margin-top: 139px; | ||
113 | - background-image: resolve("product/bag_moren.png"); | 109 | + width: 100%; |
110 | + height: 100%; | ||
111 | + background-image: resolve("product/outlet_sellout_bg.png"); | ||
114 | background-repeat: no-repeat; | 112 | background-repeat: no-repeat; |
115 | background-size: contain; | 113 | background-size: contain; |
116 | } | 114 | } |
@@ -115,6 +115,10 @@ | @@ -115,6 +115,10 @@ | ||
115 | } | 115 | } |
116 | } | 116 | } |
117 | 117 | ||
118 | + .avatar-wrap { | ||
119 | + height: 180px; | ||
120 | + } | ||
121 | + | ||
118 | .avatar-swiper { | 122 | .avatar-swiper { |
119 | overflow: hidden; | 123 | overflow: hidden; |
120 | margin-top: 30px; | 124 | margin-top: 30px; |
@@ -370,7 +374,7 @@ | @@ -370,7 +374,7 @@ | ||
370 | display: block; | 374 | display: block; |
371 | width: 100%; | 375 | width: 100%; |
372 | height: 100%; | 376 | height: 100%; |
373 | - background-image: resolve("guang/star/user-avatar.png"); | 377 | + background-color: #000; |
374 | background-repeat: no-repeat; | 378 | background-repeat: no-repeat; |
375 | background-size: contain; | 379 | background-size: contain; |
376 | } | 380 | } |
-
Please register or login to post a comment