Authored by 周奇琪

Merge branch 'grey' of git.yoho.cn:fe/yohobuywap-node into grey

... ... @@ -75,10 +75,12 @@ const getDetailData = (req, res, next) => {
let userAgent = req.get('User-Agent');
let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
if (req.yoho.isApp) {
uid = crypto.encryption('', req.query.uid + '');
} else {
uid = req.user.uid;
if (uid) {
if (isApp) {
uid = crypto.encryption('', req.query.uid + '');
} else {
uid = req.user.uid;
}
}
if (clientType.toLowerCase() === 'ios' && version) {
... ... @@ -97,7 +99,7 @@ const getDetailData = (req, res, next) => {
page: 'plustar-detail',
title: result.brandName,
pageHeader: headerModel.setNav({
navTitle: result.brandName
navTitle: result.brand_name
}),
ps: result
});
... ...
... ... @@ -334,8 +334,8 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
shareTitle: list.brandName,
shareImg: list.brandIco,
shareDesc: htmlProcess.removeHtml(list.brandIntro)
shareDesc: htmlProcess.removeHtml(list.brandIntro),
clientType: clientType
});
return list;
... ...
... ... @@ -98,7 +98,7 @@
</div>
<input id="jump-to-app" type="hidden" value="{{jumpToApp}}">
<input id="brandId" type="hidden" value="{{brandId}}">
<input id="brandId" type="hidden" value="{{brand_id}}">
<input id="clientType" type="hidden" value="{{clientType}}">
{{!-- wx-share --}}
... ...
... ... @@ -1268,7 +1268,7 @@ const _detailDataPkg = (origin, ua) => {
// colorStorageNum = 0;
// pagecache重构
_.forEach(origin.goods_list, function(value) {
if (value.status === 0) {
if (value.status === 0 && !origin.isLimitBuy) {
return;
}
... ... @@ -1749,7 +1749,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
};
// 显示加入购物车链接
if (!soldOut && !notForSale) {
if (!soldOut && !notForSale || origin.isLimitBuy) {
_.orderBy(colorGroup);
Object.assign(dest.cartInfo, {
productId: origin.product_id,
... ...
... ... @@ -16,15 +16,15 @@ module.exports = {
siteUrl: '//m.yohobuy.com',
assetUrl: '//localhost:5001',
domains: {
api: 'http://api-test3.yohops.com:9999/',
service: 'http://service-test3.yohops.com:9999/',
liveApi: 'http://testapi.live.yohops.com:9999/',
singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://api-test3.yohops.com:9999/',
// service: 'http://service-test3.yohops.com:9999/',
// liveApi: 'http://testapi.live.yohops.com:9999/',
// singleApi: 'http://api-test3.yohops.com:9999/'
// api: 'http://api.yoho.cn/',
// service: 'http://service.yoho.cn/',
// liveApi: 'http://api.live.yoho.cn/',
// singleApi: 'http://single.yoho.cn/'
api: 'http://api.yoho.cn/',
service: 'http://service.yoho.cn/',
liveApi: 'http://api.live.yoho.cn/',
singleApi: 'http://single.yoho.cn/'
},
subDomains: {
host: '.m.yohobuy.com',
... ...
... ... @@ -261,7 +261,7 @@ setTimeout(function() {
ACTION_ID: 0,
SORT_TYPE: 4,
REC_ID: uuid(40) + '0000'
}),
})
}, true);
}
if ($('.s-verify-fail').size()) {
... ... @@ -272,8 +272,8 @@ setTimeout(function() {
C_ID: C_ID,
SRC_ID: 5,
ATTCT_RES: 2,
FAILURE_CAUSE: $('.s-verify-fail').attr('prompt'),
}),
FAILURE_CAUSE: $('.s-verify-fail').attr('prompt')
})
}, true);
}
} else if ($('.s-verify-success').size()) {
... ... @@ -285,8 +285,8 @@ setTimeout(function() {
SRC_ID: 5,
ATTCT_RES: 1,
FAILURE_CAUSE: '',
ATTCT_INFO: '{{info}}',
}).replace('{{info}}', localStorage.STUDENTCOOKIES),
ATTCT_INFO: JSON.parse(localStorage.STUDENTCOOKIES)
})
}, true);
}
} else {
... ... @@ -323,7 +323,7 @@ $('.swiper-slide', '.banner-top').click(function() {
F_URL: encodeURIComponent(url),
F_INDEX: 1,
I_INDEX: index
}),
})
};
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(options, true);
... ... @@ -342,23 +342,23 @@ $('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function()
's-activity': {
fname: '学生专属活动',
findex: 4,
iindex: index,
iindex: index
},
'more iconfont': {
fname: '领券中心',
findex: 3,
iindex: 0,
iindex: 0
},
'main-left': {
fname: '领券中心',
findex: 3,
iindex: $(this).parent().parent().index(),
iindex: $(this).parent().parent().index()
},
'more s-quan': {
fname: '学生权益',
findex: 2,
iindex: 0,
},
iindex: 0
}
}[$(this).attr('class')];
options = {
... ... @@ -369,8 +369,8 @@ $('.s-activity, .main-left, .s-quan, .iconfont', '.s-section').click(function()
F_NAME: obj.fname,
F_URL: encodeURIComponent(url),
F_INDEX: obj.findex,
I_INDEX: obj.iindex,
}),
I_INDEX: obj.iindex
})
};
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(options, true);
... ... @@ -391,7 +391,7 @@ $('.good-info', '.goods-list').click(function() {
PRD_ID: goodid,
ACTION_ID: 1,
REC_ID: uuid(40) + '0000'
}),
})
};
if (window._yas && window._yas.sendCustomInfo) {
window._yas.sendCustomInfo(options, true);
... ... @@ -403,7 +403,7 @@ $('.s-renzhen').click(function() {
param: JSON.stringify({
C_ID: C_ID,
SRC_ID: 1
}),
})
};
if (window._yas && window._yas.sendCustomInfo) {
... ... @@ -414,18 +414,18 @@ $('.s-renzhen').click(function() {
$('.dialog-wrapper').addClass('s-dialog-wrapper');
$('.s-dialog').on('click', function() {
var text = [{
dialogText: '<h2>权益1: 新品立享9折</h2><p>1、学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受</p>',
dialogText: '<h2>权益1: 新品立享9折</h2><p>1、学生购买指定原价新品时,可立即享受9折优惠,与VIP折扣不可同时享受</p>'
}, {
dialogText: '<h2>权益2: 每1元返1个有货币</h2><p>1、学生购买指定商品时,以商品的实际成交金额计算,每1元返1个有货币;</p>' +
'<p>2、返有货币时间:确认收货7日后,系统将自动将对应数量的有货币返至购买账户;</p>' +
'<p>3、有货币有效期:获得当日至次年12月31日,逾期自动作废;</p>' +
'<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>',
'<p>4、查看有货币:登录后,点击“个人中心”在“我的有货币”中可以查看有货币余额及明细。</p>'
}, {
dialogText: '<h2>权益3: 免单抽奖</h2><p>1、每月将在累计购物金额最高的学校中,抽取3名幸运学生用户,获得免单资格;</p>' +
'<p>2、免单用户名单将在每月第1个工作日公布在有货微信公众号上,可关注【有货YOHOBUY】;</p>' +
'<p>3、免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p>',
'<p>3、免单用户将在中奖次日获得与实付金额等额的现金券,使用时间:中奖当月。</p>'
}, {
dialogText: '<h2>权益4: 学生专享活动</h2><p>1、每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>',
dialogText: '<h2>权益4: 学生专享活动</h2><p>1、每月不定期的开展学生专享活动,可打开有货APP推送,及时查收学生专享活动通知。</p>'
}];
var dialogBoxHammer, dialogRightBtn;
... ... @@ -438,28 +438,28 @@ $('.s-dialog').on('click', function() {
}, function() {
$('body').css({
overflow: '',
position: '',
position: ''
});
dialog.hideDialog();
}, undefined, true);
$('.dialog-content').css({
padding: '0 1.5rem 1rem 1.5rem',
padding: '0 1.5rem 1rem 1.5rem'
});
$('.dialog-box').css({
'border-radius': '0.25rem',
background: '#fff',
background: '#fff'
});
$('.dialog-right-btn').css({
border: 'none',
color: '#d0021b',
color: '#d0021b'
});
$('body').css({
overflow: 'hidden',
position: 'fixed',
position: 'fixed'
});
dialogBoxHammer = new Hammer(document.getElementsByClassName('dialog-box')[0]);
... ... @@ -472,7 +472,7 @@ $('.s-dialog').on('click', function() {
dialogRightBtn.on('tap', function(event) {
$('body').css({
overflow: '',
position: '',
position: ''
});
dialog.hideDialog();
event.preventDefault();
... ... @@ -480,4 +480,4 @@ $('.s-dialog').on('click', function() {
});
$('.dialog-content').addClass('s-dialog-content');
});
\ No newline at end of file
});
... ...
... ... @@ -41,11 +41,11 @@ $('#nav-tab').on('touchend touchcancel', function(e) {
$(document).trigger('scroll'); // Trigger lazyLoad
});
if ($('#nav-tab').find('li:eq(0)').hasClass('focus')) {
// 解决li隐藏 swiper不渲染的问题
$('#nav-tab').find('li:eq(0)').removeClass('focus');
$('#nav-tab').find('li:eq(0)').trigger('touchend');
}
// if ($('#nav-tab').find('li:eq(0)').hasClass('focus')) {
// // 解决li隐藏 swiper不渲染的问题
// $('#nav-tab').find('li:eq(0)').removeClass('focus');
// $('#nav-tab').find('li:eq(0)').trigger('touchend');
// }
$('#nav-tab').on('touchstart', function(e) {
var target = e.target || e.srcElement;
... ...
... ... @@ -107,15 +107,15 @@ function render(data) {
if (data.cartInfo.limitNotForSale) {
$('#limitNotForSale').removeClass(dbClass);
}
if (data.cartInfo.limitNotForSale) {
$('#limitNotForSale').removeClass(dbClass);
}
if (data.cartInfo.canBuyLimit) {
$('.can-buy-limit').removeClass(dbClass);
}
if (data.cartInfo.noLimitCode) {
$('#noLimitCode').removeClass(dbClass);
}
if (data.cartInfo.canNotBuy) {
$('#noLimitCode').removeClass(dbClass);
}
$('.cart-bar').removeClass('data-bind');
$('#limitCodeUrl').val(data.cartInfo.limitCodeUrl);
$('#limitProductPay').val(data.cartInfo.limitProductPay);
... ...
... ... @@ -110,7 +110,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr
// 编辑人员 app跳转url处理 20160601
let isLogin = uid ? true : false;
articleData.author.url = `${helpers.https(articleData.author.url)}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${articleData.author.author_id}"},"share":"","id":${articleData.author.author_id},"type":0,"islogin":"${isLogin} ","url":"https:${helpers.urlFormat('/author/index', {uid: uid}, 'guang')} "}}&uid=${uid}`;
articleData.author.url = `${helpers.https(articleData.author.url)}&openby:yohobuy={"action":"go.h5","params":{"param":{"id":"${articleData.author.author_id}"},"share":"","id":${articleData.author.author_id},"type":0,"islogin":"${isLogin}","url":"https:${helpers.urlFormat('/author/index', {uid: uid}, 'guang')} "}}&uid=${uid}`;
result.author = articleData.author;
if (result.author.avatar) {
result.author.avatar = result.author.avatar.replace('http://', '//');
... ...