Authored by ccbikai(👎🏻🍜)

Merge branch 'master' into release/5.3

1 'use strict'; 1 'use strict';
2 const CloudModel = require('../models/ali-cloud'); 2 const CloudModel = require('../models/ali-cloud');
3 3
4 -const aliCloudbo = (req, res) => { 4 +const aliCloudbo = (req, res, next) => {
5 let contentCode = '5ad7e20546e0a2662d351864929a40ab'; 5 let contentCode = '5ad7e20546e0a2662d351864929a40ab';
6 6
7 CloudModel.cloud(contentCode).then((result) => { 7 CloudModel.cloud(contentCode).then((result) => {
@@ -10,10 +10,10 @@ const aliCloudbo = (req, res) => { @@ -10,10 +10,10 @@ const aliCloudbo = (req, res) => {
10 width750: true, 10 width750: true,
11 cloudBo: result 11 cloudBo: result
12 }); 12 });
13 - }); 13 + }).catch(next);
14 }; 14 };
15 15
16 -const aliCloudri = (req, res) => { 16 +const aliCloudri = (req, res, next) => {
17 let contentCode = 'ec057186abced9d3b390c413c2548bf6'; 17 let contentCode = 'ec057186abced9d3b390c413c2548bf6';
18 18
19 CloudModel.cloud(contentCode).then((result) => { 19 CloudModel.cloud(contentCode).then((result) => {
@@ -22,7 +22,7 @@ const aliCloudri = (req, res) => { @@ -22,7 +22,7 @@ const aliCloudri = (req, res) => {
22 width750: true, 22 width750: true,
23 cloudRi: result 23 cloudRi: result
24 }); 24 });
25 - }); 25 + }).catch(next);
26 }; 26 };
27 27
28 module.exports = { 28 module.exports = {
@@ -12,7 +12,7 @@ const _cloudData = (list) => { @@ -12,7 +12,7 @@ const _cloudData = (list) => {
12 let listData = {}; 12 let listData = {};
13 13
14 if (list.background && list.background.src) { 14 if (list.background && list.background.src) {
15 - listData.backImg = list.background.src; 15 + listData.backImg = list.background.src + '/format/jpg';
16 } 16 }
17 17
18 if (list.btn && list.btn[0]) { 18 if (list.btn && list.btn[0]) {
@@ -36,7 +36,7 @@ const cloud = (contentCode) => { @@ -36,7 +36,7 @@ const cloud = (contentCode) => {
36 cache: true, 36 cache: true,
37 code: 200 37 code: 200
38 }).then((result) => { 38 }).then((result) => {
39 - if (result && result.data) { 39 + if (result && result.data && result.data[0] && result.data[0].data) {
40 40
41 return _cloudData(result.data[0].data); 41 return _cloudData(result.data[0].data);
42 } 42 }
@@ -120,8 +120,8 @@ router.post('/vip-day1028/signin.json', vipDay1028.beforeIn, vipDay1028.signin); @@ -120,8 +120,8 @@ router.post('/vip-day1028/signin.json', vipDay1028.beforeIn, vipDay1028.signin);
120 router.post('/vip-day1028/isStudent', vipDay1028.beforeIn, vipDay1028.checkIsStudent); 120 router.post('/vip-day1028/isStudent', vipDay1028.beforeIn, vipDay1028.checkIsStudent);
121 121
122 // 阿里云广告 122 // 阿里云广告
123 -router.get('/ali-cloudbo', aliCloud.aliCloudbo);  
124 -router.get('/ali-cloudri', aliCloud.aliCloudri); 123 +router.get('/ali-cloud-bottom', aliCloud.aliCloudbo);
  124 +router.get('/ali-cloud-right', aliCloud.aliCloudri);
125 125
126 // 获取活动页传来的参数 126 // 获取活动页传来的参数
127 router.get('/wechat/1111', wechat.feature); 127 router.get('/wechat/1111', wechat.feature);
@@ -26,7 +26,7 @@ @@ -26,7 +26,7 @@
26 <div class="liverec"> 26 <div class="liverec">
27 {{#best}} 27 {{#best}}
28 <div class="liverec_child"> 28 <div class="liverec_child">
29 - <a href='http://m.yohobuy.com/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"{{living}}","room":"{{room_id}}","bgpic":"{{pic}}"}}'> 29 + <a href='/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"{{living}}","room":"{{room_id}}","bgpic":"{{pic}}"}}'>
30 <img class="liverec_pic" src="{{image pic 320 320}}" alt="直播预览"> 30 <img class="liverec_pic" src="{{image pic 320 320}}" alt="直播预览">
31 {{#if now_living}} 31 {{#if now_living}}
32 <p class="living">直播</p> 32 <p class="living">直播</p>
@@ -64,7 +64,7 @@ @@ -64,7 +64,7 @@
64 </div> 64 </div>
65 </header> 65 </header>
66 <section> 66 <section>
67 - <a href='http://m.yohobuy.com/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"1","room":"{{room_id}}","bgpic":"{{pic}}"}}'> 67 + <a href='/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"1","room":"{{room_id}}","bgpic":"{{pic}}"}}'>
68 <img class="main-bg" src="{{image pic 640 640}}" alt="正在直播"> 68 <img class="main-bg" src="{{image pic 640 640}}" alt="正在直播">
69 <p class="main-living">直播</p> 69 <p class="main-living">直播</p>
70 <p class="main-intro">{{title}}</p> 70 <p class="main-intro">{{title}}</p>
@@ -84,7 +84,7 @@ @@ -84,7 +84,7 @@
84 <ul class="list"> 84 <ul class="list">
85 {{#pre}} 85 {{#pre}}
86 <li class="pre-list"> 86 <li class="pre-list">
87 - <a href='http://m.yohobuy.com/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"0","room":"{{room_id}}","bgpic":"{{pic}}"}}'> 87 + <a href='/activity/live/{{room_id}}?openby:yohobuy={"action":"go.videolive", "params":{"type":"0","room":"{{room_id}}","bgpic":"{{pic}}"}}'>
88 <img class="pre-pic" src="{{image pic 150 150}}" alt="直播预览图"> 88 <img class="pre-pic" src="{{image pic 150 150}}" alt="直播预览图">
89 <p class="pre-icon">预告</p> 89 <p class="pre-icon">预告</p>
90 <p class="pre-time">{{starting_time}}</p> 90 <p class="pre-time">{{starting_time}}</p>
@@ -113,7 +113,7 @@ @@ -113,7 +113,7 @@
113 </div> 113 </div>
114 </header> 114 </header>
115 <section> 115 <section>
116 - <a href='http://m.yohobuy.com/activity/live/replay/{{video_id}}?openby:yohobuy={"action":"go.videoreplay", "params":{"videoid":"{{video_id}}","bgpic":"{{pic}}"}}'> 116 + <a href='/activity/live/replay/{{video_id}}?openby:yohobuy={"action":"go.videoreplay", "params":{"videoid":"{{video_id}}","bgpic":"{{pic}}"}}'>
117 <div class="record-icon"></div> 117 <div class="record-icon"></div>
118 <img class="main-bg" src="{{image pic 640 640}}" alt="精彩回放"> 118 <img class="main-bg" src="{{image pic 640 640}}" alt="精彩回放">
119 <p class="main-living">回放</p> 119 <p class="main-living">回放</p>
@@ -20,7 +20,8 @@ let index = (req, res, next) => { @@ -20,7 +20,8 @@ let index = (req, res, next) => {
20 let responseData = { 20 let responseData = {
21 module: 'channel', 21 module: 'channel',
22 page: 'brand', 22 page: 'brand',
23 - title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停', 23 +
  24 + // title: '品牌一览 | Yoho!Buy有货 | 潮流购物逛不停',
24 showFooterTab: footerModel.getUrlData('category') 25 showFooterTab: footerModel.getUrlData('category')
25 }; 26 };
26 27
@@ -121,7 +121,8 @@ let switchChannel = (req, res, next) => { @@ -121,7 +121,8 @@ let switchChannel = (req, res, next) => {
121 let boys = (req, res, next) => { 121 let boys = (req, res, next) => {
122 _channelPage(req, res, { 122 _channelPage(req, res, {
123 gender: 'boys', 123 gender: 'boys',
124 - title: '男生 | Yoho!Buy有货 | 潮流购物逛不停', 124 +
  125 + // title: '男生 | Yoho!Buy有货 | 潮流购物逛不停',
125 boysHomePage: true 126 boysHomePage: true
126 }).catch(next); // TODO 我们在路由处理的最上层的方法处理catch 127 }).catch(next); // TODO 我们在路由处理的最上层的方法处理catch
127 }; 128 };
@@ -132,7 +133,8 @@ let boys = (req, res, next) => { @@ -132,7 +133,8 @@ let boys = (req, res, next) => {
132 let girls = (req, res, next) => { 133 let girls = (req, res, next) => {
133 _channelPage(req, res, { 134 _channelPage(req, res, {
134 gender: 'girls', 135 gender: 'girls',
135 - title: '女生 | Yoho!Buy有货 | 潮流购物逛不停', 136 +
  137 + // title: '女生 | Yoho!Buy有货 | 潮流购物逛不停',
136 girlsHomePage: true 138 girlsHomePage: true
137 }).catch(next); 139 }).catch(next);
138 }; 140 };
@@ -144,7 +146,8 @@ let girls = (req, res, next) => { @@ -144,7 +146,8 @@ let girls = (req, res, next) => {
144 let kids = (req, res, next) => { 146 let kids = (req, res, next) => {
145 _channelPage(req, res, { 147 _channelPage(req, res, {
146 gender: 'kids', 148 gender: 'kids',
147 - title: '潮童 | Yoho!Buy有货 | 潮流购物逛不停', 149 +
  150 + // title: '潮童 | Yoho!Buy有货 | 潮流购物逛不停',
148 kidsHomePage: true 151 kidsHomePage: true
149 }).catch(next); 152 }).catch(next);
150 }; 153 };
@@ -155,7 +158,8 @@ let kids = (req, res, next) => { @@ -155,7 +158,8 @@ let kids = (req, res, next) => {
155 let lifestyle = (req, res, next) => { 158 let lifestyle = (req, res, next) => {
156 _channelPage(req, res, { 159 _channelPage(req, res, {
157 gender: 'lifestyle', 160 gender: 'lifestyle',
158 - title: '创意生活 | Yoho!Buy有货 | 潮流购物逛不停', 161 +
  162 + // title: '创意生活 | Yoho!Buy有货 | 潮流购物逛不停',
159 lifestyleHomePage: true 163 lifestyleHomePage: true
160 }).catch(next); 164 }).catch(next);
161 }; 165 };
@@ -2,6 +2,7 @@ @@ -2,6 +2,7 @@
2 const aes = require('./aes-pwd'); 2 const aes = require('./aes-pwd');
3 const sign = global.yoho.sign; 3 const sign = global.yoho.sign;
4 const api = global.yoho.API; 4 const api = global.yoho.API;
  5 +const uuid = require('uuid');
5 6
6 class Auth { 7 class Auth {
7 8
@@ -67,23 +68,31 @@ class Auth { @@ -67,23 +68,31 @@ class Auth {
67 }); 68 });
68 } 69 }
69 return Auth.profile(uid).then((userInfo) => { 70 return Auth.profile(uid).then((userInfo) => {
70 - let token = sign.makeToken(uid); 71 + let salt = uuid.v4().substr(0, 8);
  72 + let saltedUid = uid + salt;
  73 +
  74 + let saltedToken = sign.makeToken(saltedUid);
  75 + let publicToken = saltedToken + salt;
  76 +
71 let data = userInfo.data; 77 let data = userInfo.data;
72 let encryptionUid = aes.encryptionUid(uid); 78 let encryptionUid = aes.encryptionUid(uid);
73 79
74 if (data) { 80 if (data) {
75 data.profile_name = (data.profile_name || '').replace(/::/g, ''); 81 data.profile_name = (data.profile_name || '').replace(/::/g, '');
76 82
77 - let uidCookie = `${data.profile_name}::${encryptionUid}::${data.vip_info && data.vip_info.title}::${token}`; 83 + let uidCookie =
  84 + `${data.profile_name}::${encryptionUid}::${data.vip_info && data.vip_info.title}::${saltedToken}`;
78 85
79 res.cookie('_UID', uidCookie, { 86 res.cookie('_UID', uidCookie, {
80 domain: 'yohobuy.com', 87 domain: 'yohobuy.com',
81 expires: new Date(Date.now() + 2592000000) // 有效期一年 88 expires: new Date(Date.now() + 2592000000) // 有效期一年
82 }); 89 });
83 } 90 }
84 - req.session.TOKEN = token; 91 +
  92 + req.session.TOKEN = publicToken;
85 req.session.LOGIN_UID = uid; 93 req.session.LOGIN_UID = uid;
86 - res.cookie('_TOKEN', token, { 94 + res.cookie('_TOKEN', publicToken, {
  95 + httpOnly: true,
87 domain: 'yohobuy.com', 96 domain: 'yohobuy.com',
88 expires: new Date(Date.now() + 2592000000) // 有效期一年 97 expires: new Date(Date.now() + 2592000000) // 有效期一年
89 }); 98 });
@@ -341,7 +341,10 @@ exports.index = (req, res, next) => { @@ -341,7 +341,10 @@ exports.index = (req, res, next) => {
341 page: 'detail', 341 page: 'detail',
342 title: result.goodsName, 342 title: result.goodsName,
343 pageFooter: true, 343 pageFooter: true,
344 - localCss: true 344 + localCss: true,
  345 + cononical: {
  346 + currentHref: result.cononical
  347 + }
345 }); 348 });
346 }).catch(next); 349 }).catch(next);
347 }; 350 };
@@ -39,7 +39,8 @@ const newGoods = (req, res, next) => { @@ -39,7 +39,8 @@ const newGoods = (req, res, next) => {
39 res.render('new/new', { 39 res.render('new/new', {
40 module: 'product', 40 module: 'product',
41 page: 'new', 41 page: 'new',
42 - title: '新品到着', 42 +
  43 + // title: '新品到着',
43 pageHeader: headerModel.setNav({ 44 pageHeader: headerModel.setNav({
44 navTitle: '新品到着' 45 navTitle: '新品到着'
45 }), 46 }),
@@ -33,7 +33,8 @@ const _processPublicData = (req, title, page, backUrl) => { @@ -33,7 +33,8 @@ const _processPublicData = (req, title, page, backUrl) => {
33 renderData: { 33 renderData: {
34 module: 'product', 34 module: 'product',
35 page: page, 35 page: page,
36 - title: title, 36 +
  37 + // title: title,
37 saleNav: true, 38 saleNav: true,
38 pageHeader: headerModel.setNav({ 39 pageHeader: headerModel.setNav({
39 navTitle: title, 40 navTitle: title,
@@ -1119,6 +1119,10 @@ let getProductData = (data) => { @@ -1119,6 +1119,10 @@ let getProductData = (data) => {
1119 consults: _.take(info[2], 2) 1119 consults: _.take(info[2], 2)
1120 }); 1120 });
1121 } 1121 }
  1122 +
  1123 + /* tar add 161129 SEO 优化使用 */
  1124 + finalResult.cononical = result.product_url;
  1125 +
1122 return finalResult; 1126 return finalResult;
1123 }); 1127 });
1124 1128
@@ -1597,6 +1601,7 @@ let getProductAsyncData = (data) => { @@ -1597,6 +1601,7 @@ let getProductAsyncData = (data) => {
1597 return Promise.all([_getPromotionInfo(result.product_skn), _getFavorite(result.product_id, data.uid)]).then((res) => { 1601 return Promise.all([_getPromotionInfo(result.product_skn), _getFavorite(result.product_id, data.uid)]).then((res) => {
1598 result.promotionBoList = res[0]; 1602 result.promotionBoList = res[0];
1599 var isFavorite = res[1]; 1603 var isFavorite = res[1];
  1604 +
1600 return _detailDataPkgAsync(result, data.uid, data.vipLevel, data.ua).then(pkg => { 1605 return _detailDataPkgAsync(result, data.uid, data.vipLevel, data.ua).then(pkg => {
1601 finalResult = pkg; 1606 finalResult = pkg;
1602 finalResult.isCollect = isFavorite; 1607 finalResult.isCollect = isFavorite;
@@ -1881,6 +1886,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { @@ -1881,6 +1886,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
1881 1886
1882 // 限购商品有关的展示状态 1887 // 限购商品有关的展示状态
1883 let showStatus = 1; 1888 let showStatus = 1;
  1889 +
1884 origin.showStatus && (showStatus = parseInt(result.data.showStatus, 10)); 1890 origin.showStatus && (showStatus = parseInt(result.data.showStatus, 10));
1885 1891
1886 // 处理限购商品有关的按钮状态 1892 // 处理限购商品有关的按钮状态
@@ -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 +
21 // 商品详情ajax 22 // 商品详情ajax
22 23
23 // 逛 24 // 逛
@@ -51,7 +51,7 @@ module.exports = { @@ -51,7 +51,7 @@ 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: true, 54 + useCache: false,
55 memcache: { 55 memcache: {
56 master: ['127.0.0.1:11211'], 56 master: ['127.0.0.1:11211'],
57 slave: ['127.0.0.1:11211'], 57 slave: ['127.0.0.1:11211'],
@@ -84,7 +84,7 @@ module.exports = { @@ -84,7 +84,7 @@ module.exports = {
84 port: '4444' // influxdb port 84 port: '4444' // influxdb port
85 }, 85 },
86 console: { 86 console: {
87 - level: 'debug', 87 + level: 'info',
88 colorize: 'all', 88 colorize: 'all',
89 prettyPrint: true 89 prettyPrint: true
90 } 90 }
@@ -5,13 +5,12 @@ const seoMap = require('./seoConfig'); @@ -5,13 +5,12 @@ const seoMap = require('./seoConfig');
5 5
6 /** 6 /**
7 * 设置seo相关的数据,包括title, keywords, description 7 * 设置seo相关的数据,包括title, keywords, description
8 - * @param {undefined}  
9 * @return {Function} 中间件函数,用于给res.locals对象添加属性 8 * @return {Function} 中间件函数,用于给res.locals对象添加属性
10 */ 9 */
11 module.exports = () => { 10 module.exports = () => {
12 return (req, res, next) => { 11 return (req, res, next) => {
13 if (!req.xhr) { 12 if (!req.xhr) {
14 - Object.assign(res.locals, seoMap[req.path] || seoMap['/']); 13 + Object.assign(res.locals, seoMap[req.originalUrl] || seoMap['/']);
15 } 14 }
16 next(); 15 next();
17 }; 16 };
1 const seoMap = { 1 const seoMap = {
2 /* eslint-disable */ 2 /* eslint-disable */
3 '/': { 3 '/': {
4 - title: 'YOHO!BUY 有货 | 年轻人潮流购物中心,中国潮流购物风向标,官方授权正品保证',  
5 - keywords: 'Yoho! 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款',  
6 - description: 'YOHO!BUY有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。作为YOHO!旗下的购物平台,汇集了全球潮流时尚商品和中国最流行的商品,也是国内最大的原创文化商品平台,也是香港,台湾地区流行商品的集中地。同时包含日本、韩国等众多国外潮流品牌,带给您全新潮流购物体验。' 4 + title: 'Yoho!BuyBuy有货|年轻人潮流购物中心,中国潮流购物风向标',
  5 + keywords: 'Yoho!BuyBuy有货 有货官网,潮流志,潮流男装,潮牌,美国潮牌,日本潮牌,香港潮牌,潮牌店,新品首发,欧美潮流,全球购,代购,时尚,流行,特卖,B2C,正品,购物网站,网上购物,货到付款',
  6 + description: 'Yoho!BuyBuy有货,年轻人潮流购物中心,中国最大的潮流商品购物网站。100%品牌正品保证,支持货到付款。'
7 }, 7 },
8 - '/woman': {  
9 - title: '女生|时尚潮流女装,日韩女装,潮牌女装全球购|YOHO!BUY有货 100%正品保证',  
10 - keywords: '女生服饰,时尚潮流女装,日韩女装,女装正品购物网站,女装全球购',  
11 - description: 'YOHO!BUY有货官网女生频道汇集了全球女装潮流时尚,提供时尚潮流女装,日版女装,韩版女装,潮牌女装正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。' 8 + '/boys': {
  9 + title: '男式服饰|男装,休闲男装,时尚男装品牌|Yoho!Buy有货',
  10 + keywords: '男装,休闲男装,时尚男装品牌,男式服饰,Yoho!Buy有货',
  11 + description: 'Yoho!Buy有货男装汇集国内国际各大男装品牌,提供品牌男装、休闲男装、商务男装、外套,100%正品保证!'
  12 + },
  13 + '/girls': {
  14 + title: '潮流女装|时尚女装,日韩女装,潮牌女装全球购|Yoho!BuyBUY有货',
  15 + keywords: '潮流女装,女生服饰,时尚潮流女装,日韩女装,女装正品购物网站,女装全球购',
  16 + description: 'Yoho!BuyBUY有货官网女生频道汇集了全球女装潮流时尚,提供时尚潮流女装,日版女装,韩版女装,潮牌女装正品全球购,100%正品保证!'
12 }, 17 },
13 '/kids': { 18 '/kids': {
14 - title: '潮童|男童装,女童装,韩版童装,儿童服装服饰|YOHO!BUY有货 100%正品保证', 19 + title: '潮童|男童装,女童装,韩版儿童服装服饰|Yoho!BuyBUY有货',
15 keywords: '潮童,男童装,女童装,韩版童装,儿童服装服饰', 20 keywords: '潮童,男童装,女童装,韩版童装,儿童服装服饰',
16 - description: 'YOHO!BUY有货官网潮童频道汇集了全球潮童潮流时尚,提供新款男童装,女童装,韩版童装,儿童服装服饰正品全球购。YOHO!BUY有货购物100%正品保证,支持货到付款。' 21 + description: 'Yoho!BuyBUY有货官网潮童频道汇集了全球潮童潮流时尚,提供新款男童装,女童装,韩版童装,儿童服装服饰正品全球购。'
17 }, 22 },
18 '/lifestyle': { 23 '/lifestyle': {
19 - title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|YOHO!BUY 有货 100%正品保证',  
20 - keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,YOHO!BUY有货',  
21 - description: 'YOHO!BUY有货官网创意生活频道汇集了创意生活馆,潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。YOHO!BUY有货购物100%正品保证,支持货到付款。'  
22 - } 24 + title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|Yoho!BuyBUY有货',
  25 + keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,Yoho!Buy有货',
  26 + description: 'Yoho!BuyBUY有货官网创意生活频道提供了潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。'
  27 + },
  28 + '/product/sale?channel=boys': {
  29 + title: '折扣男装专区|男装SALE折扣,男款鞋包配饰特卖|Yoho!Buy有货 100%正品保证',
  30 + keywords: 'SALE,男装SALE,男装折扣,男款鞋包配饰特卖',
  31 + description: 'Yoho!Buy有货SALE频道提供男装折扣,精致品牌男装sale,限时特惠。Yoho!Buy有货男装折扣,100%正品保证!'
  32 + },
  33 + '/product/sale?gender=2,3': {
  34 + title: '折扣女装专区|女装SALE折扣,女款鞋包配饰特卖|Yoho!Buy有货',
  35 + keywords: 'SALE,女装SALE,女装折扣,女款鞋包配饰特卖',
  36 + description: 'Yoho!Buy有货SALE频道提供女装折扣,精致品牌女装sale,限时特惠。Yoho!Buy有货女装折扣,100%正品保证!'
  37 + },
  38 + '/product/new?gender=1,3': {
  39 + title: '男生潮装新品|男装新品发布,饰品推荐|Yoho!Buy有货 ',
  40 + keywords: '男生潮装新品,新品发布,新品男装,新款男装推荐,新款男鞋推荐,新款男包推荐,新款男饰品推荐,Yoho!Buy有货',
  41 + description: 'Yoho!Buy有货男装新品到着为您提供新品男装,男装新品直达就选Yoho!Buy有货,100%正品保证!'
  42 + },
  43 + '/product/new?gender=2,3': {
  44 + title: '女生潮装新品|女装新品发布,饰品推荐|Yoho!Buy有货 ',
  45 + keywords: '女生潮流新品,女款新品发布,新品女装,新款女装推荐,新款女鞋推荐,新款女包推荐,新款饰品推荐,Yoho!Buy有货',
  46 + description: 'Yoho!Buy有货女装新品到着为您提供新品女装,女装样品,女装新款推荐;汇集国内外最新款女装,鞋,女包,饰品,100%正品保证!'
  47 + },
  48 + '/product/new?msort=365&channel=4': {
  49 + title: '新品到着|潮童新品发布,新款童装童鞋,包包配饰推荐|Yoho!Buy有货',
  50 + keywords: '潮童新品发布,新品童装,新款童装推荐,新款童鞋,新款儿童鞋包,儿童配饰新品,Yoho!Buy有货',
  51 + description: 'Yoho!Buy有货潮童新品到着为您提供新品童装,童装样品,童装新款推荐;汇集国内外最新款童装,童鞋,儿童鞋包配饰。'
  52 + },
  53 + '/product/new?msort=10&channel=4': {
  54 + title: '新品到着|数码3c,居家,玩具娱乐,文具,美妆|Yoho!Buy有货',
  55 + keywords: '数码3c,居家,玩具娱乐,文具,美妆,Yoho!Buy有货',
  56 + description: 'Yoho!Buy有货创意生活新品到着为您提供潮流创意生活,汇集国内外最新款数码3c,居家,玩具娱乐,文具,美妆。'
  57 + },
  58 + '/brands?channel=1': {
  59 + title: '潮流男装品牌|男装品牌排行榜,男装品牌大全|Yoho!Buy有货',
  60 + keywords: '潮流男装品牌,男装品牌,男装品牌排行榜,男装品牌大全,Yoho!Buy有货',
  61 + description: 'Yoho!Buy有货男装品牌一览汇集国内国际各大男装品牌大全,为广大爱好时尚的男士青年提供品牌男装、休闲男装、商务男装.Yoho!Buy有货,100%正品保证'
  62 + },
  63 + '/brands?channel=2': {
  64 + title: '潮流女装品牌|女装品牌排行榜,女装品牌大全|Yoho!Buy有货',
  65 + keywords: '潮流女装品牌,女装品牌,女装品牌排行榜,女装品牌大全,Yoho!Buy有货',
  66 + description: 'Yoho!Buy有货女装品牌一览汇集各大女装品牌,提供品牌女装、休闲女装、商务女装.Yoho!Buy有货品牌女装100%正品保证。'
  67 + },
  68 + '/brands?channel=3': {
  69 + title: '品牌一览|童装童鞋品牌,儿童鞋包配饰排行榜大全|Yoho!Buy有货',
  70 + keywords: '童装品牌,童装童鞋排行榜,儿童鞋包配饰排行榜,潮童品牌大全,品牌一览,Yoho!Buy有货',
  71 + description: 'Yoho!Buy有货童装品牌一览汇集国内国际各大童装品牌大全,提供品牌童装、童鞋,儿童鞋包配饰,100%正品保证'
  72 + },
  73 + '/brands?channel=4': {
  74 + title: '品牌一览|数码3c,居家,玩具娱乐,文具,美妆品牌|Yoho!Buy有货',
  75 + keywords: '数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌',
  76 + description: 'Yoho!Buy有货女装品牌一览汇集国内国际各大数码3c品牌,居家品牌,玩具娱乐品牌,文具品牌,美妆品牌.'
  77 + },
23 /* eslint-enable */ 78 /* eslint-enable */
24 }; 79 };
25 80
@@ -10,6 +10,9 @@ @@ -10,6 +10,9 @@
10 <meta name="apple-mobile-web-app-status-bar-style" content="black" /> 10 <meta name="apple-mobile-web-app-status-bar-style" content="black" />
11 <meta content="telephone=no" name="format-detection" /> 11 <meta content="telephone=no" name="format-detection" />
12 <meta content="email=no" name="format-detection" /> 12 <meta content="email=no" name="format-detection" />
  13 + {{# cononical}}
  14 + <link rel=”cononical” href={{currentHref}}/>
  15 + {{/ cononical}}
13 {{#dnsPrefetch.hosts}} 16 {{#dnsPrefetch.hosts}}
14 <link rel="dns-prefetch" href="{{this}}"> 17 <link rel="dns-prefetch" href="{{this}}">
15 {{/dnsPrefetch.hosts}} 18 {{/dnsPrefetch.hosts}}
@@ -15,7 +15,7 @@ @@ -15,7 +15,7 @@
15 15
16 <li class="more"> 16 <li class="more">
17 <a class="{{#unless image.src}}default{{/unless}}" href="{{image.url}}"> 17 <a class="{{#unless image.src}}default{{/unless}}" href="{{image.url}}">
18 - <img class="lazy" data-original="{{image2 image.src w=320 h=172 q=60}}"> 18 + <img src="{{image2 image.src w=320 h=172 q=60}}">
19 </a> 19 </a>
20 </li> 20 </li>
21 </ul> 21 </ul>
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 {{# banner}} 5 {{# banner}}
6 <a class="category-banner" href="{{url}}"> 6 <a class="category-banner" href="{{url}}">
7 - <img class="lazy" data-original="{{image2 src q=60}}"> 7 + <img src="{{image2 src q=60}}">
8 </a> 8 </a>
9 {{/ banner}} 9 {{/ banner}}
10 <ul class="category-list clearfix"> 10 <ul class="category-list clearfix">
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <li> 12 <li>
13 <a href="{{url}}"> 13 <a href="{{url}}">
14 <div class="img-box"> 14 <div class="img-box">
15 - <img class="lazy" data-original="{{image2 src w=140 h=140 q=60}}" alt=""> 15 + <img src="{{image2 src w=140 h=140 q=60}}" alt="">
16 </div> 16 </div>
17 </a> 17 </a>
18 </li> 18 </li>
1 { 1 {
2 "name": "m-yohobuy-node", 2 "name": "m-yohobuy-node",
3 - "version": "5.2.14", 3 + "version": "5.2.16",
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": {
@@ -31,6 +31,7 @@ @@ -31,6 +31,7 @@
31 "feed": "^0.3.0", 31 "feed": "^0.3.0",
32 "lodash": "^4.16.1", 32 "lodash": "^4.16.1",
33 "md5": "^2.1.0", 33 "md5": "^2.1.0",
  34 + "memory-cache": "^0.1.6",
34 "moment": "^2.15.1", 35 "moment": "^2.15.1",
35 "oneapm": "^1.2.20", 36 "oneapm": "^1.2.20",
36 "passport": "^0.3.2", 37 "passport": "^0.3.2",
@@ -42,7 +43,7 @@ @@ -42,7 +43,7 @@
42 "request-promise": "^3.0.0", 43 "request-promise": "^3.0.0",
43 "serve-favicon": "^2.3.0", 44 "serve-favicon": "^2.3.0",
44 "uuid": "^2.0.3", 45 "uuid": "^2.0.3",
45 - "yoho-node-lib": "0.1.30", 46 + "yoho-node-lib": "0.2.2",
46 "yoho-zookeeper": "^1.0.4" 47 "yoho-zookeeper": "^1.0.4"
47 }, 48 },
48 "devDependencies": { 49 "devDependencies": {
@@ -95,7 +96,7 @@ @@ -95,7 +96,7 @@
95 "yoho-handlebars": "^4.0.5", 96 "yoho-handlebars": "^4.0.5",
96 "yoho-iscroll": "^5.2.0", 97 "yoho-iscroll": "^5.2.0",
97 "yoho-jquery": "^2.2.4", 98 "yoho-jquery": "^2.2.4",
98 - "yoho-jquery-lazyload": "^1.9.9", 99 + "yoho-jquery-lazyload": "^1.9.10",
99 "yoho-jquery-qrcode": "^0.14.0", 100 "yoho-jquery-qrcode": "^0.14.0",
100 "yoho-mlellipsis": "0.0.3", 101 "yoho-mlellipsis": "0.0.3",
101 "yoho-qs": "^1.0.1", 102 "yoho-qs": "^1.0.1",
@@ -4,7 +4,7 @@ @@ -4,7 +4,7 @@
4 4
5 {{# banner}} 5 {{# banner}}
6 <a class="category-banner" href="{{url}}"> 6 <a class="category-banner" href="{{url}}">
7 - <img class="lazy" data-original="{{image2 src q=60}}"> 7 + <img src="{{image2 src q=60}}">
8 </a> 8 </a>
9 {{/ banner}} 9 {{/ banner}}
10 <ul class="category-list clearfix"> 10 <ul class="category-list clearfix">
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 <li> 12 <li>
13 <a href="{{url}}"> 13 <a href="{{url}}">
14 <div class="img-box"> 14 <div class="img-box">
15 - <img class="lazy" data-original="{{image2 src w=140 h=140 q=60}}" alt=""> 15 + <img src="{{image2 src w=140 h=140 q=60}}" alt="">
16 </div> 16 </div>
17 </a> 17 </a>
18 </li> 18 </li>
@@ -3,8 +3,8 @@ @@ -3,8 +3,8 @@
3 * @author: liangzhifeng<zhifeng.liang@yoho.cn> 3 * @author: liangzhifeng<zhifeng.liang@yoho.cn>
4 * @date: 2015/10/12 4 * @date: 2015/10/12
5 */ 5 */
6 -//加载css  
7 -require("channel/home.page.css") 6 +// 加载css
  7 +require('channel/home.page.css');
8 8
9 9
10 var $ = require('yoho-jquery'), 10 var $ = require('yoho-jquery'),
1 -module.exports = function (url, opts) { 1 +module.exports = function(url, opts) {
2 if (url) { 2 if (url) {
3 let params = opts.hash; 3 let params = opts.hash;
4 let urls = url.split('?'); 4 let urls = url.split('?');
@@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
7 var $ = require('yoho-jquery'); 7 var $ = require('yoho-jquery');
8 8
9 var $cart = $('#suspend-cart'); 9 var $cart = $('#suspend-cart');
  10 +
  11 +require('../common');
  12 +
10 if ($('#remove-cart-count').length) { 13 if ($('#remove-cart-count').length) {
11 $.ajax({ 14 $.ajax({
12 type: 'GET', 15 type: 'GET',
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * @author: xuqi<qi.xu@yoho.cn> 3 * @author: xuqi<qi.xu@yoho.cn>
4 * @date: 2015/10/10 4 * @date: 2015/10/10
5 */ 5 */
6 -require("guang/index-editor.page.css") 6 +require('guang/index-editor.page.css');
7 7
8 8
9 var $ = require('yoho-jquery'); 9 var $ = require('yoho-jquery');
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * @author: xuqi<qi.xu@yoho.cn> 3 * @author: xuqi<qi.xu@yoho.cn>
4 * @date: 2015/10/10 4 * @date: 2015/10/10
5 */ 5 */
6 -require("guang/index.page.css") 6 +require('guang/index.page.css');
7 7
8 8
9 9
@@ -3,7 +3,7 @@ @@ -3,7 +3,7 @@
3 * @author: xuqi<qi.xu@yoho.cn> 3 * @author: xuqi<qi.xu@yoho.cn>
4 * @date: 2015/10/13 4 * @date: 2015/10/13
5 */ 5 */
6 -require("guang/info-index.page.css") 6 +require('guang/info-index.page.css');
7 7
8 var $ = require('yoho-jquery'), 8 var $ = require('yoho-jquery'),
9 ellipsis = require('yoho-mlellipsis'), 9 ellipsis = require('yoho-mlellipsis'),
1 var $ = require('yoho-jquery'), 1 var $ = require('yoho-jquery'),
2 -  
3 - // Swiper = require('yoho.iswiper'), 2 + Swiper = require('yoho-swiper'),
4 lazyLoad = require('yoho-jquery-lazyload'), 3 lazyLoad = require('yoho-jquery-lazyload'),
5 loading = require('../plugin/loading'); 4 loading = require('../plugin/loading');
6 5
@@ -666,14 +666,14 @@ function search(opt, callback) { @@ -666,14 +666,14 @@ function search(opt, callback) {
666 666
667 bindGoodThumbClick(); 667 bindGoodThumbClick();
668 setTimeout(function() { 668 setTimeout(function() {
669 - callback && callback(); 669 + callback && typeof callback === 'function' && callback();
670 }, 0); 670 }, 0);
671 }, 671 },
672 error: function() { 672 error: function() {
673 tip.show('网络断开连接了~'); 673 tip.show('网络断开连接了~');
674 searching = false; 674 searching = false;
675 loading.hideLoadingMask(); 675 loading.hideLoadingMask();
676 - callback && callback(); 676 + callback && typeof callback === 'function' && callback();
677 } 677 }
678 }); 678 });
679 } 679 }
1 .ali-cloud-page { 1 .ali-cloud-page {
2 overflow: hidden; 2 overflow: hidden;
  3 + position: relative;
3 4
4 .back-img { 5 .back-img {
5 width: 100%; 6 width: 100%;
@@ -7,7 +8,7 @@ @@ -7,7 +8,7 @@
7 } 8 }
8 9
9 .btn { 10 .btn {
10 - position: relative; 11 + position: absolute;
11 display: block; 12 display: block;
12 width: 240px; 13 width: 240px;
13 height: 80px; 14 height: 80px;
@@ -19,7 +20,7 @@ @@ -19,7 +20,7 @@
19 } 20 }
20 21
21 .receive-bottom-btn { 22 .receive-bottom-btn {
22 - bottom: 225px; 23 + bottom: 147px;
23 left: 254px; 24 left: 254px;
24 } 25 }
25 26
@@ -41,7 +41,7 @@ @@ -41,7 +41,7 @@
41 41
42 img { 42 img {
43 max-width: 100%; 43 max-width: 100%;
44 - max-height: 100%; 44 + height: 100%;
45 } 45 }
46 } 46 }
47 47
@@ -48,7 +48,7 @@ module.exports = { @@ -48,7 +48,7 @@ module.exports = {
48 var opt = args[args.length - 1]; 48 var opt = args[args.length - 1];
49 var isTrue = false; 49 var isTrue = false;
50 50
51 - for (var i = 0; i < args.length - 1; i ++ ) { 51 + for (var i = 0; i < args.length - 1; i++) {
52 if (args[i]) { 52 if (args[i]) {
53 isTrue = true; 53 isTrue = true;
54 break; 54 break;