Authored by 陈峰

Merge branch 'hotfix/limitcode' into 'master'

fix limitcode open app



See merge request !1728
... ... @@ -189,7 +189,8 @@ const newDetail = {
ua: req.get('user-agent') || '',
from: req.query.from,
closeBuyNowButton: closeBuyNowButton,
removeCartCount: _.get(req.app.locals, 'wap.common.removeCartCount')
removeCartCount: _.get(req.app.locals, 'wap.common.removeCartCount'),
unionType: req.query.union_type || req.cookies.unionTypeYas || ''
}, req.__User__)).then((result) => {
if (_.isEmpty(result)) {
return res.json({
... ...
... ... @@ -128,20 +128,8 @@ module.exports = class extends global.yoho.BaseModel {
* @param {string} skn 限购商品skn
* @return {string} 限购商品跳转url
*/
_getLimitCodeUrl(productCode, skn, ua) {
let url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +
'&product_skn=' + skn;
let isIphone = String(ua).indexOf('iPhone') >= 0;
let isIpad = ua.indexOf('iPad') >= 0;
if (isIphone || isIpad) {
let params = {};
params.lp = productCode;
url = 'yohobuy://' + helpers.urlFormat('/limitpurchase', params);
}
return url;
_getLimitCodeUrl(productCode, skn, ua, unionType) {
return `yohobuy://yohobuy.com/goapp?${unionType ? `ct=${unionType}` : ''}&openby:yohobuy={"action":"go.limitpurchase","params":{"lp":"${productCode}"}}`;
}
_getShopsInfo(brandId) {
... ... @@ -461,7 +449,7 @@ module.exports = class extends global.yoho.BaseModel {
/**
* [商品信息格式化异步接口]
*/
_detailDataPkgAsync(origin, uid, vipLevel, ua) {
_detailDataPkgAsync(origin, uid, vipLevel, ua, unionType) {
let dest = {}; // 结果输出
// 用户未登录时
... ... @@ -623,7 +611,7 @@ module.exports = class extends global.yoho.BaseModel {
dest = this._procShowStatus(dest, showStatus, isBeginSale);
dest.cartInfo.limitProductCode = origin.limitProductCode;
dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua); // eslint-disable-line
dest.cartInfo.limitCodeUrl = this._getLimitCodeUrl(origin.limitProductCode, origin.product_skn, ua, unionType); // eslint-disable-line
dest.cartInfo.limitProductPay = helpers.urlFormat('/cart/index/orderEnsure');
return resolve(dest);
} else {
... ... @@ -733,7 +721,7 @@ module.exports = class extends global.yoho.BaseModel {
this._detailDataPkgAsync(_.assign(result, {
from: data.from,
closeBuyNowButton: data.closeBuyNowButton
}), data.uid, data.vipLevel, data.ua),
}), data.uid, data.vipLevel, data.ua, data.unionType),
this._getFavorite(result.product_id, data.uid)
];
... ...
{
"name": "yohobuywap-node",
"version": "6.8.9-2",
"version": "6.8.9-3",
"private": true,
"description": "A New Yohobuy Project With Express",
"repository": {
... ...
... ... @@ -308,11 +308,10 @@ setTimeout(() => {
time = Date.now();
window.setTimeout(function() {
document.body.removeChild(ifr);
if (Date.now() - time < 3200) {
if (Date.now() - time < 1200) {
window.location.href = 'http://a.app.qq.com/o/simple.jsp?pkgname=com.yoho';
}
}, 3000);
}, 1000);
}, null, true);
$('.dialog-wrapper').off('touchstart').on('touchstart', function(para) {
... ...