Authored by ccbikai(👎🏻🍜)

Merge branch 'release/5.1' into grey

@@ -75,11 +75,13 @@ const getDetailData = (req, res, next) => { @@ -75,11 +75,13 @@ const getDetailData = (req, res, next) => {
75 let userAgent = req.get('User-Agent'); 75 let userAgent = req.get('User-Agent');
76 let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问 76 let isWeixin = userAgent.includes('MicroMessenger'); // 标识是否是微信访问
77 77
78 - if (req.yoho.isApp) { 78 + if (uid) {
  79 + if (isApp) {
79 uid = crypto.encryption('', req.query.uid + ''); 80 uid = crypto.encryption('', req.query.uid + '');
80 } else { 81 } else {
81 uid = req.user.uid; 82 uid = req.user.uid;
82 } 83 }
  84 + }
83 85
84 if (clientType.toLowerCase() === 'ios' && version) { 86 if (clientType.toLowerCase() === 'ios' && version) {
85 clientType = 'iphone'; 87 clientType = 'iphone';
@@ -97,7 +99,7 @@ const getDetailData = (req, res, next) => { @@ -97,7 +99,7 @@ const getDetailData = (req, res, next) => {
97 page: 'plustar-detail', 99 page: 'plustar-detail',
98 title: result.brandName, 100 title: result.brandName,
99 pageHeader: headerModel.setNav({ 101 pageHeader: headerModel.setNav({
100 - navTitle: result.brandName 102 + navTitle: result.brand_name
101 }), 103 }),
102 ps: result 104 ps: result
103 }); 105 });
@@ -334,8 +334,8 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => { @@ -334,8 +334,8 @@ const getDetailData = (id, uid, udid, gender, isApp, clientType) => {
334 shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id, 334 shareLink: '//guang.m.yohobuy.com/plustar/brandinfo?id=' + id,
335 shareTitle: list.brandName, 335 shareTitle: list.brandName,
336 shareImg: list.brandIco, 336 shareImg: list.brandIco,
337 - shareDesc: htmlProcess.removeHtml(list.brandIntro)  
338 - 337 + shareDesc: htmlProcess.removeHtml(list.brandIntro),
  338 + clientType: clientType
339 }); 339 });
340 340
341 return list; 341 return list;
@@ -98,7 +98,7 @@ @@ -98,7 +98,7 @@
98 </div> 98 </div>
99 99
100 <input id="jump-to-app" type="hidden" value="{{jumpToApp}}"> 100 <input id="jump-to-app" type="hidden" value="{{jumpToApp}}">
101 - <input id="brandId" type="hidden" value="{{brandId}}"> 101 + <input id="brandId" type="hidden" value="{{brand_id}}">
102 <input id="clientType" type="hidden" value="{{clientType}}"> 102 <input id="clientType" type="hidden" value="{{clientType}}">
103 103
104 {{!-- wx-share --}} 104 {{!-- wx-share --}}
@@ -1268,7 +1268,7 @@ const _detailDataPkg = (origin, ua) => { @@ -1268,7 +1268,7 @@ const _detailDataPkg = (origin, ua) => {
1268 // colorStorageNum = 0; 1268 // colorStorageNum = 0;
1269 // pagecache重构 1269 // pagecache重构
1270 _.forEach(origin.goods_list, function(value) { 1270 _.forEach(origin.goods_list, function(value) {
1271 - if (value.status === 0) { 1271 + if (value.status === 0 && !origin.isLimitBuy) {
1272 return; 1272 return;
1273 } 1273 }
1274 1274
@@ -1749,7 +1749,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => { @@ -1749,7 +1749,7 @@ let _detailDataPkgAsync = (origin, uid, vipLevel, ua) => {
1749 }; 1749 };
1750 1750
1751 // 显示加入购物车链接 1751 // 显示加入购物车链接
1752 - if (!soldOut && !notForSale) { 1752 + if (!soldOut && !notForSale || origin.isLimitBuy) {
1753 _.orderBy(colorGroup); 1753 _.orderBy(colorGroup);
1754 Object.assign(dest.cartInfo, { 1754 Object.assign(dest.cartInfo, {
1755 productId: origin.product_id, 1755 productId: origin.product_id,
@@ -16,15 +16,15 @@ module.exports = { @@ -16,15 +16,15 @@ module.exports = {
16 siteUrl: '//m.yohobuy.com', 16 siteUrl: '//m.yohobuy.com',
17 assetUrl: '//localhost:5001', 17 assetUrl: '//localhost:5001',
18 domains: { 18 domains: {
19 - api: 'http://api-test3.yohops.com:9999/',  
20 - service: 'http://service-test3.yohops.com:9999/',  
21 - liveApi: 'http://testapi.live.yohops.com:9999/',  
22 - singleApi: 'http://api-test3.yohops.com:9999/' 19 + // api: 'http://api-test3.yohops.com:9999/',
  20 + // service: 'http://service-test3.yohops.com:9999/',
  21 + // liveApi: 'http://testapi.live.yohops.com:9999/',
  22 + // singleApi: 'http://api-test3.yohops.com:9999/'
23 23
24 - // api: 'http://api.yoho.cn/',  
25 - // service: 'http://service.yoho.cn/',  
26 - // liveApi: 'http://api.live.yoho.cn/',  
27 - // singleApi: 'http://single.yoho.cn/' 24 + api: 'http://api.yoho.cn/',
  25 + service: 'http://service.yoho.cn/',
  26 + liveApi: 'http://api.live.yoho.cn/',
  27 + singleApi: 'http://single.yoho.cn/'
28 }, 28 },
29 subDomains: { 29 subDomains: {
30 host: '.m.yohobuy.com', 30 host: '.m.yohobuy.com',
@@ -285,8 +285,8 @@ setTimeout(function() { @@ -285,8 +285,8 @@ setTimeout(function() {
285 SRC_ID: 5, 285 SRC_ID: 5,
286 ATTCT_RES: 1, 286 ATTCT_RES: 1,
287 FAILURE_CAUSE: '', 287 FAILURE_CAUSE: '',
288 - ATTCT_INFO: '{{info}}',  
289 - }).replace('{{info}}', localStorage.STUDENTCOOKIES), 288 + ATTCT_INFO: JSON.parse(localStorage.STUDENTCOOKIES),
  289 + }),
290 }, true); 290 }, true);
291 } 291 }
292 } else { 292 } else {
@@ -41,11 +41,11 @@ $('#nav-tab').on('touchend touchcancel', function(e) { @@ -41,11 +41,11 @@ $('#nav-tab').on('touchend touchcancel', function(e) {
41 $(document).trigger('scroll'); // Trigger lazyLoad 41 $(document).trigger('scroll'); // Trigger lazyLoad
42 }); 42 });
43 43
44 -if ($('#nav-tab').find('li:eq(0)').hasClass('focus')) {  
45 - // 解决li隐藏 swiper不渲染的问题  
46 - $('#nav-tab').find('li:eq(0)').removeClass('focus');  
47 - $('#nav-tab').find('li:eq(0)').trigger('touchend');  
48 -} 44 +// if ($('#nav-tab').find('li:eq(0)').hasClass('focus')) {
  45 +// // 解决li隐藏 swiper不渲染的问题
  46 +// $('#nav-tab').find('li:eq(0)').removeClass('focus');
  47 +// $('#nav-tab').find('li:eq(0)').trigger('touchend');
  48 +// }
49 49
50 $('#nav-tab').on('touchstart', function(e) { 50 $('#nav-tab').on('touchstart', function(e) {
51 var target = e.target || e.srcElement; 51 var target = e.target || e.srcElement;
@@ -107,15 +107,15 @@ function render(data) { @@ -107,15 +107,15 @@ function render(data) {
107 if (data.cartInfo.limitNotForSale) { 107 if (data.cartInfo.limitNotForSale) {
108 $('#limitNotForSale').removeClass(dbClass); 108 $('#limitNotForSale').removeClass(dbClass);
109 } 109 }
110 - if (data.cartInfo.limitNotForSale) {  
111 - $('#limitNotForSale').removeClass(dbClass);  
112 - }  
113 if (data.cartInfo.canBuyLimit) { 110 if (data.cartInfo.canBuyLimit) {
114 $('.can-buy-limit').removeClass(dbClass); 111 $('.can-buy-limit').removeClass(dbClass);
115 } 112 }
116 if (data.cartInfo.noLimitCode) { 113 if (data.cartInfo.noLimitCode) {
117 $('#noLimitCode').removeClass(dbClass); 114 $('#noLimitCode').removeClass(dbClass);
118 } 115 }
  116 + if (data.cartInfo.canNotBuy) {
  117 + $('#noLimitCode').removeClass(dbClass);
  118 + }
119 $('.cart-bar').removeClass('data-bind'); 119 $('.cart-bar').removeClass('data-bind');
120 $('#limitCodeUrl').val(data.cartInfo.limitCodeUrl); 120 $('#limitCodeUrl').val(data.cartInfo.limitCodeUrl);
121 $('#limitProductPay').val(data.cartInfo.limitProductPay); 121 $('#limitProductPay').val(data.cartInfo.limitProductPay);
@@ -110,7 +110,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr @@ -110,7 +110,7 @@ const formatArticle = (articleData, showTag, isApp, showAuthor, uid, reqQueryStr
110 // 编辑人员 app跳转url处理 20160601 110 // 编辑人员 app跳转url处理 20160601
111 let isLogin = uid ? true : false; 111 let isLogin = uid ? true : false;
112 112
113 - 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}`; 113 + 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}`;
114 result.author = articleData.author; 114 result.author = articleData.author;
115 if (result.author.avatar) { 115 if (result.author.avatar) {
116 result.author.avatar = result.author.avatar.replace('http://', '//'); 116 result.author.avatar = result.author.avatar.replace('http://', '//');