Authored by zhangxiaoru

数据判断 下载

... ... @@ -11,11 +11,13 @@ const _ = require('lodash');
const productProcess = require(`${utils}/product-process`);
const userAcquireStatus = (uid, couponIds) => {
return api.get('', {
method: 'app.coupons.userAcquireStatus',
uid: uid,
couponIds: couponIds
});
if (couponIds != '') {
return api.get('', {
method: 'app.coupons.userAcquireStatus',
uid: uid,
couponIds: couponIds
});
}
};
/**
... ... @@ -24,35 +26,36 @@ const userAcquireStatus = (uid, couponIds) => {
* @returns {*}
*/
const _getRelatedData = (idList) => {
return api.get('', {
productSkn: idList,
method: 'h5.product.batch'
}).then((result) => {
if (idList != '') {
return api.get('', {
productSkn: idList,
method: 'h5.product.batch'
}).then((result) => {
let goods = [],
productList = [];
let goods = [],
productList = [];
if (result && result.data.product_list && result.code === 200) {
if (result && result.data && result.data.product_list && result.code === 200) {
_.forEach(result.data.product_list, function(val) {
_.forEach(result.data.product_list, function(val) {
if (val.student_price) {
productList.push(val);
}
});
if (val.student_price) {
productList.push(val);
}
});
goods = productProcess.processProductList(productList);
goods = productProcess.processProductList(productList);
return goods;
} else {
logger.error('推荐商品 cood 不是 200');
return {};
}
});
return goods;
} else {
return {};
}
});
}
};
exports.index = (req, res, next) => {
let code = '50b995e190ff8cfe52989972a4943b06';
let code = 'c9b9639ce2884b768cfbc5cf9e68a53f';
let uid = req.__USER__.uid;
let options;
let noLoginUrl = helpers.urlFormat('/activity/student/register') + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student-market"}}}';
... ... @@ -62,7 +65,7 @@ exports.index = (req, res, next) => {
platform: 'iphone'
}).then((result) => {
let coupons,
let coupons = {},
activities,
banner,
icons,
... ... @@ -171,24 +174,13 @@ exports.index = (req, res, next) => {
options.loginUrl = '//m.yohobuy.com/activity/student/register';
if (options.isApp) {
if (options.isLogin) {
if (options.isStudent) {
// options.loginUrl = false;
} else {
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
}
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.h5","params":{"islogin":"N","url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register"}}';
} else {
// no login
options.loginUrl = options.loginUrl + '?openby:yohobuy={"action":"go.weblogin","params":{"jumpurl":{"url":"' + req.__USER__.http + '//m.yohobuy.com/activity/student/register","antarget":"1"}}}';
}
} else {
if (options.isLogin) {
if (options.isStudent) {
// options.loginUrl = false;
}
}
}
}
// console.log(options);
res.render('student-market', options);
}).catch(next);
... ...
... ... @@ -491,16 +491,10 @@ $('#float-layer-close').on('touchend', function() {
if ($('#float-layer-btn') && $('#float-layer-btn')[0]) {
var floatLayerBtnHammer = new Hammer($('#float-layer-btn')[0]);
var unionType = window.queryString.union_type || 367;
floatLayerBtnHammer.on('tap', function(e) {
var downUrl = 'http://union.yoho.cn/union/downapp.html?union_type=367';
window.downLoadApp(downUrl);
window.downLoadApp(unionType);
e.srcEvent.stopPropagation();
});
if (typeof window.cookie === 'function' && !window.cookie('_float-layer-app')) {
$('#float-layer-app').show();
} else {
$('#float-layer-app').hide();
}
}
... ...
... ... @@ -308,12 +308,12 @@ if ($footer.find('.user-name').text().length === 11) {
}
// 浮层下载APP
function downLoadApp(downUrl) {
var appUrl = downUrl || 'http://union.yoho.cn/union/downapp.html';
function downLoadApp(unionType) {
var appUrl ='http://union.yoho.cn/union/downapp.html';
var clickedAt = new Date();
setTimeout(function() {
var mkt = queryString().union_type || cookie('unionTypeYas') || false;
var mkt = unionType || queryString().union_type || cookie('unionTypeYas') || false;
if ((new Date()) - clickedAt < 2000) {
if (mkt) {
... ...
... ... @@ -11,7 +11,7 @@
font-size: 20px;
width: 110px;
height: 48px;
line-height: 52px;
line-height: 51px;
color: #fff;
background-color: #d10922;
border-radius: 20px;
... ...