Authored by ccbikai(👎🏻🍜)

Merge branch 'release/5.1' 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,
... ... @@ -1785,7 +1785,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
// 限购商品有关的展示状态
let showStatus = 1;
origin.showStatus && (showStatus = parseInt(result.data.showStatus, 10));
// 处理限购商品有关的按钮状态
dest = _procShowStatus(dest, showStatus, isBeginSale);
... ...
... ... @@ -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',
... ...
... ... @@ -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 {
... ...
... ... @@ -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://', '//');
... ...