Authored by htoooth

Merge branch 'master' into hotfix/gee-captcha-check

/**
* 激活点击统计 controller
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2017/03/21
*/
'use strict';
const Model = require('../models/activate');
const index = (req, res, next) => {
let uid = req.user.uid;
Model.canLogin(uid).then(canLogin => {
if (canLogin === 'N') {
return next();
} else {
res.render('activate', {
module: '3party',
page: 'activate',
layout: false
});
}
}).catch(next);
};
const getList = (req, res, next) => {
let uid = req.user.uid;
Model.getList({
uid: uid,
activateTimeBegin: req.query.startTime ? req.query.startTime + ' 00:00:00' : '',
activateTimeEnd: req.query.endTime ? req.query.endTime + ' 23:59:59' : ''
}).then(result => {
res.json(result.data.list);
}).catch(next);
};
module.exports = {
index,
getList
};
... ...
/**
* 激活点击统计 models
* @author: wsl<shuiling.wang@yoho.cn>
* @date: 2017/03/21
*/
'use strict';
const unionApi = new global.yoho.ApiBase(global.yoho.config.domains.unionApi, {
name: 'union',
cache: global.yoho.cache,
useCache: false
});
const canLogin = (uid) => {
return unionApi.post('/union/ActivateUnionRest/canlogin', {
uid: uid
}).then(result => {
if (result && result.code === 200) {
return result.data.canLogin;
} else {
return Promise.reject(result);
}
});
};
const getList = (params) => {
return unionApi.post('/union/ActivateUnionRest/queryYHActivateDeviceId', params).then(result => {
if (result && result.code === 200) {
return result;
} else {
return Promise.reject(result);
}
});
};
module.exports = {
canLogin,
getList
};
... ...
... ... @@ -14,6 +14,7 @@ const auth = require(`${global.middleware}/auth`);
const ads = require(`${cRoot}/ads`); // 第三方广告平台对接
const robot = require(`${cRoot}/robot-check`); // 机器人检查
const materialController = require(`${cRoot}/material`);
const activate = require(`${cRoot}/activate`); // 激活点击统计
router.get('/ads', ads.jump);
router.get('/check', robot.index);
... ... @@ -25,4 +26,7 @@ router.get('/material/getCategory', auth, materialController.getCategory);
router.get('/material/getList', auth, materialController.getList);
router.get('/material/getRecommendlist', auth, materialController.getRecommendlist);
router.get('/activate-count', auth, activate.index);
router.get('/activate-count/getList', auth, activate.getList);
module.exports = router;
... ...
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>{{title}}</title>
<meta name="keywords" content="{{keywords}}">
<meta name="description" content="{{description}}"> {{#if cononicalURL}}
<link rel="cononical" href="{{cononicalURL}}" /> {{/if}}
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no">
<meta http-equiv="cleartype" content="on">
<meta name="apple-mobile-web-app-status-bar-style" content="black" />
<meta content="telephone=no" name="format-detection" />
<meta content="email=no" name="format-detection" /> {{#dnsPrefetch.hosts}}
<link rel="dns-prefetch" href="{{this}}"> {{/dnsPrefetch.hosts}}
{{#if devEnv}}
<link rel="stylesheet" href="//{{devHost}}:5002/css/base.css">
<link rel="stylesheet" href="//{{devHost}}:5002/css/{{#if cssModule}}{{cssModule}}.css{{^}}{{module}}.css{{/if}}">
{{^}}
<link rel="stylesheet" href="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/base.css">
<link rel="stylesheet" href="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/{{#if cssModule}}{{cssModule}}.css{{^}}{{module}}.css{{/if}}">
{{/if}}
</head>
<body>
<div class="activate-count-page">
<h1><i class="logo"></i>激活点击统计列表</h1>
<div class="line">
<label for="" style="margin-left: 10px;">开始时间:</label>
<input type="date" class="sel start-time">
<label for="" style="margin-left: 10px;">结束时间:</label>
<input type="date" class="sel end-time">
<div class="query-btn">查询</div>
</div>
<div class="table-data">
</div>
</div>
{{#if devEnv}}
<script src="//{{devHost}}:5002/libs.js"></script>
<script src="//{{devHost}}:5002/{{module}}.{{page}}.js"></script>
{{^}}
<script src="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/libs.js"></script>
<script src="//{{#isEqual cdn 'qcloud'}}qcdn.yoho.cn{{^}}cdn.yoho.cn{{/isEqual}}/yohobuy-node/{{version}}/{{module}}.{{page}}.js"></script>
{{> analysis}}
{{/if}}
</body>
</html>
... ...
... ... @@ -134,6 +134,7 @@
{{/isEqual}}
{{product_name}}
</p>
{{#isY is_limit_skn}}<p class="special-limit-7day">不支持7天无理由退换</p>{{/isY}}
</a>
</td>
<td class="border-top color-size">
... ...
... ... @@ -76,7 +76,7 @@ const getListData = (params, channel) => {
let apiMethod = [
headerModel.requestHeaderData(channel),
searchApi.getSortList(Object.assign({}, {msort: '', misort: ''})),
searchApi.getProductList(searchParams)
searchApi.getProductList(searchParams, 'categoryList')
];
// 搜索分类介绍和广告
... ... @@ -290,7 +290,7 @@ const getBrandData = (params, extra, channel) => {
let apiMethod = [
headerModel.requestHeaderData(channel),
searchApi.getSortList(queryBase),
searchApi.getProductList(Object.assign(searchParams, queryBase))
searchApi.getProductList(Object.assign(searchParams, queryBase), 'brand')
];
if (queryBase.brand) {
... ... @@ -588,7 +588,7 @@ const getShopData = (shopId, channel, params, shopInfo) => {
searchApi.getShopDecorator(shopId), // 店铺装修数据
searchApi.getProductList(Object.assign({
shop_id: shopId
}, params)), // 搜索店铺商品
}, params), 'shop'), // 搜索店铺商品
searchApi.getShopBrands(shopId), // 店铺品牌数据
shopApi.shopCouponListAsync(shopId) // 店铺优惠券数据
]).then(result => {
... ... @@ -647,7 +647,7 @@ const getShopData = (shopId, channel, params, shopInfo) => {
searchApi.getProductList({
viewNum: sknList.length,
query: _.join(_.uniq(sknList), ',')
})
}, 'shop')
];
if (result[3].code === 200 && result[3].data) {
... ... @@ -757,7 +757,7 @@ const getShopGoodsData = (shopId, channel, params) => {
return Promise.all([
searchApi.getProductList(Object.assign({
shop_id: shopId
}, params)), // 搜索店铺商品
}, params), 'shop'), // 搜索店铺商品
searchApi.getSortList({shop_id: shopId}) // 根据店铺id获取分类
]).then(result => {
// 获取商品数据和顶部筛选条件
... ... @@ -793,14 +793,14 @@ const getShopListData = (channel, params, uid) => {
searchApi.getShopDecorator(shopId), // 店铺装修数据
searchApi.getShopInfo(shopId, uid), // 店铺介绍
searchApi.getProductList(Object.assign({shop_id: shopId}, params,
{limit: (params.limit || 60) - 1})), // 搜索店铺商品
{limit: (params.limit || 60) - 1}), 'shop'), // 搜索店铺商品
searchApi.getSortList({shop_id: shopId}) // 店铺分类
];
if (_.has(params, 'query')) {
// 如果有店内搜索,则并行查询店铺所有商品,搜索不到商品则显示所有商品
apiArr.push(searchApi.getProductList(Object.assign({shop_id: shopId},
params, {query: ''}))); // 搜索店铺所有商品
params, {query: ''}), 'shop')); // 搜索店铺所有商品
}
... ...
... ... @@ -554,7 +554,7 @@ exports.getSaleSpecialData = (id, params, channel) => {
}
// 搜索sale活动商品
apiList.push(searchApi.getProductList(condition));
apiList.push(searchApi.getProductList(condition, 'promotion'));
}
return Promise.all(apiList).then(result => {
... ...
... ... @@ -94,7 +94,7 @@ const setSearchData = (result, params, channel) => {
finalResult.criteo = {skn: searchHandler.getCriteo(_.get(finalResult.search, 'goods'))};
}
return finalResult;
}
};
/**
* 转换价格
... ... @@ -135,7 +135,7 @@ exports.getSearchData = (params, channel) => {
let apiMethod = [
headerModel.requestHeaderData(channel),
searchApi.getSortList(Object.assign({}, searchParams, {msort: '', misort: '', sort: ''})),
searchApi.getProductList(searchParams),
searchApi.getProductList(searchParams, 'fuzzySearch'),
searchApi.getShopList(params)
];
... ... @@ -144,10 +144,10 @@ exports.getSearchData = (params, channel) => {
return searchApi.getSortList(Object.assign({}, searchParams, {msort: '',
query: _.get(result, '[2]data.suggestion.terms_suggestion[0]', ''),
misort: '', sort: ''})).then(subRes => {
result[1] = subRes;
result[1] = subRes;
return setSearchData(result, params, channel);
});
return setSearchData(result, params, channel);
});
}
return setSearchData(result, params, channel);
... ... @@ -294,8 +294,8 @@ exports.getSearchLessProduct = (channelNum, uid, udid, page) => {
img: it.default_images ? helpers.image(it.default_images, 180, 240) : '',
alt: it.product_name,
price: '¥' + transPrice(it.sales_price),
marketPrice: transPrice(it.market_price) === transPrice(it.sales_price)
? false : ('¥' + transPrice(it.market_price))
marketPrice: transPrice(it.market_price) === transPrice(it.sales_price) ?
false : ('¥' + transPrice(it.market_price))
};
let firstGoods = it.goods_list && it.goods_list[0];
... ...
... ... @@ -37,7 +37,8 @@ module.exports = {
imSocket: 'ws://socket.yohobuy.com:10240',
imCs: 'http://im.yohobuy.com/api',
platformApi: 'http://172.16.6.210:8088/'
platformApi: 'http://172.16.6.210:8088/',
unionApi: 'http://172.16.6.90:8080/'
},
subDomains: {
host: '.yohobuy.com',
... ... @@ -136,7 +137,8 @@ if (isProduction) {
search: 'http://search.yohoops.org/yohosearch/',
imSocket: 'ws://imsocket.yohobuy.com:10000',
imCs: 'https://imhttp.yohobuy.com/api',
platformApi: 'http://api.platform.yohoops.org'
platformApi: 'http://api.platform.yohoops.org',
unionApi: 'http://union.yoho.cn/'
},
memcache: {
master: ['memcache1.yohoops.org:12111', 'memcache2.yohoops.org:12111', 'memcache3.yohoops.org:12111'],
... ...
... ... @@ -4,6 +4,8 @@
* @date: 2016/6/16
*/
'use strict';
const _ = require('lodash');
const qs = require('querystring');
module.exports = () => {
return (req, res, next) => {
... ... @@ -67,11 +69,19 @@ module.exports = () => {
}
default: // 其它(识别为品牌)
{ // eslint-disable-line
let queryString = (function() {
if (!_.isEmpty(req.query)) {
return '&' + qs.stringify(req.query);
} else {
return '';
}
}());
req.query.domain = req.subdomains[0];
if (!req.path || req.path === '/') {
req.url = `/product/index/brand?domain=${req.subdomains[0]}`;
req.url = `/product/index/brand?domain=${req.subdomains[0]}${queryString}`;
} else if (req.path === '/about') {
req.url = `/product/index/about?domain=${req.subdomains[0]}`;
req.url = `/product/index/brand?domain=${req.subdomains[0]}${queryString}`;
}
break;
}
... ...
{
"name": "yohobuy-node",
"version": "5.5.1",
"version": "5.5.3",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
<table border="1" class="table">
<tr>
<th>渠道Id</th>
<th>渠道名称</th>
<th>激活IOS数</th>
<th>激活安卓数</th>
</tr>
{{#each list}}
<tr>
<td>{{unionType}}</td>
<td>{{unionName}}</td>
<td>{{idfaCount}}</td>
<td>{{imeiCount}}</td>
</tr>
{{/each}}
</table>
\ No newline at end of file
... ...

43.1 KB | W: | H:

42.8 KB | W: | H:

  • 2-up
  • Swipe
  • Onion skin
var $ = require('yoho-jquery');
var tableTmp = require('hbs/3party/activate-tbl.hbs');
var $startTime = $('.start-time');
var $endTime = $('.end-time');
function time() {
var date = new Date(),
year = date.getFullYear(),
month = (date.getMonth() + 1),
day = date.getDate();
month = month < 10 ? '0' + month : month;
day = day < 10 ? '0' + day : day;
return year + '-' + month + '-' + day;
}
function getList(params) {
$.ajax({
url: '/3party/activate-count/getList',
type: 'get',
data: params,
success: function(list) {
$('.table-data').html(tableTmp({list: list}));
}
});
}
$(function() {
var timeData = time();
$startTime.val(timeData);
$endTime.val(timeData);
getList({
startTime: timeData,
endTime: timeData
});
$('.query-btn').on('click', function() {
getList({
startTime: $startTime.val(),
endTime: $endTime.val()
});
});
});
... ...
.activate-count-page {
margin: auto;
font-family: '微软雅黑';
font-size: 14px;
.logo {
width: 171px;
height: 40px;
display: inline-block;
background-image: url(../img/sprite.3party.png);
background-position: 0px 0px;
vertical-align: middle;
margin-right: 10px;
}
input, select {
outline: none;
}
h1 {
font-size: 22px;
margin: 0 0 50px;
text-align: left;
width: 100%;
padding: 20px;
color: #a5a5a5;
box-sizing: border-box;
border-bottom: 1px solid #e2e2e2;
background: #f7f7f7;
}
/* 过滤 */
.line {
width: 90%;
margin: 20px auto;
}
.sel {
width: 173px;
vertical-align: middle;
padding: 9px;
border-radius: 4px;
box-sizing: border-box;
border: 1px solid #d6d6d6;
}
.query-btn {
border-radius: 4px;
background: #20a0ff;
padding: 10px 25px;
color: #fff;
font-size: 14px;
display: inline-block;
cursor: pointer;
vertical-align: middle;
margin-left: 20px;
}
label,
a {
vertical-align: middle;
}
/*表格*/
table {
width: 90%;
margin: 35px auto;
}
table {
table-layout: fixed;
empty-cells: show;
border-collapse: collapse;
img {
width: 80px;
}
}
td {
height: 36px;
}
.table {
border: 1px solid #d6d6d6;
color: #666;
}
.table th {
background-repeat: repeat-x;
height: 30px;
font-weight: bold;
}
.table td,
.table th {
border: 1px solid #d6d6d6;
padding: 5px;
text-align: center;
}
.table tr.alter {
background-color: #f5fafe;
}
}
\ No newline at end of file
... ...
@import "robot-check";
@import "../variables";
@import "material";
@import "activate";
\ No newline at end of file
... ...
... ... @@ -667,7 +667,7 @@
.name {
display: inline-block;
width: 280px;
max-height: 88px;
max-height: 68px;
font-size: 15px;
padding-left: 20px;
line-height: 1.5;
... ... @@ -689,6 +689,24 @@
}
}
.special-limit-7day {
color: #999;
line-height: 1;
position: absolute;
margin-top: -20px;
margin-left: 86px;
&:before {
content: '';
display: inline-block;
width: 16px;
height: 16px;
background: url(/cart/7day-limit.png);
vertical-align: text-bottom;
margin-right: 4px;
}
}
.color-size {
color: #9a9a9a;
... ...