Merge branch 'feature/star' of git.yoho.cn:fe/yohobuywap-node into feature/star
Showing
9 changed files
with
135 additions
and
162 deletions
@@ -45,25 +45,26 @@ app.use(bodyParser.urlencoded({ | @@ -45,25 +45,26 @@ app.use(bodyParser.urlencoded({ | ||
45 | extended: false | 45 | extended: false |
46 | })); | 46 | })); |
47 | app.use(cookieParser()); | 47 | app.use(cookieParser()); |
48 | -app.use(session({ | ||
49 | - proxy: true, | ||
50 | - resave: false, | ||
51 | - saveUninitialized: true, | ||
52 | - unset: 'destroy', | ||
53 | - secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密 | ||
54 | - name: 'PHPSESSID', // 兼容 PHP SESSION | ||
55 | - genid: () => { | ||
56 | - return uuid.v4(); // 兼容 PHP SESSION | ||
57 | - }, | ||
58 | - cookie: { | ||
59 | - domain: 'yohobuy.com' | ||
60 | - }, | ||
61 | - store: new MemcachedStore({ | ||
62 | - hosts: config.memcache.session, | ||
63 | - prefix: 'qinsessionsession:', // 兼容 PHP SESSION | ||
64 | - key: 'yohobuy_session' // 兼容 PHP SESSION | ||
65 | - }) | ||
66 | -})); | 48 | + |
49 | +// app.use(session({ | ||
50 | +// proxy: true, | ||
51 | +// resave: false, | ||
52 | +// saveUninitialized: true, | ||
53 | +// unset: 'destroy', | ||
54 | +// secret: 'nothing', // 兼容 PHP SESSION,sessionID 不加密 | ||
55 | +// name: 'PHPSESSID', // 兼容 PHP SESSION | ||
56 | +// genid: () => { | ||
57 | +// return uuid.v4(); // 兼容 PHP SESSION | ||
58 | +// }, | ||
59 | +// cookie: { | ||
60 | +// domain: 'yohobuy.com' | ||
61 | +// }, | ||
62 | +// store: new MemcachedStore({ | ||
63 | +// hosts: config.memcache.session, | ||
64 | +// prefix: 'qinsessionsession:', // 兼容 PHP SESSION | ||
65 | +// key: 'yohobuy_session' // 兼容 PHP SESSION | ||
66 | +// }) | ||
67 | +// })); | ||
67 | 68 | ||
68 | app.use((req, res, next) => { | 69 | app.use((req, res, next) => { |
69 | req.user = {}; | 70 | req.user = {}; |
@@ -56,7 +56,7 @@ exports.index = (req, res) => { | @@ -56,7 +56,7 @@ exports.index = (req, res) => { | ||
56 | }, processPublicData(req, '星潮教室'))); | 56 | }, processPublicData(req, '星潮教室'))); |
57 | }; | 57 | }; |
58 | 58 | ||
59 | -exports.ajaxIndexHtml = (req, res) => { | 59 | +exports.getIndexHtml = (req, res) => { |
60 | starModel.getIndexData().then((result) => { | 60 | starModel.getIndexData().then((result) => { |
61 | res.render('star/index-html', _.assign({ | 61 | res.render('star/index-html', _.assign({ |
62 | layout: false, | 62 | layout: false, |
@@ -13,7 +13,7 @@ const star = require(cRoot + '/star'); | @@ -13,7 +13,7 @@ const star = require(cRoot + '/star'); | ||
13 | const router = express.Router(); // eslint-disable-line | 13 | const router = express.Router(); // eslint-disable-line |
14 | 14 | ||
15 | router.get('/star', star.index); // 星潮教室首页 | 15 | router.get('/star', star.index); // 星潮教室首页 |
16 | -router.get('/star/ajaxIndexHtml', star.ajaxIndexHtml); // 星潮教室首页 | 16 | +router.get('/star/getIndexHtml', star.getIndexHtml); // 星潮教室首页 |
17 | router.get('/star/detail', star.detail); // 明星文章专区 | 17 | router.get('/star/detail', star.detail); // 明星文章专区 |
18 | router.get('/star/detailList', star.detailList); // 明星文章专区文章Ajax请求 | 18 | router.get('/star/detailList', star.detailList); // 明星文章专区文章Ajax请求 |
19 | router.get('/star/special', star.special); // 星潮教室星专题 | 19 | router.get('/star/special', star.special); // 星潮教室星专题 |
1 | - <div class="avatar-swiper avatar-1"> | ||
2 | - <ul class="clearfix swiper-wrapper"> | ||
3 | - {{# starAvatar}} | ||
4 | - <li class="swiper-slide"> | ||
5 | - <img class="rank-avatar" data-url="{{url}}" src="{{image cover 180 180}}"> | ||
6 | - </li> | ||
7 | - {{/ starAvatar}} | ||
8 | - </ul> | ||
9 | -</div> | ||
10 | -<div class="fliptop">松手开始刷新...</div> | 1 | +<div class="loading-tip">松手开始刷新...</div> |
11 | <div class="star-wrap"> | 2 | <div class="star-wrap"> |
12 | <div class="star-content"> | 3 | <div class="star-content"> |
13 | {{#content}} | 4 | {{#content}} |
@@ -16,14 +7,16 @@ | @@ -16,14 +7,16 @@ | ||
16 | {{/if}} | 7 | {{/if}} |
17 | {{/content}} | 8 | {{/content}} |
18 | 9 | ||
19 | - <div class="avatar-swiper avatar-0"> | ||
20 | - <ul class="clearfix swiper-wrapper"> | ||
21 | - {{# starAvatar}} | ||
22 | - <li class="swiper-slide"> | ||
23 | - <img class="rank-avatar" data-url="{{url}}" src="{{image cover 180 180}}"> | ||
24 | - </li> | ||
25 | - {{/ starAvatar}} | ||
26 | - </ul> | 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 | + <img class="rank-avatar" data-url="{{url}}" src="{{image cover 180 180}}"> | ||
16 | + </li> | ||
17 | + {{/ starAvatar}} | ||
18 | + </ul> | ||
19 | + </div> | ||
27 | </div> | 20 | </div> |
28 | 21 | ||
29 | <ul class="star-info clearfix"> | 22 | <ul class="star-info clearfix"> |
@@ -87,5 +80,3 @@ | @@ -87,5 +80,3 @@ | ||
87 | </div> | 80 | </div> |
88 | </div> | 81 | </div> |
89 | </div> --}} | 82 | </div> --}} |
90 | - | ||
91 | - |
@@ -33,11 +33,11 @@ | @@ -33,11 +33,11 @@ | ||
33 | "dependencies": { | 33 | "dependencies": { |
34 | "bluebird": "^3.4.0", | 34 | "bluebird": "^3.4.0", |
35 | "body-parser": "^1.15.0", | 35 | "body-parser": "^1.15.0", |
36 | - "cookie-parser": "^1.4.1", | 36 | + "cookie-parser": "^1.4.3", |
37 | "express": "^4.13.1", | 37 | "express": "^4.13.1", |
38 | "express-handlebars": "^3.0.0", | 38 | "express-handlebars": "^3.0.0", |
39 | "influxdb-winston": "^1.0.1", | 39 | "influxdb-winston": "^1.0.1", |
40 | - "lodash": "^4.12.0", | 40 | + "lodash": "^4.13.1", |
41 | "md5": "^2.1.0", | 41 | "md5": "^2.1.0", |
42 | "memcached": "^2.2.1", | 42 | "memcached": "^2.2.1", |
43 | "moment": "^2.13.0", | 43 | "moment": "^2.13.0", |
@@ -49,16 +49,16 @@ | @@ -49,16 +49,16 @@ | ||
49 | "serve-favicon": "^2.3.0", | 49 | "serve-favicon": "^2.3.0", |
50 | "uuid": "^2.0.2", | 50 | "uuid": "^2.0.2", |
51 | "winston": "^2.2.0", | 51 | "winston": "^2.2.0", |
52 | - "winston-daily-rotate-file": "^1.0.1", | 52 | + "winston-daily-rotate-file": "^1.1.3", |
53 | "yoho-connect-memcached": "^1.0.3", | 53 | "yoho-connect-memcached": "^1.0.3", |
54 | "yoho-express-session": "^1.0.3" | 54 | "yoho-express-session": "^1.0.3" |
55 | }, | 55 | }, |
56 | "devDependencies": { | 56 | "devDependencies": { |
57 | "autoprefixer": "^6.3.6", | 57 | "autoprefixer": "^6.3.6", |
58 | - "ava": "^0.14.0", | 58 | + "ava": "^0.15.2", |
59 | "babel-preset-es2015": "^6.9.0", | 59 | "babel-preset-es2015": "^6.9.0", |
60 | "babel-register": "^6.9.0", | 60 | "babel-register": "^6.9.0", |
61 | - "eslint": "^2.10.2", | 61 | + "eslint": "^2.12.0", |
62 | "eslint-config-yoho": "^1.0.1", | 62 | "eslint-config-yoho": "^1.0.1", |
63 | "gulp": "^3.9.1", | 63 | "gulp": "^3.9.1", |
64 | "gulp-cssnano": "^2.1.2", | 64 | "gulp-cssnano": "^2.1.2", |
@@ -68,15 +68,15 @@ | @@ -68,15 +68,15 @@ | ||
68 | "gulp-util": "^3.0.7", | 68 | "gulp-util": "^3.0.7", |
69 | "husky": "^0.11.4", | 69 | "husky": "^0.11.4", |
70 | "nodemon": "1.9.2", | 70 | "nodemon": "1.9.2", |
71 | - "nyc": "^6.4.3", | 71 | + "nyc": "^6.4.4", |
72 | "postcss-assets": "^4.0.1", | 72 | "postcss-assets": "^4.0.1", |
73 | - "postcss-cachebuster": "^0.1.2", | 73 | + "postcss-cachebuster": "^0.1.3", |
74 | "postcss-calc": "^5.2.1", | 74 | "postcss-calc": "^5.2.1", |
75 | "postcss-center": "^1.0.0", | 75 | "postcss-center": "^1.0.0", |
76 | "postcss-clearfix": "^1.0.0", | 76 | "postcss-clearfix": "^1.0.0", |
77 | "postcss-crip": "^2.0.0", | 77 | "postcss-crip": "^2.0.0", |
78 | "postcss-opacity": "^3.0.0", | 78 | "postcss-opacity": "^3.0.0", |
79 | - "postcss-position": "^0.4.0", | 79 | + "postcss-position": "^0.5.0", |
80 | "postcss-pxtorem": "^3.3.1", | 80 | "postcss-pxtorem": "^3.3.1", |
81 | "postcss-short": "^1.4.0", | 81 | "postcss-short": "^1.4.0", |
82 | "postcss-sprites": "^3.1.2", | 82 | "postcss-sprites": "^3.1.2", |
@@ -84,18 +84,18 @@ | @@ -84,18 +84,18 @@ | ||
84 | "precss": "^1.4.0", | 84 | "precss": "^1.4.0", |
85 | "rewire": "^2.5.1", | 85 | "rewire": "^2.5.1", |
86 | "shelljs": "^0.7.0", | 86 | "shelljs": "^0.7.0", |
87 | - "stylelint": "^6.4.1", | 87 | + "stylelint": "^6.5.1", |
88 | "stylelint-config-yoho": "^1.2.3", | 88 | "stylelint-config-yoho": "^1.2.3", |
89 | - "webpack": "^1.13.0", | 89 | + "webpack": "^1.13.1", |
90 | "webpack-dev-server": "^1.14.1", | 90 | "webpack-dev-server": "^1.14.1", |
91 | "webpack-stream": "^3.1.0", | 91 | "webpack-stream": "^3.1.0", |
92 | "yoho-fastclick": "^1.0.6", | 92 | "yoho-fastclick": "^1.0.6", |
93 | "yoho-hammer": "^2.0.7", | 93 | "yoho-hammer": "^2.0.7", |
94 | "yoho-handlebars": "^4.0.5", | 94 | "yoho-handlebars": "^4.0.5", |
95 | - "yoho-iscroll": "0.0.2", | 95 | + "yoho-iscroll": "^5.2.0", |
96 | "yoho-jquery": "^2.2.4", | 96 | "yoho-jquery": "^2.2.4", |
97 | "yoho-jquery-lazyload": "^1.9.7", | 97 | "yoho-jquery-lazyload": "^1.9.7", |
98 | - "yoho-mlellipsis": "0.0.2", | 98 | + "yoho-mlellipsis": "0.0.3", |
99 | "yoho-swiper": "^3.3.1" | 99 | "yoho-swiper": "^3.3.1" |
100 | } | 100 | } |
101 | } | 101 | } |
@@ -16,7 +16,8 @@ var $window = $(window), | @@ -16,7 +16,8 @@ var $window = $(window), | ||
16 | $starArticle = $('.star-article'), | 16 | $starArticle = $('.star-article'), |
17 | $headTab = $('.head-tab'), | 17 | $headTab = $('.head-tab'), |
18 | stopLoading = false, | 18 | stopLoading = false, |
19 | - avatarSwiper = []; | 19 | + avatarSwiper = [], |
20 | + getIndexHtml; | ||
20 | 21 | ||
21 | /* | 22 | /* |
22 | $swiperView = $('.swiper-view'), | 23 | $swiperView = $('.swiper-view'), |
@@ -49,132 +50,62 @@ function txtLimit(dom, item1, item2) { | @@ -49,132 +50,62 @@ function txtLimit(dom, item1, item2) { | ||
49 | // 设置默认头像 | 50 | // 设置默认头像 |
50 | function setAvatar($userAvatar) { | 51 | function setAvatar($userAvatar) { |
51 | var myImage = new Image(), | 52 | var myImage = new Image(), |
52 | - avatar; | 53 | + avatar = ''; |
53 | 54 | ||
54 | // 部分老用户没有头像,显示默认头像 | 55 | // 部分老用户没有头像,显示默认头像 |
55 | avatar = $userAvatar.data('avatar'); | 56 | avatar = $userAvatar.data('avatar'); |
56 | - myImage.src = avatar || ''; | 57 | + |
58 | + if (avatar) { | ||
59 | + myImage.src = avatar; | ||
60 | + } | ||
61 | + | ||
57 | myImage.onload = function() { | 62 | myImage.onload = function() { |
58 | $userAvatar.css('background-image', 'url(' + avatar + ')'); | 63 | $userAvatar.css('background-image', 'url(' + avatar + ')'); |
59 | }; | 64 | }; |
60 | } | 65 | } |
61 | 66 | ||
62 | -function ajaxHtml() { | ||
63 | - loading.showLoadingMask(); | ||
64 | - $.ajax({ | ||
65 | - type: 'GET', | ||
66 | - url: '/guang/star/ajaxIndexHtml', | ||
67 | - dataType: 'html', | ||
68 | - success: function(data) { | ||
69 | - stopLoading = false; | ||
70 | - | ||
71 | - if (data === '') { | ||
72 | - stopLoading = true; | ||
73 | - tip.show('没有更多内容了'); | ||
74 | - } | ||
75 | - | ||
76 | - $('.star-main').html(data); | ||
77 | - | ||
78 | - // 限制标题字数 | ||
79 | - $('.cont-area').each(function() { | ||
80 | - txtLimit($(this), '.title', '.cont-txt'); | ||
81 | - }); | ||
82 | - | ||
83 | - loading.hideLoadingMask(); | ||
84 | - lazyLoad($('img.lazy')); | ||
85 | - bannerLen = $('.avatar-0 .swiper-slide').length; | ||
86 | - | ||
87 | - setTimeout(function() { | ||
88 | - setIndexAction(); | ||
89 | - }, 100); | ||
90 | - | ||
91 | - }, | ||
92 | - error: function() { | ||
93 | - tip.show('网络断开连接了~'); | ||
94 | - } | ||
95 | - }); | ||
96 | -} | ||
97 | - | ||
98 | function setIndexAction() { | 67 | function setIndexAction() { |
99 | var starIScroll; | 68 | var starIScroll; |
100 | - | ||
101 | - var $avatar0 = $('.avatar-0'), | ||
102 | - $avatar1 = $('.avatar-1'); | 69 | + var commonHeaderTop = $('#yoho-header').outerHeight(); |
70 | + var $loadingTip = $('.loading-tip'); | ||
71 | + var $avatarWrap = $('.avatar-wrap'); | ||
103 | 72 | ||
104 | // 下拉刷新,上拉加载 | 73 | // 下拉刷新,上拉加载 |
105 | starIScroll = new PullRefresh('.star-wrap', { | 74 | starIScroll = new PullRefresh('.star-wrap', { |
106 | - height: $(window).height() - $('#yoho-header').height() - $('.head-tab').height(), | 75 | + height: $(window).height() - commonHeaderTop, |
107 | pullDown: function() { | 76 | pullDown: function() { |
108 | if (!stopLoading) { | 77 | if (!stopLoading) { |
109 | stopLoading = true; | 78 | stopLoading = true; |
110 | - ajaxHtml(); | 79 | + getIndexHtml(); |
111 | } | 80 | } |
112 | } | 81 | } |
113 | - | ||
114 | - // pullUp: function() { | ||
115 | - // // $headTab.slideUp(); | ||
116 | - // } | ||
117 | }); | 82 | }); |
118 | 83 | ||
119 | starIScroll.iScroll.on('scrollStart', function() { | 84 | starIScroll.iScroll.on('scrollStart', function() { |
120 | - $window.trigger('scroll'); | ||
121 | - | ||
122 | - // 上滑 | ||
123 | - if (this.directionY === 1) { | ||
124 | - $headTab.slideUp(); | ||
125 | - } else { | ||
126 | - $headTab.slideDown(); | ||
127 | - } | ||
128 | - | ||
129 | // 下拉 | 85 | // 下拉 |
130 | if (this.directionY === -1) { | 86 | if (this.directionY === -1) { |
131 | - $('.fliptop').slideDown(); | 87 | + $headTab.slideDown(); |
88 | + $loadingTip.slideDown(); | ||
132 | } | 89 | } |
133 | }); | 90 | }); |
134 | 91 | ||
135 | starIScroll.iScroll.on('scroll', function() { | 92 | starIScroll.iScroll.on('scroll', function() { |
136 | - // var scale = 1; | ||
137 | - | ||
138 | - // if (this.y < 0 && this.startY > -40) { | ||
139 | - // console.log(headTabHeight + this.startY); | ||
140 | - // scale = 2 / headTabHeight; | ||
141 | - // } | ||
142 | - // $headTab.css({ | ||
143 | - // transfrom: 'scale(' + scale + ')' | ||
144 | - // }); | ||
145 | - | ||
146 | - if (this.startY < -180) { | ||
147 | - $avatar0.hide(); | ||
148 | - $avatar1.show(); | ||
149 | - | ||
150 | - if (!avatarSwiper[1]) { | ||
151 | - avatarSwiper[1] = new Swiper('.avatar-1', { | ||
152 | - loop: true, | ||
153 | - | ||
154 | - // loopedSlides: bannerLen, | ||
155 | - initialSlide: 2, | ||
156 | - centeredSlides: true, | ||
157 | - slidesPerView: 'auto', | ||
158 | - spaceBetween: 10, | ||
159 | - slidesOffsetBefore: '-' + $('.avatar-1').find('li').not('.swiper-slide-visible').width() / 2, | ||
160 | - watchSlidesProgress: true, | ||
161 | - watchSlidesVisibility: true, | ||
162 | - observer: true, | ||
163 | - observeParents: true | ||
164 | - }); | ||
165 | - | ||
166 | - avatarSwiper[0].params.control = avatarSwiper[1];// 需要在Swiper2初始化后,Swiper1控制Swiper2 | ||
167 | - avatarSwiper[1].params.control = avatarSwiper[0];// 需要在Swiper1初始化后,Swiper2控制Swiper1 | ||
168 | - } | ||
169 | - | ||
170 | - // avatarSwiper[1].slideTo($avatar0.find('.swiper-slide-active').index(), 1000, false); | 93 | + if (commonHeaderTop > $avatarWrap.offset().top) { |
94 | + // $('.avatar-clone').css('top', $('.head-tab').outerHeight()); | ||
95 | + $('.avatar-clone').show(); | ||
96 | + starIScroll[0].update(); | ||
97 | + starIScroll[1].update(); | ||
98 | + } else { | ||
99 | + $('.avatar-clone').hide(); | ||
171 | } | 100 | } |
172 | }); | 101 | }); |
173 | 102 | ||
174 | starIScroll.iScroll.on('scrollEnd', function() { | 103 | starIScroll.iScroll.on('scrollEnd', function() { |
175 | - $window.trigger('scroll'); | ||
176 | - | ||
177 | - $('.fliptop').slideUp(); | 104 | + // 上滑 |
105 | + if (this.directionY === 1) { | ||
106 | + $headTab.slideUp(1000); | ||
107 | + } | ||
108 | + $loadingTip.slideUp(); | ||
178 | }); | 109 | }); |
179 | 110 | ||
180 | // 明星动态文章图片相关操作 | 111 | // 明星动态文章图片相关操作 |
@@ -268,7 +199,7 @@ function setIndexAction() { | @@ -268,7 +199,7 @@ function setIndexAction() { | ||
268 | // } | 199 | // } |
269 | 200 | ||
270 | if (bannerLen > 1) { | 201 | if (bannerLen > 1) { |
271 | - avatarSwiper[0] = new Swiper('.avatar-0', { | 202 | + avatarSwiper = new Swiper('.avatar', { |
272 | loop: true, | 203 | loop: true, |
273 | 204 | ||
274 | // loopedSlides: bannerLen, | 205 | // loopedSlides: bannerLen, |
@@ -276,12 +207,15 @@ function setIndexAction() { | @@ -276,12 +207,15 @@ function setIndexAction() { | ||
276 | centeredSlides: true, | 207 | centeredSlides: true, |
277 | slidesPerView: 'auto', | 208 | slidesPerView: 'auto', |
278 | spaceBetween: 10, | 209 | spaceBetween: 10, |
279 | - slidesOffsetBefore: '-' + $('.avatar-0').find('li').not('.swiper-slide-visible').width() / 2, | 210 | + slidesOffsetBefore: -($('.avatar').find('li').not('.swiper-slide-visible').width() / 2), |
280 | watchSlidesProgress: true, | 211 | watchSlidesProgress: true, |
281 | watchSlidesVisibility: true, | 212 | watchSlidesVisibility: true, |
282 | observer: true, | 213 | observer: true, |
283 | observeParents: true | 214 | observeParents: true |
284 | }); | 215 | }); |
216 | + | ||
217 | + avatarSwiper[0].params.control = avatarSwiper[1];// 需要在Swiper2初始化后,Swiper1控制Swiper2 | ||
218 | + avatarSwiper[1].params.control = avatarSwiper[0];// 需要在Swiper1初始化后,Swiper2控制Swiper1 | ||
285 | } | 219 | } |
286 | 220 | ||
287 | // 明星动态头像左右滑动 | 221 | // 明星动态头像左右滑动 |
@@ -324,4 +258,43 @@ function setIndexAction() { | @@ -324,4 +258,43 @@ function setIndexAction() { | ||
324 | 258 | ||
325 | } | 259 | } |
326 | 260 | ||
327 | -ajaxHtml(); | 261 | +getIndexHtml = function() { |
262 | + var $starMain = $('.star-main'); | ||
263 | + | ||
264 | + loading.showLoadingMask(); | ||
265 | + $.ajax({ | ||
266 | + url: '/guang/star/getIndexHtml', | ||
267 | + dataType: 'html', | ||
268 | + success: function(data) { | ||
269 | + stopLoading = false; | ||
270 | + | ||
271 | + if (!data) { | ||
272 | + stopLoading = true; | ||
273 | + tip.show('没有更多内容了'); | ||
274 | + } | ||
275 | + | ||
276 | + $starMain.html(data); | ||
277 | + bannerLen = $('.avatar .swiper-slide').length; | ||
278 | + | ||
279 | + $starMain.prepend($('.avatar-swiper').clone().addClass('avatar-clone').hide()); | ||
280 | + | ||
281 | + // 限制标题字数 | ||
282 | + $('.cont-area').each(function() { | ||
283 | + txtLimit($(this), '.title', '.cont-txt'); | ||
284 | + }); | ||
285 | + | ||
286 | + loading.hideLoadingMask(); | ||
287 | + lazyLoad($('img.lazy')); | ||
288 | + | ||
289 | + setTimeout(function() { | ||
290 | + setIndexAction(); | ||
291 | + }, 100); | ||
292 | + | ||
293 | + }, | ||
294 | + error: function() { | ||
295 | + tip.show('网络断开连接了~'); | ||
296 | + } | ||
297 | + }); | ||
298 | +}; | ||
299 | + | ||
300 | +getIndexHtml(); |
@@ -48,3 +48,5 @@ function hideLoadingMask() { | @@ -48,3 +48,5 @@ function hideLoadingMask() { | ||
48 | exports.init = init; | 48 | exports.init = init; |
49 | exports.showLoadingMask = showLoadingMask; | 49 | exports.showLoadingMask = showLoadingMask; |
50 | exports.hideLoadingMask = hideLoadingMask; | 50 | exports.hideLoadingMask = hideLoadingMask; |
51 | +exports.show = showLoadingMask; | ||
52 | +exports.hide = hideLoadingMask; |
@@ -18,7 +18,8 @@ var $ = require('yoho-jquery'), | @@ -18,7 +18,8 @@ var $ = require('yoho-jquery'), | ||
18 | // }); | 18 | // }); |
19 | 19 | ||
20 | function PullRefresh(seclector, options) { | 20 | function PullRefresh(seclector, options) { |
21 | - var $em, | 21 | + var $window = $(window), |
22 | + $em, | ||
22 | pullFormTop = false, | 23 | pullFormTop = false, |
23 | pullStart, | 24 | pullStart, |
24 | topOffset; | 25 | topOffset; |
@@ -46,6 +47,7 @@ function PullRefresh(seclector, options) { | @@ -46,6 +47,7 @@ function PullRefresh(seclector, options) { | ||
46 | } | 47 | } |
47 | 48 | ||
48 | pullStart = this.y; | 49 | pullStart = this.y; |
50 | + $window.trigger('scroll'); | ||
49 | }); | 51 | }); |
50 | 52 | ||
51 | this.iScroll.on('scrollEnd', function() { | 53 | this.iScroll.on('scrollEnd', function() { |
@@ -57,6 +59,8 @@ function PullRefresh(seclector, options) { | @@ -57,6 +59,8 @@ function PullRefresh(seclector, options) { | ||
57 | if (pullStart === this.y && this.directionY === 1) { | 59 | if (pullStart === this.y && this.directionY === 1) { |
58 | options.pullUp && options.pullUp(); | 60 | options.pullUp && options.pullUp(); |
59 | } | 61 | } |
62 | + | ||
63 | + $window.trigger('scroll'); | ||
60 | }); | 64 | }); |
61 | } | 65 | } |
62 | 66 |
@@ -115,6 +115,16 @@ | @@ -115,6 +115,16 @@ | ||
115 | overflow: hidden; | 115 | overflow: hidden; |
116 | margin-top: 30px; | 116 | margin-top: 30px; |
117 | 117 | ||
118 | + &.avatar-clone { | ||
119 | + position: fixed; | ||
120 | + left: 0; | ||
121 | + top: 0; | ||
122 | + margin-top: 86px; | ||
123 | + padding: 5px 0; | ||
124 | + background: #000; | ||
125 | + z-index: 9; | ||
126 | + } | ||
127 | + | ||
118 | li { | 128 | li { |
119 | float: left; | 129 | float: left; |
120 | width: auto; | 130 | width: auto; |
@@ -356,15 +366,7 @@ | @@ -356,15 +366,7 @@ | ||
356 | background-size: contain; | 366 | background-size: contain; |
357 | } | 367 | } |
358 | 368 | ||
359 | - .avatar-1 { | ||
360 | - background: #000; | ||
361 | - position: relative; | ||
362 | - z-index: 9; | ||
363 | - margin-top: 0; | ||
364 | - display: none; | ||
365 | - } | ||
366 | - | ||
367 | - .fliptop { | 369 | + .loading-tip { |
368 | display: none; | 370 | display: none; |
369 | text-align: center; | 371 | text-align: center; |
370 | color: #ccc; | 372 | color: #ccc; |
-
Please register or login to post a comment