Merge remote-tracking branch 'origin/release/wap-optim'
# Conflicts: # config/common.js # package.json
Showing
17 changed files
with
89 additions
and
42 deletions
@@ -8,7 +8,7 @@ | @@ -8,7 +8,7 @@ | ||
8 | </li> | 8 | </li> |
9 | {{/ navs}} | 9 | {{/ navs}} |
10 | </ul> | 10 | </ul> |
11 | - | 11 | + |
12 | <div id="info-list" class="info-list-container"> | 12 | <div id="info-list" class="info-list-container"> |
13 | {{# infos}} | 13 | {{# infos}} |
14 | <div class="info-list{{^show}} hide{{/show}}"> | 14 | <div class="info-list{{^show}} hide{{/show}}"> |
@@ -19,7 +19,11 @@ | @@ -19,7 +19,11 @@ | ||
19 | {{# ../swiper}} | 19 | {{# ../swiper}} |
20 | <div class="swiper-slide"> | 20 | <div class="swiper-slide"> |
21 | <a href="{{url}}"> | 21 | <a href="{{url}}"> |
22 | + {{#if @first}} | ||
23 | + <img src="{{img}}"> | ||
24 | + {{^}} | ||
22 | <img class="swiper-lazy" data-src="{{img}}"> | 25 | <img class="swiper-lazy" data-src="{{img}}"> |
26 | + {{/if}} | ||
23 | </a> | 27 | </a> |
24 | <div class="swiper-lazy-preloader"></div> | 28 | <div class="swiper-lazy-preloader"></div> |
25 | </div> | 29 | </div> |
@@ -45,4 +49,4 @@ | @@ -45,4 +49,4 @@ | ||
45 | <input id="gender" type="hidden" value={{gender}}> | 49 | <input id="gender" type="hidden" value={{gender}}> |
46 | {{/ guang}} | 50 | {{/ guang}} |
47 | </div> | 51 | </div> |
48 | -{{> footer-tab}} | ||
52 | +{{> footer-tab}} |
@@ -36,7 +36,11 @@ | @@ -36,7 +36,11 @@ | ||
36 | </a> | 36 | </a> |
37 | {{/if}} | 37 | {{/if}} |
38 | <a href="{{url}}"> | 38 | <a href="{{url}}"> |
39 | - <img class="lazy" data-original="{{img}}" alt="{{alt}}"> | 39 | + {{#if ../@first}} |
40 | + <img src="{{img}}" alt="{{alt}}"> | ||
41 | + {{^}} | ||
42 | + <img class="lazy" data-original="{{img}}" alt="{{alt}}"> | ||
43 | + {{/if}} | ||
40 | </a> | 44 | </a> |
41 | </div> | 45 | </div> |
42 | 46 | ||
@@ -47,4 +51,4 @@ | @@ -47,4 +51,4 @@ | ||
47 | <p class="info-text">{{text}}</p> | 51 | <p class="info-text">{{text}}</p> |
48 | {{> tvls}} | 52 | {{> tvls}} |
49 | </div> | 53 | </div> |
50 | -</div> | ||
54 | +</div> |
@@ -234,7 +234,8 @@ const category = (req, res, next) => { | @@ -234,7 +234,8 @@ const category = (req, res, next) => { | ||
234 | firstPageGoodsList: firstScreenGoodsList.list, | 234 | firstPageGoodsList: firstScreenGoodsList.list, |
235 | showDownloadApp: true, | 235 | showDownloadApp: true, |
236 | pageFooter: true, | 236 | pageFooter: true, |
237 | - category: true | 237 | + category: true, |
238 | + localCss: true | ||
238 | }); | 239 | }); |
239 | }).catch(next); | 240 | }).catch(next); |
240 | }; | 241 | }; |
@@ -276,9 +276,10 @@ const shop = { | @@ -276,9 +276,10 @@ const shop = { | ||
276 | }, | 276 | }, |
277 | shopHotList(req, res, next) { | 277 | shopHotList(req, res, next) { |
278 | let skns = req.query.skns; | 278 | let skns = req.query.skns; |
279 | + let isApp = req.query.app_version || req.query.appVersion || false; | ||
279 | 280 | ||
280 | return listModel.searchProductBySkn(skns).then(hotList => { | 281 | return listModel.searchProductBySkn(skns).then(hotList => { |
281 | - hotList = productProcess.processProductList(hotList, {isApp: req.yoho.isApp}); | 282 | + hotList = productProcess.processProductList(hotList, {isApp: isApp}); |
282 | _.forEach(hotList, (value, key) => { | 283 | _.forEach(hotList, (value, key) => { |
283 | hotList[key].tags = {}; | 284 | hotList[key].tags = {}; |
284 | hotList[key].is_soon_sold_out = false; | 285 | hotList[key].is_soon_sold_out = false; |
@@ -101,6 +101,8 @@ const tool = { | @@ -101,6 +101,8 @@ const tool = { | ||
101 | let bannerList = []; | 101 | let bannerList = []; |
102 | 102 | ||
103 | _.forEach(goodsGroup, function(value) { | 103 | _.forEach(goodsGroup, function(value) { |
104 | + value.img = _.replace(value.img, '/quality/80', '/quality/70'); | ||
105 | + | ||
104 | bannerList.push({ | 106 | bannerList.push({ |
105 | img: value.img | 107 | img: value.img |
106 | }); | 108 | }); |
@@ -313,7 +315,7 @@ const newDetail = { | @@ -313,7 +315,7 @@ const newDetail = { | ||
313 | 315 | ||
314 | return api.get('', params, cacheConf) | 316 | return api.get('', params, cacheConf) |
315 | .then(result => { | 317 | .then(result => { |
316 | - if (result.code === 200) { | 318 | + if (result && result.code === 200) { |
317 | return result.data; | 319 | return result.data; |
318 | } | 320 | } |
319 | 321 |
@@ -18,6 +18,7 @@ const cachePage = { | @@ -18,6 +18,7 @@ const cachePage = { | ||
18 | // 商品详情页 | 18 | // 商品详情页 |
19 | '/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE, | 19 | '/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE, |
20 | '/product/\\/show_([\\d]+)/': 30 * MINUTE, | 20 | '/product/\\/show_([\\d]+)/': 30 * MINUTE, |
21 | + // 商品详情ajax | ||
21 | 22 | ||
22 | // 逛 | 23 | // 逛 |
23 | '/guang/': 1 * MINUTE, | 24 | '/guang/': 1 * MINUTE, |
@@ -16,10 +16,10 @@ module.exports = { | @@ -16,10 +16,10 @@ module.exports = { | ||
16 | siteUrl: '//m.yohobuy.com', | 16 | siteUrl: '//m.yohobuy.com', |
17 | assetUrl: '//localhost:5001', | 17 | assetUrl: '//localhost:5001', |
18 | domains: { | 18 | domains: { |
19 | - // api: 'http://api.yoho.cn/', | ||
20 | - // service: 'http://service.yoho.cn/', | ||
21 | - // liveApi: 'http://api.live.yoho.cn/', | ||
22 | - // singleApi: 'http://single.yoho.cn/' | 19 | + api: 'http://api.yoho.cn/', |
20 | + service: 'http://service.yoho.cn/', | ||
21 | + liveApi: 'http://api.live.yoho.cn/', | ||
22 | + singleApi: 'http://single.yoho.cn/' | ||
23 | 23 | ||
24 | // api: 'http://api-test3.yohops.com:9999/', | 24 | // api: 'http://api-test3.yohops.com:9999/', |
25 | // service: 'http://service-test3.yohops.com:9999/', | 25 | // service: 'http://service-test3.yohops.com:9999/', |
@@ -31,10 +31,10 @@ module.exports = { | @@ -31,10 +31,10 @@ module.exports = { | ||
31 | // service: 'http://192.168.102.205:8080/gateway/', | 31 | // service: 'http://192.168.102.205:8080/gateway/', |
32 | // search: 'http://192.168.102.216:8080/yohosearch/' | 32 | // search: 'http://192.168.102.216:8080/yohosearch/' |
33 | 33 | ||
34 | - // api: 'http://api.yoho.yohoops.org/', | ||
35 | - // service: 'http://service.yoho.yohoops.org/', | ||
36 | - // liveApi: 'http://api.live.yoho.cn/', | ||
37 | - // singleApi: 'http://single.yoho.cn/' | 34 | + //api: 'http://api.yoho.yohoops.org/', |
35 | + //service: 'http://service.yoho.yohoops.org/', | ||
36 | + //liveApi: 'http://api.live.yoho.cn/', | ||
37 | + //singleApi: 'http://single.yoho.cn/' | ||
38 | 38 | ||
39 | // api: 'http://dev-api.yohops.com:9999/', | 39 | // api: 'http://dev-api.yohops.com:9999/', |
40 | // service: 'http://dev-service.yohops.com:9999/', | 40 | // service: 'http://dev-service.yohops.com:9999/', |
@@ -51,11 +51,11 @@ module.exports = { | @@ -51,11 +51,11 @@ module.exports = { | ||
51 | activity: '//activity.yohobuy.com', | 51 | activity: '//activity.yohobuy.com', |
52 | index: '//m.yohobuy.com' | 52 | index: '//m.yohobuy.com' |
53 | }, | 53 | }, |
54 | - useCache: false, | 54 | + useCache: true, |
55 | memcache: { | 55 | memcache: { |
56 | - master: ['192.168.102.168:12111'], | ||
57 | - slave: ['192.168.102.168:12111'], | ||
58 | - session: ['192.168.102.168:12111'], | 56 | + master: ['127.0.0.1:11211'], |
57 | + slave: ['127.0.0.1:11211'], | ||
58 | + session: ['127.0.0.1:11211'], | ||
59 | timeout: 1000, | 59 | timeout: 1000, |
60 | retries: 0 | 60 | retries: 0 |
61 | }, | 61 | }, |
@@ -30,14 +30,17 @@ | @@ -30,14 +30,17 @@ | ||
30 | </script> | 30 | </script> |
31 | {{/if}} | 31 | {{/if}} |
32 | {{#if devEnv}} | 32 | {{#if devEnv}} |
33 | + | ||
34 | + | ||
35 | + {{#if localCss}} | ||
36 | + <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/common.css"> | ||
37 | + <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css"> | ||
38 | + {{^}} | ||
33 | {{#if shopPage}} | 39 | {{#if shopPage}} |
34 | <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/shop.css"> | 40 | <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/shop.css"> |
35 | - {{^}} | 41 | + {{^}} |
36 | <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css"> | 42 | <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css"> |
37 | {{/if}} | 43 | {{/if}} |
38 | - | ||
39 | - {{#if localCss}} | ||
40 | - <link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css"> | ||
41 | {{/if}} | 44 | {{/if}} |
42 | 45 | ||
43 | {{#if vue}} | 46 | {{#if vue}} |
@@ -51,6 +54,7 @@ | @@ -51,6 +54,7 @@ | ||
51 | {{/if}} | 54 | {{/if}} |
52 | 55 | ||
53 | {{#if localCss}} | 56 | {{#if localCss}} |
57 | + <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/common.css"> | ||
54 | <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css"> | 58 | <link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css"> |
55 | {{/if}} | 59 | {{/if}} |
56 | 60 |
1 | { | 1 | { |
2 | "name": "m-yohobuy-node", | 2 | "name": "m-yohobuy-node", |
3 | - "version": "5.2.10", | 3 | + "version": "5.2.11", |
4 | "private": true, | 4 | "private": true, |
5 | "description": "A New Yohobuy Project With Express", | 5 | "description": "A New Yohobuy Project With Express", |
6 | "repository": { | 6 | "repository": { |
@@ -93,7 +93,7 @@ | @@ -93,7 +93,7 @@ | ||
93 | "yoho-handlebars": "^4.0.5", | 93 | "yoho-handlebars": "^4.0.5", |
94 | "yoho-iscroll": "^5.2.0", | 94 | "yoho-iscroll": "^5.2.0", |
95 | "yoho-jquery": "^2.2.4", | 95 | "yoho-jquery": "^2.2.4", |
96 | - "yoho-jquery-lazyload": "^1.9.7", | 96 | + "yoho-jquery-lazyload": "^1.9.8", |
97 | "yoho-jquery-qrcode": "^0.14.0", | 97 | "yoho-jquery-qrcode": "^0.14.0", |
98 | "yoho-mlellipsis": "0.0.3", | 98 | "yoho-mlellipsis": "0.0.3", |
99 | "yoho-qs": "^1.0.1", | 99 | "yoho-qs": "^1.0.1", |
@@ -148,7 +148,7 @@ gulp.task('dist', ['ge'], () => { | @@ -148,7 +148,7 @@ gulp.task('dist', ['ge'], () => { | ||
148 | 148 | ||
149 | // postcss compile in dev | 149 | // postcss compile in dev |
150 | gulp.task('postcss-dev', () => { | 150 | gulp.task('postcss-dev', () => { |
151 | - return gulp.src(['scss/shop.css', 'scss/index.css']) | 151 | + return gulp.src(['scss/shop.css', 'scss/index.css', 'scss/common.css']) |
152 | .pipe(sourcemaps.init()) | 152 | .pipe(sourcemaps.init()) |
153 | .pipe(postcss(postcssPlugin(env.dev), { | 153 | .pipe(postcss(postcssPlugin(env.dev), { |
154 | parser: require('postcss-scss') | 154 | parser: require('postcss-scss') |
@@ -179,7 +179,7 @@ gulp.task('font', () => { | @@ -179,7 +179,7 @@ gulp.task('font', () => { | ||
179 | 179 | ||
180 | // postcss compile in pro | 180 | // postcss compile in pro |
181 | gulp.task('postcss', ['assets'], () => { | 181 | gulp.task('postcss', ['assets'], () => { |
182 | - return gulp.src(['scss/shop.css', 'scss/index.css']) | 182 | + return gulp.src(['scss/shop.css', 'scss/index.css', 'scss/common.css']) |
183 | .pipe(postcss(postcssPlugin(env.pro), { | 183 | .pipe(postcss(postcssPlugin(env.pro), { |
184 | parser: require('postcss-scss') | 184 | parser: require('postcss-scss') |
185 | })) | 185 | })) |
@@ -5,6 +5,17 @@ var goodsId = $('#goodsId').val(); | @@ -5,6 +5,17 @@ var goodsId = $('#goodsId').val(); | ||
5 | var productSkn = $('#productSkn').val(); | 5 | var productSkn = $('#productSkn').val(); |
6 | var brandId = $('#brand-id').val(); | 6 | var brandId = $('#brand-id').val(); |
7 | 7 | ||
8 | +require('../common'); | ||
9 | + | ||
10 | +// 领券 | ||
11 | +require('./detail/brand-coupon'); | ||
12 | + | ||
13 | +// 页面底部异步加载的部分 | ||
14 | +require('./detail/desc'); | ||
15 | + | ||
16 | +// 喂你优选 | ||
17 | +require('./detail/recommend-for-you-product-desc'); | ||
18 | + | ||
8 | setTimeout(() => { | 19 | setTimeout(() => { |
9 | var Swiper = require('yoho-swiper'); | 20 | var Swiper = require('yoho-swiper'); |
10 | 21 | ||
@@ -20,18 +31,7 @@ setTimeout(() => { | @@ -20,18 +31,7 @@ setTimeout(() => { | ||
20 | prevButton: '.my-swiper-button-prev', | 31 | prevButton: '.my-swiper-button-prev', |
21 | spaceBetween: 3 | 32 | spaceBetween: 3 |
22 | }); | 33 | }); |
23 | - | ||
24 | - require('../common'); | ||
25 | - | ||
26 | - // 领券 | ||
27 | - require('./detail/brand-coupon'); | ||
28 | - | ||
29 | - // 页面底部异步加载的部分 | ||
30 | - require('./detail/desc'); | ||
31 | - | ||
32 | - // 喂你优选 | ||
33 | - require('./detail/recommend-for-you-product-desc'); | ||
34 | -}, 100); | 34 | +}, 500); |
35 | 35 | ||
36 | 36 | ||
37 | // 动态加载数据 | 37 | // 动态加载数据 |
@@ -4,6 +4,8 @@ | @@ -4,6 +4,8 @@ | ||
4 | * @date: 2016/7/21 | 4 | * @date: 2016/7/21 |
5 | */ | 5 | */ |
6 | 6 | ||
7 | +require('../../scss/product/search/list.page.css'); | ||
8 | + | ||
7 | require('./search/list'); | 9 | require('./search/list'); |
8 | require('../common/footer'); | 10 | require('../common/footer'); |
9 | require('./shop/coupon'); | 11 | require('./shop/coupon'); |
@@ -464,6 +464,10 @@ function search(opt) { | @@ -464,6 +464,10 @@ function search(opt) { | ||
464 | 464 | ||
465 | argument = setting; | 465 | argument = setting; |
466 | 466 | ||
467 | + if (!firstScreen) { | ||
468 | + $fsgc.addClass('hide'); | ||
469 | + } | ||
470 | + | ||
467 | $.ajax({ | 471 | $.ajax({ |
468 | type: 'GET', | 472 | type: 'GET', |
469 | url: location.protocol + '//m.yohobuy.com/product/search/search', | 473 | url: location.protocol + '//m.yohobuy.com/product/search/search', |
@@ -751,7 +755,6 @@ if ($brandHeader.data('isbaseshop') === true) { | @@ -751,7 +755,6 @@ if ($brandHeader.data('isbaseshop') === true) { | ||
751 | } | 755 | } |
752 | 756 | ||
753 | $.extend(defaultOpt, pars); | 757 | $.extend(defaultOpt, pars); |
754 | - | ||
755 | $.ajax({ | 758 | $.ajax({ |
756 | type: 'GET', | 759 | type: 'GET', |
757 | url: location.protocol + '//m.yohobuy.com/product/search/filter', | 760 | url: location.protocol + '//m.yohobuy.com/product/search/filter', |
@@ -1071,7 +1074,9 @@ if ($brandHeader.length > 0) { | @@ -1071,7 +1074,9 @@ if ($brandHeader.length > 0) { | ||
1071 | } | 1074 | } |
1072 | 1075 | ||
1073 | // 初始请求最新第一页数据 | 1076 | // 初始请求最新第一页数据 |
1074 | -search(); | 1077 | +setTimeout(function() { |
1078 | + search(); | ||
1079 | +}, 500); | ||
1075 | 1080 | ||
1076 | $listNav.on('touchstart', 'li', function() { | 1081 | $listNav.on('touchstart', 'li', function() { |
1077 | $listNav.find('li').removeClass('bytouch'); | 1082 | $listNav.find('li').removeClass('bytouch'); |
@@ -90,7 +90,7 @@ var defaultOpt = require('../common/query-param'); | @@ -90,7 +90,7 @@ var defaultOpt = require('../common/query-param'); | ||
90 | if ($('.popularity-title').data('skns')) { | 90 | if ($('.popularity-title').data('skns')) { |
91 | $.ajax({ | 91 | $.ajax({ |
92 | type: 'GET', | 92 | type: 'GET', |
93 | - url: '/product/new/shop/hotlist', | 93 | + url: '/product/new/shop/hotlist?app_version=' + appVersion, |
94 | xhrFields: { | 94 | xhrFields: { |
95 | withCredentials: true | 95 | withCredentials: true |
96 | }, | 96 | }, |
public/scss/common.css
0 → 100644
@@ -3,3 +3,8 @@ | @@ -3,3 +3,8 @@ | ||
3 | @import "product-description"; | 3 | @import "product-description"; |
4 | @import "recommend-for-you"; | 4 | @import "recommend-for-you"; |
5 | @import "brand-coupon"; | 5 | @import "brand-coupon"; |
6 | +@import "../../layout/swiper"; | ||
7 | +@import "../../channel/banner-top"; | ||
8 | +@import "../../common/good"; | ||
9 | +@import "../../cart/chose-panel"; | ||
10 | + |
-
Please register or login to post a comment