Authored by 陈峰

Merge branch 'master' into 'release/6.9.0'

Master



See merge request !1729
@@ -189,7 +189,8 @@ const newDetail = { @@ -189,7 +189,8 @@ const newDetail = {
189 ua: req.get('user-agent') || '', 189 ua: req.get('user-agent') || '',
190 from: req.query.from, 190 from: req.query.from,
191 closeBuyNowButton: closeBuyNowButton, 191 closeBuyNowButton: closeBuyNowButton,
192 - removeCartCount: _.get(req.app.locals, 'wap.common.removeCartCount') 192 + removeCartCount: _.get(req.app.locals, 'wap.common.removeCartCount'),
  193 + unionType: req.query.union_type || req.cookies.unionTypeYas || ''
193 }, req.__User__)).then((result) => { 194 }, req.__User__)).then((result) => {
194 if (_.isEmpty(result)) { 195 if (_.isEmpty(result)) {
195 return res.json({ 196 return res.json({
@@ -128,20 +128,8 @@ module.exports = class extends global.yoho.BaseModel { @@ -128,20 +128,8 @@ module.exports = class extends global.yoho.BaseModel {
128 * @param {string} skn 限购商品skn 128 * @param {string} skn 限购商品skn
129 * @return {string} 限购商品跳转url 129 * @return {string} 限购商品跳转url
130 */ 130 */
131 - _getLimitCodeUrl(productCode, skn, ua) {  
132 - let url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +  
133 - '&product_skn=' + skn;  
134 -  
135 - let isIphone = String(ua).indexOf('iPhone') >= 0;  
136 - let isIpad = ua.indexOf('iPad') >= 0;  
137 -  
138 - if (isIphone || isIpad) {  
139 - let params = {};  
140 -  
141 - params.lp = productCode;  
142 - url = 'yohobuy://' + helpers.urlFormat('/limitpurchase', params);  
143 - }  
144 - return url; 131 + _getLimitCodeUrl(productCode, skn, ua, unionType) {
  132 + return `yohobuy://yohobuy.com/goapp?${unionType ? `ct=${unionType}` : ''}&openby:yohobuy={"action":"go.limitpurchase","params":{"lp":"${productCode}"}}`;
145 } 133 }
146 134
147 _getShopsInfo(brandId) { 135 _getShopsInfo(brandId) {
@@ -461,7 +449,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -461,7 +449,7 @@ module.exports = class extends global.yoho.BaseModel {
461 /** 449 /**
462 * [商品信息格式化异步接口] 450 * [商品信息格式化异步接口]
463 */ 451 */
464 - _detailDataPkgAsync(origin, uid, vipLevel, ua) { 452 + _detailDataPkgAsync(origin, uid, vipLevel, ua, unionType) {
465 let dest = {}; // 结果输出 453 let dest = {}; // 结果输出
466 454
467 // 用户未登录时 455 // 用户未登录时
@@ -623,7 +611,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -623,7 +611,7 @@ module.exports = class extends global.yoho.BaseModel {
623 dest = this._procShowStatus(dest, showStatus, isBeginSale); 611 dest = this._procShowStatus(dest, showStatus, isBeginSale);
624 612
625 dest.cartInfo.limitProductCode = origin.limitProductCode; 613 dest.cartInfo.limitProductCode = origin.limitProductCode;
626 - dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua); // eslint-disable-line 614 + dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua, unionType); // eslint-disable-line
627 dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure'); 615 dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure');
628 return resolve(dest); 616 return resolve(dest);
629 } else { 617 } else {
@@ -733,7 +721,7 @@ module.exports = class extends global.yoho.BaseModel { @@ -733,7 +721,7 @@ module.exports = class extends global.yoho.BaseModel {
733 this._detailDataPkgAsync(_.assign(result, { 721 this._detailDataPkgAsync(_.assign(result, {
734 from: data.from, 722 from: data.from,
735 closeBuyNowButton: data.closeBuyNowButton 723 closeBuyNowButton: data.closeBuyNowButton
736 - }), data.uid, data.vipLevel, data.ua), 724 + }), data.uid, data.vipLevel, data.ua, data.unionType),
737 this._getFavorite(result.product_id, data.uid) 725 this._getFavorite(result.product_id, data.uid)
738 ]; 726 ];
739 727
1 { 1 {
2 "name": "yohobuywap-node", 2 "name": "yohobuywap-node",
3 - "version": "6.8.9-2", 3 + "version": "6.8.9-3",
4 "private": true, 4 "private": true,
5 "description": "A New Yohobuy Project With Express", 5 "description": "A New Yohobuy Project With Express",
6 "repository": { 6 "repository": {
@@ -308,11 +308,10 @@ setTimeout(() => { @@ -308,11 +308,10 @@ setTimeout(() => {
308 time = Date.now(); 308 time = Date.now();
309 window.setTimeout(function() { 309 window.setTimeout(function() {
310 document.body.removeChild(ifr); 310 document.body.removeChild(ifr);
311 - if (Date.now() - time < 3200) { 311 + if (Date.now() - time < 1200) {
312 window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho'; 312 window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho';
313 } 313 }
314 - }, 3000);  
315 - 314 + }, 1000);
316 }, null, true); 315 }, null, true);
317 316
318 $('.dialog-wrapper').off('touchstart').on('touchstart', function(para) { 317 $('.dialog-wrapper').off('touchstart').on('touchstart', function(para) {