merge master
Showing
21 changed files
with
212 additions
and
38 deletions
@@ -112,6 +112,10 @@ app.use((req, res, next) => { | @@ -112,6 +112,10 @@ app.use((req, res, next) => { | ||
112 | req.session2.sessionBack = req.session; | 112 | req.session2.sessionBack = req.session; |
113 | } else { | 113 | } else { |
114 | req.session = new MemcachedSession.Session(req); | 114 | req.session = new MemcachedSession.Session(req); |
115 | + req.session.cookie = new MemcachedSession.Cookie({ | ||
116 | + domain: 'yohobuy.com', | ||
117 | + httpOnly: false | ||
118 | + }); | ||
115 | req.session = _.assign(req.session, req.session2.sessionBack); | 119 | req.session = _.assign(req.session, req.session2.sessionBack); |
116 | } | 120 | } |
117 | 121 |
@@ -295,6 +295,8 @@ let success = (req, res, next) => { | @@ -295,6 +295,8 @@ let success = (req, res, next) => { | ||
295 | regService.getRegData().then((result) => { | 295 | regService.getRegData().then((result) => { |
296 | res.render('reg/success', { | 296 | res.render('reg/success', { |
297 | title: '注册成功', | 297 | title: '注册成功', |
298 | + module: 'passport', | ||
299 | + page: 'reg-success', | ||
298 | simpleHeader: simpleHeaderModel.setSimpleHeaderData(), | 300 | simpleHeader: simpleHeaderModel.setSimpleHeaderData(), |
299 | passport: { | 301 | passport: { |
300 | goUrl: goUrl, | 302 | goUrl: goUrl, |
@@ -70,13 +70,8 @@ const showMain = (req, res, next) => { | @@ -70,13 +70,8 @@ const showMain = (req, res, next) => { | ||
70 | }, nullUserInfo)).then((result)=> { | 70 | }, nullUserInfo)).then((result)=> { |
71 | return res.render('product/detail', Object.assign({ | 71 | return res.render('product/detail', Object.assign({ |
72 | module: 'product', | 72 | module: 'product', |
73 | - page: 'detail', | ||
74 | - title_more: true, | ||
75 | - title: _.get(result, 'seo.title', '') + ' | ' + SEO_SLOGAN, | ||
76 | - keywords: _.get(result, 'seo.keywords', '').replace(/~+/, ''), | ||
77 | - description_more: true, | ||
78 | - description: result.description | ||
79 | - }, result)); | 73 | + page: 'detail' |
74 | + }, result.seo, result)); | ||
80 | }).catch(next); | 75 | }).catch(next); |
81 | 76 | ||
82 | }; | 77 | }; |
@@ -6,6 +6,7 @@ | @@ -6,6 +6,7 @@ | ||
6 | 'use strict'; | 6 | 'use strict'; |
7 | const mRoot = '../models'; | 7 | const mRoot = '../models'; |
8 | const list = require(`${mRoot}/list`); | 8 | const list = require(`${mRoot}/list`); |
9 | +const listSeoMap = require(`${global.middleware}/seo/listSeoMap`); | ||
9 | const helpers = global.yoho.helpers; | 10 | const helpers = global.yoho.helpers; |
10 | const _ = require('lodash'); | 11 | const _ = require('lodash'); |
11 | 12 | ||
@@ -78,17 +79,21 @@ const shop = (shopId, req, res, next, brandInfo) => { | @@ -78,17 +79,21 @@ const shop = (shopId, req, res, next, brandInfo) => { | ||
78 | */ | 79 | */ |
79 | exports.index = (req, res, next) => { | 80 | exports.index = (req, res, next) => { |
80 | let resData = {}; | 81 | let resData = {}; |
82 | + let qs = req._parsedOriginalUrl.query || ''; | ||
81 | 83 | ||
82 | list.getListData(req.query, req.yoho.channel).then(result => { | 84 | list.getListData(req.query, req.yoho.channel).then(result => { |
83 | Object.assign(resData, result); | 85 | Object.assign(resData, result); |
84 | 86 | ||
87 | + if (qs) { | ||
88 | + Object.assign(resData, listSeoMap[qs] || {}); | ||
89 | + } | ||
90 | + | ||
85 | // 查询结果为空则不cache | 91 | // 查询结果为空则不cache |
86 | if (_.isEmpty(_.get(resData, 'list.goods', []))) { | 92 | if (_.isEmpty(_.get(resData, 'list.goods', []))) { |
87 | res.set('Cache-Control', 'no-cache'); | 93 | res.set('Cache-Control', 'no-cache'); |
88 | } | 94 | } |
89 | res.render('list/index', resData); | 95 | res.render('list/index', resData); |
90 | }).catch(next); | 96 | }).catch(next); |
91 | - | ||
92 | }; | 97 | }; |
93 | 98 | ||
94 | /** | 99 | /** |
@@ -1089,15 +1089,21 @@ const _getSeoByGoodsInfo = (goodsInfo, navs) => { | @@ -1089,15 +1089,21 @@ const _getSeoByGoodsInfo = (goodsInfo, navs) => { | ||
1089 | title += navs[1].name + '|'; | 1089 | title += navs[1].name + '|'; |
1090 | } | 1090 | } |
1091 | 1091 | ||
1092 | - title += goodsInfo.name + '正品 '; | 1092 | + title += goodsInfo.name + '正品 | YOHO!BUY 有货'; |
1093 | + | ||
1093 | let keywords = brandName + sortName + ',' + brandName + '官网专卖店,' + brandName + '官方授权店,' + | 1094 | let keywords = brandName + sortName + ',' + brandName + '官网专卖店,' + brandName + '官方授权店,' + |
1094 | brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购'; | 1095 | brandName + '正品,' + brandName + '打折,' + brandName + '折扣店,' + brandName + '真品,' + brandName + '代购'; |
1095 | - let description = !goodsInfo.shareDesc ? goodsInfo.name : goodsInfo.shareDesc; | 1096 | + |
1097 | + let description = `YOHO!BUY 有货-${brandName}官方授权店,${goodsInfo.name}图片、报价、介绍。` + | ||
1098 | + `YOHO!BUY 有货${brandName}官网专卖店提供${brandName}正品、${brandName}真品、 ${brandName}打折、${brandName}代购等。`; | ||
1099 | + | ||
1100 | + let cononicalURL = goodsInfo.productUrl; | ||
1096 | 1101 | ||
1097 | return { | 1102 | return { |
1098 | title: title, | 1103 | title: title, |
1099 | - keywords: keywords, | ||
1100 | - description: description | 1104 | + keywords: keywords.replace(/~+/, ''), |
1105 | + description: description, | ||
1106 | + cononicalURL: cononicalURL | ||
1101 | }; | 1107 | }; |
1102 | }; | 1108 | }; |
1103 | 1109 | ||
@@ -1157,6 +1163,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1157,6 +1163,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1157 | result.productId = propOrigin('product_id'); | 1163 | result.productId = propOrigin('product_id'); |
1158 | result.shopId = propOrigin('shop_id', 0); | 1164 | result.shopId = propOrigin('shop_id', 0); |
1159 | result.brandId = propOrigin('brand_info.brand_id', ''); | 1165 | result.brandId = propOrigin('brand_info.brand_id', ''); |
1166 | + result.brandName = propOrigin('brand_info.brand_name', ''); | ||
1160 | 1167 | ||
1161 | result.maxSortId = propOrigin('maxSortId', ''); | 1168 | result.maxSortId = propOrigin('maxSortId', ''); |
1162 | result.smallSortId = propOrigin('smallSortId', ''); | 1169 | result.smallSortId = propOrigin('smallSortId', ''); |
@@ -1467,7 +1474,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1467,7 +1474,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1467 | // 分享相关,产品的链接 | 1474 | // 分享相关,产品的链接 |
1468 | result.weixinUrl = propOrigin('product_url'); | 1475 | result.weixinUrl = propOrigin('product_url'); |
1469 | result.shareTitle = result.name; | 1476 | result.shareTitle = result.name; |
1470 | - result.shareImg = 'http:' + result.img; // 分享图片必须使用http | 1477 | + result.shareImg = helpers.getForceSourceUrl(result.img); |
1471 | result.shareDesc = result.phrase; | 1478 | result.shareDesc = result.phrase; |
1472 | 1479 | ||
1473 | // 统计需要的商品信息 | 1480 | // 统计需要的商品信息 |
@@ -1480,12 +1487,14 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | @@ -1480,12 +1487,14 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { | ||
1480 | statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’'); | 1487 | statGoodsInfo.brandName = (result.brandName || '').replace('\'', '’'); |
1481 | statGoodsInfo.marketPrice = (result.marketPrice ? result.marketPrice : result.presalePrice).replace('¥', ''); // 数字 | 1488 | statGoodsInfo.marketPrice = (result.marketPrice ? result.marketPrice : result.presalePrice).replace('¥', ''); // 数字 |
1482 | statGoodsInfo.salePrice = (result.salePrice ? result.salePrice : (result.marketPrice || result.presalePrice)).replace('¥', ''); // 数字 | 1489 | statGoodsInfo.salePrice = (result.salePrice ? result.salePrice : (result.marketPrice || result.presalePrice)).replace('¥', ''); // 数字 |
1483 | - statGoodsInfo.imageUrl = 'http:' + result.img.split('?')[0]; | 1490 | + statGoodsInfo.imageUrl = helpers.getForceSourceUrl(result.img); |
1484 | statGoodsInfo.productUrl = 'http:' + | 1491 | statGoodsInfo.productUrl = 'http:' + |
1485 | helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item'); | 1492 | helpers.urlFormat(url.parse(propOrigin('product_url')).pathname, null, 'item'); |
1486 | statGoodsInfo.smallSortId = result.smallSortId; | 1493 | statGoodsInfo.smallSortId = result.smallSortId; |
1487 | statGoodsInfo.soldOut = soldOut ? 1 : 0; | 1494 | statGoodsInfo.soldOut = soldOut ? 1 : 0; |
1488 | 1495 | ||
1496 | + result.productUrl = statGoodsInfo.productUrl; | ||
1497 | + | ||
1489 | // 商品的品牌信息 | 1498 | // 商品的品牌信息 |
1490 | let bandInfo = {}; | 1499 | let bandInfo = {}; |
1491 | 1500 | ||
@@ -1627,6 +1636,12 @@ const showMainAsync = (data) => { | @@ -1627,6 +1636,12 @@ const showMainAsync = (data) => { | ||
1627 | [{name: _.get(productInfo, 'goodsInfo.name')}] | 1636 | [{name: _.get(productInfo, 'goodsInfo.name')}] |
1628 | ); | 1637 | ); |
1629 | 1638 | ||
1639 | + // 统计代码中需要新的path | ||
1640 | + result.statGoodsInfo.category = _.concat( | ||
1641 | + homeService.getHomeChannelNav(data.channel), | ||
1642 | + smallSortNavigator | ||
1643 | + ).map(n => n.name).join('>'); | ||
1644 | + | ||
1630 | // 头部数据 | 1645 | // 头部数据 |
1631 | result.headerData = navigatorHeader.headerData; | 1646 | result.headerData = navigatorHeader.headerData; |
1632 | 1647 |
@@ -28,4 +28,21 @@ | @@ -28,4 +28,21 @@ | ||
28 | s.parentNode.insertBefore(mvl, s); | 28 | s.parentNode.insertBefore(mvl, s); |
29 | })(); | 29 | })(); |
30 | </script> | 30 | </script> |
31 | + <script> | ||
32 | + window.PING_YOU_VIEW_ITEM = { | ||
33 | + 'product_no':'{{productId}}', | ||
34 | + 'spu_id': '{{skn}}', | ||
35 | + 'name': '{{{productName}}}', | ||
36 | + 'category': '{{{category}}}', | ||
37 | + 'brand': '{{{brandName}}}', | ||
38 | + 'price': {{salePrice}}, | ||
39 | + 'orig_price': {{marketPrice}}, | ||
40 | + 'currency_code': 'CNY', | ||
41 | + 'product_url': '{{{productUrl}}}', | ||
42 | + 'pic_size': '',// 宽x高 | ||
43 | + 'pc_pic_url': '{{{imageUrl}}}', | ||
44 | + 'promotion': '', | ||
45 | + 'sold_out': {{soldOut}} | ||
46 | + }; | ||
47 | + </script> | ||
31 | {{/statGoodsInfo}} | 48 | {{/statGoodsInfo}} |
doraemon/middleware/seo/listSeoMap.js
0 → 100644
1 | +const seoMap = { | ||
2 | +/* eslint-disable */ | ||
3 | + 'gender=1,3&msort=1,3': { | ||
4 | + title: '服饰|男装潮男服饰搭配,时尚休闲男装,商务男装|YOHO!BUY有货 100%正品保证', | ||
5 | + keywords: '服饰,男装,潮男服饰,时尚休闲男装,商务男装,YOHO!BUY有货', | ||
6 | + description: 'YOHO!BUY有货男装服饰提供时尚休闲男装,商务男装,潮男服饰搭配,教你穿出气质,搭出风采.购买当季最新款男装就到YOHO!BUY有货,100%正品保证' | ||
7 | + }, | ||
8 | + 'gender=1,3&msort=6': { | ||
9 | + title: '鞋履|男鞋,休闲男鞋,商务男鞋,品牌男鞋|YOHO!BUY有货 100%正品保证', | ||
10 | + keywords: '鞋履,男鞋,休闲男鞋,商务男鞋,品牌男鞋,YOHO!BUY有货', | ||
11 | + description: 'YOHO!BUY有货男鞋鞋履频道提供品牌男鞋,休闲男鞋,商务男鞋,男鞋价格、评论、图片以及男鞋尺码对照表等相关信息等,购买男鞋就到YOHO!BUY有货,100%正品保证!' | ||
12 | + }, | ||
13 | + 'gender=1,3&msort=7': { | ||
14 | + title: '包袋|男士手包,时尚男包,男包品牌,真皮男包新品|YOHO!BUY有货 100%正品保证', | ||
15 | + keywords: '男包,男士手包,时尚男包,男包品牌,真皮男包', | ||
16 | + description: 'YOHO!BUY有货男包频道提供精品男包,囊括商务公文包,单肩斜跨包,男士手包,男士钱包,双肩包等几大丰富品类,购买男包就到YOHO!BUY有货,100%正品保证!' | ||
17 | + }, | ||
18 | + 'gender=1,3&msort=8,10,241': { | ||
19 | + title: '配饰其他|男士配饰,男士时尚配饰|YOHO!BUY有货 100%正品保证', | ||
20 | + keywords: '配饰其他,男士配饰,男士时尚配饰,YOHO!BUY有货', | ||
21 | + description: 'YOHO!BUY有货配饰其他频道提供新款男士配饰,时尚帽子、围巾、耳机音响、自拍神器等男士潮流配饰搭配商品。购买男士配饰就到YOHO!BUY有货,100%正品保证!' | ||
22 | + }, | ||
23 | + 'gender=2,3&msort=1,3': { | ||
24 | + title: '服饰|女装,时尚女装品牌,潮流女装|YOHO!BUY有货 100%正品保证', | ||
25 | + keywords: '服饰,女装,时尚女装,女装品牌,潮流女装,YOHO!BUY有货', | ||
26 | + description: 'YOHO!BUY有货女装服饰提供时尚女装,女装品牌,潮流女装搭配,教你穿出气质,搭出风采.购买当季最新款女装就到YOHO!BUY有货,100%正品保证' | ||
27 | + }, | ||
28 | + 'gender=2,3&msort=6': { | ||
29 | + title: '鞋履|女鞋,休闲女鞋,时尚女鞋,品牌女鞋|YOHO!BUY有货 100%正品保证', | ||
30 | + keywords: '鞋履,女鞋,休闲女鞋,时尚女鞋,品牌女鞋,YOHO!BUY有货', | ||
31 | + description: 'YOHO!BUY有货女鞋鞋履频道提供品牌女鞋,休闲女鞋,时尚女鞋,女鞋价格、评论、图片以及女鞋尺码对照表等相关信息等,购买女鞋就到YOHO!BUY有货,100%正品保证!' | ||
32 | + }, | ||
33 | + 'gender=2,3&msort=7': { | ||
34 | + title: '包袋|女士手包,时尚女包,女包品牌,真皮女包新品|YOHO!BUY有货 100%正品保证', | ||
35 | + keywords: '女包,女士手包,时尚女包,女包品牌,真皮女包,YOHO!BUY有货', | ||
36 | + description: 'YOHO!BUY有货女包频道提供精品女包,囊括电脑包,女士手包,女士钱包,女士腰包,单肩斜跨包,双肩包等几大丰富品类,购买女包就到YOHO!BUY有货,100%正品保证!' | ||
37 | + }, | ||
38 | + 'gender=2,3&msort=8,10,241': { | ||
39 | + title: '配饰其他|女士配饰,女士时尚配饰|YOHO!BUY有货 100%正品保证', | ||
40 | + keywords: '配饰其他,女士配饰,女士时尚配饰,YOHO!BUY有货', | ||
41 | + description: 'YOHO!BUY有货配饰其他频道提供新款女士配饰,时尚帽子、围巾、耳钉手链、腰带胸针等女士潮流配饰搭配商品。购买女士配饰就到YOHO!BUY有货,100%正品保证!' | ||
42 | + }, | ||
43 | + 'msort=365&gender=1,3&order=s_t_desc': { | ||
44 | + title: '男童服饰|男童上衣外套,下装,时尚男童鞋包配饰|YOHO!BUY有货 100%正品保证', | ||
45 | + keywords: '男童服饰,男童上衣外套,男童下装,时尚男童鞋包配饰,YOHO!BUY有货', | ||
46 | + description: 'YOHO!BUY有货男童服饰提供时尚男童上衣外套,下装,时尚男童鞋包配饰,教你穿出可爱,搭出时尚.购买当季最新款男童服饰就到YOHO!BUY有货,100%正品保证' | ||
47 | + }, | ||
48 | + 'msort=365&order=s_t_desc&gender=2,3': { | ||
49 | + title: '女童服饰|女童上衣外套,下装,时尚女童鞋包配饰|YOHO!BUY有货 100%正品保证', | ||
50 | + keywords: '女童服饰,女童上衣外套,女童下装,时尚女童鞋包配饰,YOHO!BUY有货', | ||
51 | + description: 'YOHO!BUY有货女童服饰提供时尚女童上衣外套,下装,时尚女童鞋包配饰,教你穿出可爱,搭出时尚.购买当季最新款女童服饰就到YOHO!BUY有货,100%正品保证' | ||
52 | + }, | ||
53 | + 'msort=365&misort=368,392,414,421,429,419,408': { | ||
54 | + title: '潮童鞋包配饰|儿童鞋,儿童包,时尚潮童配饰|YOHO!BUY有货 100%正品保证', | ||
55 | + keywords: '潮童鞋包配饰,儿童鞋,儿童包,时尚潮童配饰', | ||
56 | + description: 'YOHO!BUY有货潮童鞋包配饰提供儿童鞋,儿童包,时尚潮童配饰,教你穿出可爱,搭出时尚.购买当季最新款潮童鞋包配饰就到YOHO!BUY有货,100%正品保证' | ||
57 | + }, | ||
58 | + 'msort=10&misort=103': { | ||
59 | + title: '数码3c|数码,3c,数码产品配件|YOHO!BUY有货 100%正品保证', | ||
60 | + keywords: '数码,3c,3c数码,数码产品配件,YOHO!BUY有货', | ||
61 | + description: 'YOHO!BUY有货数码3c汇集数码产品配件,提供手机/ipad壳套,数码配件,耳机,手机配件,相机,智能装备,U盘,电脑架.购买3c数码就到YOHO!BUY有货,100%正品保证' | ||
62 | + }, | ||
63 | + 'msort=10&misort=266': { | ||
64 | + title: '居家用品|居家生活,居家装修装饰购物|YOHO!BUY有货 100%正品保证', | ||
65 | + keywords: '居家,居家用品,居家装修,居家装饰,居家生活', | ||
66 | + description: 'YOHO!BUY有货居家频道提供家装修装饰购物,居家生活日用品、居家饰品,汇集家居饰品,杯子,储物收纳,雨伞,抱枕,香薰,床上用品等。购买居家日用品就到YOHO!BUY有货,100%正品保证!' | ||
67 | + }, | ||
68 | + 'msort=10&misort=101,280': { | ||
69 | + title: '玩具娱乐|玩具,玩偶,DIY,文具,毛绒玩具|YOHO!BUY有货 100%正品保证', | ||
70 | + keywords: '玩具娱乐,玩具,玩偶,DIY,文具,毛绒玩具', | ||
71 | + description: 'YOHO!BUY有货玩具娱乐频道提供玩具娱乐,玩具,玩偶,DIY,文具,毛绒玩具等,购买娱乐玩具就到YOHO!BUY有货,100%正品保证!' | ||
72 | + }, | ||
73 | + 'msort=10&misort=259': { | ||
74 | + title: '美妆|美白化妆品,日系美妆,美妆新品|YOHO!BUY有货 100%正品保证', | ||
75 | + keywords: '美妆,美白化妆品,日系美妆,美妆新品', | ||
76 | + description: 'YOHO!BUY有货美妆频道提供美白化妆品,日系美妆,美妆新品,汇集彩妆,香水,个人护理,纹身贴,面部护肤,美体瘦身等商品。购买美妆产品就到YOHO!BUY有货,100%正品保证!' | ||
77 | + } | ||
78 | +/* eslint-enable */ | ||
79 | +}; | ||
80 | + | ||
81 | +module.exports = seoMap; |
@@ -19,6 +19,11 @@ const seoMap = { | @@ -19,6 +19,11 @@ const seoMap = { | ||
19 | title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|YOHO!BUY 有货 100%正品保证', | 19 | title: '创意生活|创意生活馆,潮流创意家居,家居生活用品|YOHO!BUY 有货 100%正品保证', |
20 | keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,YOHO!BUY有货', | 20 | keywords: '创意生活,创意生活馆,潮流家居,潮流创意家居,家居生活用品,YOHO!BUY有货', |
21 | description: 'YOHO!BUY有货官网创意生活频道汇集了创意生活馆,潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。YOHO!BUY有货购物100%正品保证,支持货到付款。' | 21 | description: 'YOHO!BUY有货官网创意生活频道汇集了创意生活馆,潮流创意家居,家居生活用品等正品网购,给您的生活带来更多创意。YOHO!BUY有货购物100%正品保证,支持货到付款。' |
22 | + }, | ||
23 | + '/coupon/index': { | ||
24 | + title: '有货优惠券_有货现金优惠券,全场券,品类券,品牌券_领券频道-YOHO!BUY有货', | ||
25 | + keywords: '有货优惠券,有货现金优惠券,全场券,品类券,品牌券', | ||
26 | + description: 'YOHO!BUY有货官网领券频道,提供有货优惠券,有货现金优惠券,有货全场券,有货品类券,品牌券免费领取,让你做网购达人,省钱又省心!' | ||
22 | } | 27 | } |
23 | /* eslint-enable */ | 28 | /* eslint-enable */ |
24 | }; | 29 | }; |
@@ -4,6 +4,7 @@ | @@ -4,6 +4,7 @@ | ||
4 | * @date: 2016/6/16 | 4 | * @date: 2016/6/16 |
5 | */ | 5 | */ |
6 | 'use strict'; | 6 | 'use strict'; |
7 | +const helpers = global.yoho.helpers; | ||
7 | 8 | ||
8 | module.exports = () => { | 9 | module.exports = () => { |
9 | return (req, res, next) => { | 10 | return (req, res, next) => { |
@@ -11,6 +12,9 @@ module.exports = () => { | @@ -11,6 +12,9 @@ module.exports = () => { | ||
11 | guangReg = /^\/guang/, | 12 | guangReg = /^\/guang/, |
12 | guangDetailReg = /.html$/; | 13 | guangDetailReg = /.html$/; |
13 | 14 | ||
15 | + if (req.subdomains.length > 1 && req.subdomains[1] === 'www') { | ||
16 | + res.redirect(301, helpers.urlFormat(req.path, req.query || '', req.subdomains[0])); | ||
17 | + } | ||
14 | if (req.subdomains.length) { | 18 | if (req.subdomains.length) { |
15 | switch (req.subdomains[0]) { | 19 | switch (req.subdomains[0]) { |
16 | case 'www': // 主站 | 20 | case 'www': // 主站 |
@@ -5,6 +5,7 @@ | @@ -5,6 +5,7 @@ | ||
5 | <title>{{title}}</title> | 5 | <title>{{title}}</title> |
6 | <meta name="keywords" content="{{keywords}}"> | 6 | <meta name="keywords" content="{{keywords}}"> |
7 | <meta name="description" content="{{description}}"> | 7 | <meta name="description" content="{{description}}"> |
8 | + {{#if cononicalURL}} <link rel="cononical" href="{{cononicalURL}}"/> {{/if}} | ||
8 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> | 9 | <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no"> |
9 | <meta http-equiv="cleartype" content="on"> | 10 | <meta http-equiv="cleartype" content="on"> |
10 | <meta name="apple-mobile-web-app-status-bar-style" content="black" /> | 11 | <meta name="apple-mobile-web-app-status-bar-style" content="black" /> |
@@ -18,6 +18,16 @@ var _gaq = _gaq || []; | @@ -18,6 +18,16 @@ var _gaq = _gaq || []; | ||
18 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; | 18 | ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; |
19 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); | 19 | var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); |
20 | })(); | 20 | })(); |
21 | + // 新品友代码 | ||
22 | + (function(w,d,s,l,a){ | ||
23 | + w._CommandName_=l;w[l]=w[l]||function(){(w[l].q=w[l].q||[]).push(arguments); | ||
24 | + w[l].track = function(){(w[l].q[w[l].q.length-1].t=[]).push(arguments)};return w[l]},w[l].a=a,w[l].l=1*new Date(); | ||
25 | + var c = d.createElement(s);c.async=1; | ||
26 | + c.src='//fm.ipinyou.com/j/t/a.js'; | ||
27 | + var h = d.getElementsByTagName(s)[0];h.parentNode.insertBefore(c, h); | ||
28 | + })(window,document,'script','py','MC..o8vMMWxEXDCiqYckD81lUX'); | ||
29 | + py('set','user',{'id':'0'}); | ||
30 | + py('event','viewPage'); | ||
21 | } | 31 | } |
22 | if (window.addEventListener) { | 32 | if (window.addEventListener) { |
23 | window.addEventListener('load', async_load, false); | 33 | window.addEventListener('load', async_load, false); |
1 | { | 1 | { |
2 | "name": "yohobuy-node", | 2 | "name": "yohobuy-node", |
3 | - "version": "5.3.7", | 3 | + "version": "5.3.12", |
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": { |
@@ -38,6 +38,7 @@ | @@ -38,6 +38,7 @@ | ||
38 | "cheerio": "^0.22.0", | 38 | "cheerio": "^0.22.0", |
39 | "client-sessions": "^0.7.0", | 39 | "client-sessions": "^0.7.0", |
40 | "compression": "^1.6.2", | 40 | "compression": "^1.6.2", |
41 | + "connect-memcached": "^0.2.0", | ||
41 | "connect-multiparty": "^2.0.0", | 42 | "connect-multiparty": "^2.0.0", |
42 | "cookie-parser": "^1.4.3", | 43 | "cookie-parser": "^1.4.3", |
43 | "cookie-session": "^1.2.0", | 44 | "cookie-session": "^1.2.0", |
@@ -59,6 +60,7 @@ | @@ -59,6 +60,7 @@ | ||
59 | "request-promise": "^3.0.0", | 60 | "request-promise": "^3.0.0", |
60 | "serve-favicon": "^2.3.0", | 61 | "serve-favicon": "^2.3.0", |
61 | "uuid": "^2.0.2", | 62 | "uuid": "^2.0.2", |
63 | + "yoho-express-session": "^2.0.0", | ||
62 | "yoho-node-lib": "0.2.2", | 64 | "yoho-node-lib": "0.2.2", |
63 | "yoho-zookeeper": "^1.0.6" | 65 | "yoho-zookeeper": "^1.0.6" |
64 | }, | 66 | }, |
@@ -99,7 +101,7 @@ | @@ -99,7 +101,7 @@ | ||
99 | "shelljs": "^0.7.0", | 101 | "shelljs": "^0.7.0", |
100 | "stylelint": "^6.8.0", | 102 | "stylelint": "^6.8.0", |
101 | "stylelint-config-yoho": "^1.2.4", | 103 | "stylelint-config-yoho": "^1.2.4", |
102 | - "webpack": "^1.13.1", | 104 | + "webpack": "1.13.2", |
103 | "webpack-dev-server": "^1.14.1", | 105 | "webpack-dev-server": "^1.14.1", |
104 | "webpack-stream": "^3.1.0", | 106 | "webpack-stream": "^3.1.0", |
105 | "yoho-eventproxy": "^0.3.6", | 107 | "yoho-eventproxy": "^0.3.6", |
@@ -7,6 +7,8 @@ | @@ -7,6 +7,8 @@ | ||
7 | "exec_mode": "cluster", | 7 | "exec_mode": "cluster", |
8 | "merge_logs": true, | 8 | "merge_logs": true, |
9 | "log_date_format": "YYYY-MM-DD HH:mm Z", | 9 | "log_date_format": "YYYY-MM-DD HH:mm Z", |
10 | + "error_file": "/Data/logs/node/yohobuy-node-err.log", | ||
11 | + "out_file": "/Data/logs/node/yohobuy-node-out.log", | ||
10 | "env": { | 12 | "env": { |
11 | "TZ": "Asia/Shanghai", | 13 | "TZ": "Asia/Shanghai", |
12 | "PORT": 6002 | 14 | "PORT": 6002 |
@@ -109,7 +109,7 @@ function getShoppingKey() { | @@ -109,7 +109,7 @@ function getShoppingKey() { | ||
109 | a.src = j; | 109 | a.src = j; |
110 | m.parentNode.insertBefore(a, m); | 110 | m.parentNode.insertBefore(a, m); |
111 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://' + // eslint-disable-line | 111 | }(window, document, 'script', (document.location.protocol === 'https:' ? 'https' : 'http') + '://' + // eslint-disable-line |
112 | - 'cdn.yoho.cn/yas-jssdk/1.0.18/yas.js', '_yas')); // eslint-disable-line | 112 | + 'cdn.yoho.cn/yas-jssdk/2.1.1/yas.js', '_yas')); // eslint-disable-line |
113 | 113 | ||
114 | (function() { | 114 | (function() { |
115 | var uid = getUid(); | 115 | var uid = getUid(); |
@@ -119,7 +119,7 @@ function getShoppingKey() { | @@ -119,7 +119,7 @@ function getShoppingKey() { | ||
119 | window._ozuid = uid; // 暴露ozuid | 119 | window._ozuid = uid; // 暴露ozuid |
120 | 120 | ||
121 | if (window._yas) { | 121 | if (window._yas) { |
122 | - window._yas(1 * new Date(), '1.0.18', 'yohobuy_web', uid, '', ''); | 122 | + window._yas(1 * new Date(), '2.1.1', 'yohobuy_web', uid, '', ''); |
123 | } | 123 | } |
124 | }()); | 124 | }()); |
125 | 125 | ||
@@ -215,6 +215,16 @@ function isLogin() { | @@ -215,6 +215,16 @@ function isLogin() { | ||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | +// 品友 | ||
219 | +function addPyEvent(eventName, val) { | ||
220 | + if (typeof window.py === 'function') { | ||
221 | + window.py('event', eventName, val); | ||
222 | + } else { | ||
223 | + setTimeout(function() { | ||
224 | + addPyEvent(eventName, val); | ||
225 | + }, 3000); | ||
226 | + } | ||
227 | +} | ||
218 | window.cookie = cookie; | 228 | window.cookie = cookie; |
219 | 229 | ||
220 | window.setCookie = setCookie; | 230 | window.setCookie = setCookie; |
@@ -238,6 +248,7 @@ window.registerUrl = registerUrl; | @@ -238,6 +248,7 @@ window.registerUrl = registerUrl; | ||
238 | window.jumpUrl = jumpUrl; | 248 | window.jumpUrl = jumpUrl; |
239 | 249 | ||
240 | window.once = once; | 250 | window.once = once; |
251 | +window.addPyEvent = addPyEvent; | ||
241 | 252 | ||
242 | require('./header'); | 253 | require('./header'); |
243 | require('./footer'); | 254 | require('./footer'); |
public/js/passport/reg-success.page.js
0 → 100644
1 | +require('../common'); | ||
2 | + | ||
3 | +var $ = require('yoho-jquery'), // eslint-disable-line | ||
4 | + yas = require('../common/data-yas'); | ||
5 | + | ||
6 | +var $countDown = $('#count-down'), // eslint-disable-line | ||
7 | + $successBtn = $('.success-btn'), | ||
8 | + countDown = 5, | ||
9 | + clearT; // 注册成功页面5秒后跳转 | ||
10 | + | ||
11 | +if ($('.success-box').length > 0) { | ||
12 | + clearT = setInterval(function() { | ||
13 | + | ||
14 | + if (countDown === 0) { | ||
15 | + | ||
16 | + window.location.href = $successBtn.attr('data-url'); | ||
17 | + | ||
18 | + clearInterval(clearT); | ||
19 | + } | ||
20 | + $countDown.text(countDown--); | ||
21 | + }, 1000); | ||
22 | +} | ||
23 | + | ||
24 | +$(function() { | ||
25 | + yas.givePoint('YB_REGISTER_SUCCESS_L'); | ||
26 | +}); |
@@ -13,10 +13,6 @@ var $registerPage = $('.register-page'), | @@ -13,10 +13,6 @@ var $registerPage = $('.register-page'), | ||
13 | $pwdTip1 = $pwdTips.find('#pwd-tip1'), | 13 | $pwdTip1 = $pwdTips.find('#pwd-tip1'), |
14 | $errTip = $('#err-tip'), | 14 | $errTip = $('#err-tip'), |
15 | $registerBtn = $('#register-btn'), | 15 | $registerBtn = $('#register-btn'), |
16 | - $countDown = $('#count-down'), | ||
17 | - $successBtn = $('.success-btn'), | ||
18 | - countDown = 5, | ||
19 | - clearT, | ||
20 | captchaImage = new Captcha('#captcha-img').init(); | 16 | captchaImage = new Captcha('#captcha-img').init(); |
21 | 17 | ||
22 | var $sendCaptcha = $('#send-captcha'), | 18 | var $sendCaptcha = $('#send-captcha'), |
@@ -641,18 +637,4 @@ exports.init = function(page) { | @@ -641,18 +637,4 @@ exports.init = function(page) { | ||
641 | }); | 637 | }); |
642 | } | 638 | } |
643 | }); | 639 | }); |
644 | - | ||
645 | - // 注册成功页面5秒后跳转 | ||
646 | - if ($('.success-box').length > 0) { | ||
647 | - clearT = setInterval(function() { | ||
648 | - | ||
649 | - if (countDown === 0) { | ||
650 | - | ||
651 | - window.location.href = $successBtn.attr('data-url'); | ||
652 | - | ||
653 | - clearInterval(clearT); | ||
654 | - } | ||
655 | - $countDown.text(countDown--); | ||
656 | - }, 1000); | ||
657 | - } | ||
658 | }; | 640 | }; |
public/js/product/detail/stat.js
0 → 100644
-
Please register or login to post a comment