Authored by 刘传洋

merge hotfix

... ... @@ -7,11 +7,6 @@
const config = require('./config/common');
// use one apm
if (config.useOneapm) {
require('oneapm');
}
const express = require('express');
const path = require('path');
const bodyParser = require('body-parser');
... ... @@ -42,6 +37,7 @@ app.locals.version = pkg.version;
app.set('subdomain offset', 2);
app.set('view engine', '.hbs');
app.set('views', './doraemon/views');
app.set('view cache', true);
app.engine('.hbs', hbs({
extname: '.hbs',
defaultLayout: 'layout',
... ... @@ -70,7 +66,12 @@ app.use(session({
store: new MemcachedStore({
hosts: config.memcache.session,
prefix: 'yohobuy_session:'
prefix: 'yohobuy_session:',
poolSize: 25,
reconnect: 5000,
timeout: 1000,
retries: 1,
retry: 3000
})
}));
... ...
... ... @@ -6,7 +6,6 @@
*/
'use strict';
const utils = '../../../utils';
const api = global.yoho.API;
const Promise = require('bluebird');
const saleApi = require('./sale-api');
... ... @@ -383,13 +382,20 @@ exports.getSaleDiscountData = (params, channel) => {
// 处理商品数据,顶部分类
if (subResult[1].code === 200) {
let sknArr = [];
finalResult.saleList.goods = productProcess.processProductList(subResult[1].data.product_list);
finalResult.saleList.totalCount = subResult[1].data.total;
_.forEach(finalResult.saleList.goods, (value, key) => {
if (sknArr.length < 3) {
sknArr.push(value.product_skn);
}
delete finalResult.saleList.goods[key].tags.is_new; // 屏蔽 new 标签
delete finalResult.saleList.goods[key].tags.is_sale;// 屏蔽 sale 标签
delete finalResult.saleList.goods[key].discount; // 屏蔽折扣信息
});
finalResult.criteo = {skn: sknArr}; // 重要:推广列表前三个商品Skn
}
return finalResult;
... ...
... ... @@ -11,4 +11,5 @@
{{/ saleList}}
</div>
</div>
{{> common/criteo}}
{{/ result}}
... ...
{{# criteo}}
<script type="text/javascript" src="//static.criteo.net/js/ld/ld.js" async="true"></script>
<script type="text/javascript">
window.criteo_q = window.criteo_q || [];
window.criteo_q.push(
{ event: "setAccount", account: [16184] },
{ event: "setSiteType", type: "d" },
{ event: "viewList", item: [{{#each skn}}"{{.}}"{{#unless @last}},{{/unless}}{{/each}}]}
);
</script>
{{/ criteo}}
\ No newline at end of file
... ...
... ... @@ -87,12 +87,16 @@ if (isProduction) {
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
slave: ['memcache1.yohoops.org:12112', 'memcache2.yohoops.org:12112', 'memcache3.yohoops.org:12112'],
session: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
timeout: 3000
poolSize: 25,
reconnect: 5000,
timeout: 300,
retries: 1,
retry: 3000
},
useOneapm: true,
useCache: true,
interfaceShunt: {
open: false,
open: true,
url: 'http://123.206.2.55/strategy'
}
});
... ...
... ... @@ -25,4 +25,27 @@ var _gaq = _gaq || [];
window.attachEvent('onload', async_load);
}
})();
</script>
<script>
window._py = window._py||[];
window._py.push(['a', 'MC..o8vMMWxEXDCiqYckD81lUX']);
window._py.push(['domain','stats.ipinyou.com']);
window._py.push(['e','']);
if(typeof _goodsData!='undefined'){
window._py.push(['pi',_goodsData]);
}
-function(d){
var f = 'https:' == d.location.protocol;var c = d.createElement('script');c.type='text/javascript';c.async=1;
c.src=(f ? 'https' : 'http') + '://'+(f?'fm.ipinyou.com':'fm.p0y.cn')+'/j/t/adv.js';
var h = d.getElementsByTagName("script")[0];h.parentNode.insertBefore(c, h);
}(document);
</script>
<script>
var _hmt = _hmt || [];
(function() {
var hm = document.createElement("script");
hm.src = "//hm.baidu.com/hm.js?65dd99e0435a55177ffda862198ce841";
var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s);
})();
</script>
\ No newline at end of file
... ...