Authored by 徐炜

Merge remote-tracking branch 'origin/release/wap-optim'

# Conflicts:
#	config/common.js
#	package.json
... ... @@ -8,7 +8,7 @@
</li>
{{/ navs}}
</ul>
<div id="info-list" class="info-list-container">
{{# infos}}
<div class="info-list{{^show}} hide{{/show}}">
... ... @@ -19,7 +19,11 @@
{{# ../swiper}}
<div class="swiper-slide">
<a href="{{url}}">
{{#if @first}}
<img src="{{img}}">
{{^}}
<img class="swiper-lazy" data-src="{{img}}">
{{/if}}
</a>
<div class="swiper-lazy-preloader"></div>
</div>
... ... @@ -45,4 +49,4 @@
<input id="gender" type="hidden" value={{gender}}>
{{/ guang}}
</div>
{{> footer-tab}}
\ No newline at end of file
{{> footer-tab}}
... ...
... ... @@ -36,7 +36,11 @@
</a>
{{/if}}
<a href="{{url}}">
<img class="lazy" data-original="{{img}}" alt="{{alt}}">
{{#if ../@first}}
<img src="{{img}}" alt="{{alt}}">
{{^}}
<img class="lazy" data-original="{{img}}" alt="{{alt}}">
{{/if}}
</a>
</div>
... ... @@ -47,4 +51,4 @@
<p class="info-text">{{text}}</p>
{{> tvls}}
</div>
</div>
\ No newline at end of file
</div>
... ...
... ... @@ -234,7 +234,8 @@ const category = (req, res, next) => {
firstPageGoodsList: firstScreenGoodsList.list,
showDownloadApp: true,
pageFooter: true,
category: true
category: true,
localCss: true
});
}).catch(next);
};
... ...
... ... @@ -276,9 +276,10 @@ const shop = {
},
shopHotList(req, res, next) {
let skns = req.query.skns;
let isApp = req.query.app_version || req.query.appVersion || false;
return listModel.searchProductBySkn(skns).then(hotList => {
hotList = productProcess.processProductList(hotList, {isApp: req.yoho.isApp});
hotList = productProcess.processProductList(hotList, {isApp: isApp});
_.forEach(hotList, (value, key) => {
hotList[key].tags = {};
hotList[key].is_soon_sold_out = false;
... ...
... ... @@ -101,6 +101,8 @@ const tool = {
let bannerList = [];
_.forEach(goodsGroup, function(value) {
value.img = _.replace(value.img, '/quality/80', '/quality/70');
bannerList.push({
img: value.img
});
... ... @@ -313,7 +315,7 @@ const newDetail = {
return api.get('', params, cacheConf)
.then(result => {
if (result.code === 200) {
if (result && result.code === 200) {
return result.data;
}
... ...
... ... @@ -18,6 +18,7 @@ const cachePage = {
// 商品详情页
'/product/\\/pro_([\\d]+)_([\\d]+)\\/(.*)/': 30 * MINUTE,
'/product/\\/show_([\\d]+)/': 30 * MINUTE,
// 商品详情ajax
// 逛
'/guang/': 1 * MINUTE,
... ...
... ... @@ -16,10 +16,10 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
... ... @@ -31,10 +31,10 @@ module.exports = {
// service: 'http://192.168.102.205:8080/gateway/',
// search: 'http://192.168.102.216:8080/yohosearch/'
// api: 'http://api.yoho.yohoops.org/',
// service: 'http://service.yoho.yohoops.org/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
//api: 'http://api.yoho.yohoops.org/',
//service: 'http://service.yoho.yohoops.org/',
//liveApi: 'http://api.live.yoho.cn/',
//singleApi: 'http://single.yoho.cn/'
// api: 'http://dev-api.yohops.com:9999/',
// service: 'http://dev-service.yohops.com:9999/',
... ... @@ -51,11 +51,11 @@ module.exports = {
activity: '//activity.yohobuy.com',
index: '//m.yohobuy.com'
},
useCache: false,
useCache: true,
memcache: {
master: ['192.168.102.168:12111'],
slave: ['192.168.102.168:12111'],
session: ['192.168.102.168:12111'],
master: ['127.0.0.1:11211'],
slave: ['127.0.0.1:11211'],
session: ['127.0.0.1:11211'],
timeout: 1000,
retries: 0
},
... ...
... ... @@ -30,14 +30,17 @@
</script>
{{/if}}
{{#if devEnv}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/common.css">
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
{{^}}
{{#if shopPage}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/shop.css">
{{^}}
{{^}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/index.css">
{{/if}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//{{devHost}}:5001/bundle/{{module}}.{{page}}.css">
{{/if}}
{{#if vue}}
... ... @@ -51,6 +54,7 @@
{{/if}}
{{#if localCss}}
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/common.css">
<link rel="stylesheet" media="all" href="//cdn.yoho.cn/m-yohobuy-node/{{version}}/{{module}}.{{page}}.css">
{{/if}}
... ...
{
"name": "m-yohobuy-node",
"version": "5.2.10",
"version": "5.2.11",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -93,7 +93,7 @@
"yoho-handlebars": "^4.0.5",
"yoho-iscroll": "^5.2.0",
"yoho-jquery": "^2.2.4",
"yoho-jquery-lazyload": "^1.9.7",
"yoho-jquery-lazyload": "^1.9.8",
"yoho-jquery-qrcode": "^0.14.0",
"yoho-mlellipsis": "0.0.3",
"yoho-qs": "^1.0.1",
... ...
... ... @@ -148,7 +148,7 @@ gulp.task('dist', ['ge'], () => {
// postcss compile in dev
gulp.task('postcss-dev', () => {
return gulp.src(['scss/shop.css', 'scss/index.css'])
return gulp.src(['scss/shop.css', 'scss/index.css', 'scss/common.css'])
.pipe(sourcemaps.init())
.pipe(postcss(postcssPlugin(env.dev), {
parser: require('postcss-scss')
... ... @@ -179,7 +179,7 @@ gulp.task('font', () => {
// postcss compile in pro
gulp.task('postcss', ['assets'], () => {
return gulp.src(['scss/shop.css', 'scss/index.css'])
return gulp.src(['scss/shop.css', 'scss/index.css', 'scss/common.css'])
.pipe(postcss(postcssPlugin(env.pro), {
parser: require('postcss-scss')
}))
... ...
... ... @@ -5,6 +5,17 @@ var goodsId = $('#goodsId').val();
var productSkn = $('#productSkn').val();
var brandId = $('#brand-id').val();
require('../common');
// 领券
require('./detail/brand-coupon');
// 页面底部异步加载的部分
require('./detail/desc');
// 喂你优选
require('./detail/recommend-for-you-product-desc');
setTimeout(() => {
var Swiper = require('yoho-swiper');
... ... @@ -20,18 +31,7 @@ setTimeout(() => {
prevButton: '.my-swiper-button-prev',
spaceBetween: 3
});
require('../common');
// 领券
require('./detail/brand-coupon');
// 页面底部异步加载的部分
require('./detail/desc');
// 喂你优选
require('./detail/recommend-for-you-product-desc');
}, 100);
}, 500);
// 动态加载数据
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2016/7/21
*/
require('../../scss/product/search/list.page.css');
require('./search/list');
require('../common/footer');
require('./shop/coupon');
... ...
... ... @@ -464,6 +464,10 @@ function search(opt) {
argument = setting;
if (!firstScreen) {
$fsgc.addClass('hide');
}
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/product/search/search',
... ... @@ -751,7 +755,6 @@ if ($brandHeader.data('isbaseshop') === true) {
}
$.extend(defaultOpt, pars);
$.ajax({
type: 'GET',
url: location.protocol + '//m.yohobuy.com/product/search/filter',
... ... @@ -1071,7 +1074,9 @@ if ($brandHeader.length > 0) {
}
// 初始请求最新第一页数据
search();
setTimeout(function() {
search();
}, 500);
$listNav.on('touchstart', 'li', function() {
$listNav.find('li').removeClass('bytouch');
... ...
... ... @@ -90,7 +90,7 @@ var defaultOpt = require('../common/query-param');
if ($('.popularity-title').data('skns')) {
$.ajax({
type: 'GET',
url: '/product/new/shop/hotlist',
url: '/product/new/shop/hotlist?app_version=' + appVersion,
xhrFields: {
withCredentials: true
},
... ...
/**
* 精简的共用css
*/
@import "layout/reset";
@import "layout/common";
@import "layout/header";
@import "layout/footer";
@import "common/data-bind";
@import "common/suspend-cart";
... ...
... ... @@ -3,3 +3,8 @@
@import "product-description";
@import "recommend-for-you";
@import "brand-coupon";
@import "../../layout/swiper";
@import "../../channel/banner-top";
@import "../../common/good";
@import "../../cart/chose-panel";
... ...
@import "../../channel/banner-top";
@import "../../common/good";
@import "../../common/filter";
@import "search";
@import "list";
@import "search-index";
... ...