Authored by htoooth

merge master

... ... @@ -742,7 +742,9 @@ const _formatParams = (channel, data) => {
return searchApi.get('/search.json', params).then(result => {
let ret = result.data;
ret.channel = channel;
if (ret) {
ret.channel = channel;
}
return ret;
});
... ...
... ... @@ -12,7 +12,16 @@ const helpers = global.yoho.helpers;
exports.QRcode = (req, res, next) => {
let id = req.query.orderCode || 0;
QRcodeModel.getQRcodeData(id, req.user.uid).then((result)=>{
let bg={
'16-1':'//img13.static.yhbimg.com/yhb-img02/2016/08/04/14/02004edaf02b52363c27cea0e2cbbe9b59.jpg',
'17-1':'//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/023d0470ffc2b0efe89bfdd1c6b73ab894.jpg',
'16-2':'//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02fcb3d6cdd6be244c836c520a0d034fed.jpg',
'17-2':'//img12.static.yhbimg.com/yhb-img02/2016/08/04/14/02ed77b564211c3246ab7be81794ed17cd.jpg'
}
let bgkey='16-1',ticktypeName='展览票';
QRcodeModel.getQRcodeData(id,req.user.uid).then((result)=>{
if (result) {
result.ticks = result.ticks.map(item=>{
if (+item.ticket_type === 2) {
... ... @@ -20,12 +29,18 @@ exports.QRcode = (req, res, next) => {
}
return item;
});
if(result.ticks.length){
bgkey=[/月(\d+)/g.exec(result.ticks[0].entrance_time)[1],result.ticks[0].ticket_type].join('-');
ticktypeName=result.ticks[0].ticket_type==='2'?'套票':'展览票';
}
}
let vm = {
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'}, {name: '查看二维码'}],
path: [{href: helpers.urlFormat('/'), name: 'YOHO!BUY 有货首页'}, {name: '个人中心'},{name: '订单中心'}, {name: '查看二维码'}],
qrcodeData: result,
code: id,
bgsrc:bg[bgkey],
ticktypeName:ticktypeName,
returnOrder: helpers.urlFormat('/home/orders')
};
... ...
... ... @@ -262,7 +262,7 @@ const sina = {
log.error(`sina authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
let nickname = user.screen_name;
let nickname = _.trim(user.screen_name);
let openId = user.id;
doPassportCallback(req, res, {
... ... @@ -292,7 +292,7 @@ const qq = {
log.error(`qq authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
let nickname = user.nickname;
let nickname = _.trim(user.nickname);
let openId = user.id;
doPassportCallback(req, res, {
... ... @@ -317,7 +317,7 @@ const alipay = {
log.error(`alipay authenticate error : ${JSON.stringify(err)}`);
return res.redirect(loginPage);
}
let nickname = user.realName;
let nickname = _.trim(user.realName);
let openId = user.userId;
doPassportCallback(req, res, {
... ... @@ -344,7 +344,7 @@ const douban = {
return res.redirect(loginPage);
}
let nickname = user.displayName;
let nickname = _.trim(user.displayName);
let openId = user.id;
doPassportCallback(req, res, {
... ... @@ -371,7 +371,7 @@ const renren = {
return res.redirect(loginPage);
}
let nickname = user.displayName;
let nickname = _.trim(user.displayName);
let openId = user.id;
doPassportCallback(req, res, {
... ...
... ... @@ -37,7 +37,6 @@ const discountSplit = (text) => {
i;
text = text || '';
for (i = 0; i < text.length; i++) {
if (/^([0-9]|\%)*$/.test(text[i])) {
endNum = i + 1;
... ...
... ... @@ -52,6 +52,7 @@ module.exports = {
handleExceptions: true
},
udp: { // send by udp
measurement: 'yohobuy_node_log',
level: 'debug', // logger level
host: 'influxdblog.yohoops.org', // influxdb host
port: '4444' // influxdb port
... ...
{
"name": "yohobuy-node",
"version": "4.8.15",
"version": "4.8.17",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ... @@ -59,7 +59,7 @@
"uuid": "^2.0.2",
"winston": "^2.2.0",
"winston-daily-rotate-file": "^1.1.4",
"yoho-node-lib": "0.0.32"
"yoho-node-lib": "0.0.31"
},
"devDependencies": {
"autoprefixer": "^6.3.6",
... ...