Authored by 郭成尧

ua判断

@@ -99,8 +99,18 @@ const procShowStatus = (data, showStatus, isBeginSale) => { @@ -99,8 +99,18 @@ const procShowStatus = (data, showStatus, isBeginSale) => {
99 * @return {[string]} 限购商品跳转url 99 * @return {[string]} 限购商品跳转url
100 */ 100 */
101 const getLimitCodeUrl = (productCode, skn, ua) => { 101 const getLimitCodeUrl = (productCode, skn, ua) => {
102 - var url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode + '&product_skn=' + skn; 102 + var url = 'yohoapp://yoho.app/openwith?limit_product_code=' + productCode +
  103 + '&product_skn=' + skn;
103 104
  105 + let isIphone = String(ua).indexOf('iPhone') >= 0;
  106 + let isIpad = ua.indexOf('iPad') >= 0;
  107 +
  108 + if (isIphone || isIpad) {
  109 + let params = {};
  110 +
  111 + params.lp = productCode;
  112 + url = 'yohobuy://' + helpers.url('/limitpurchase', params);
  113 + }
104 return url; 114 return url;
105 }; 115 };
106 116
@@ -460,7 +470,6 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => { @@ -460,7 +470,6 @@ const detailDataPkg = (origin, uid, vipLevel, ua) => {
460 470
461 // 处理限购商品有关的按钮状态 471 // 处理限购商品有关的按钮状态
462 dest = procShowStatus(dest, showStatus, isBeginSale); 472 dest = procShowStatus(dest, showStatus, isBeginSale);
463 -  
464 dest.cartInfo.limitProductCode = origin.limitProductCode; 473 dest.cartInfo.limitProductCode = origin.limitProductCode;
465 dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua); 474 dest.cartInfo.limitCodeUrl = getLimitCodeUrl(origin.limitProductCode, origin.erpProductId, ua);
466 dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure'); 475 dest.cartInfo.limitProductPay = helpers.url('/cart/index/orderEnsure');
@@ -7,7 +7,7 @@ @@ -7,7 +7,7 @@
7 7
8 module.exports = { 8 module.exports = {
9 domains: { 9 domains: {
10 - api: 'http://devapi.yoho.cn:58078' 10 + api: 'http://192.168.102.205:8080/gateway'
11 }, 11 },
12 loggers: { 12 loggers: {
13 infoFile: { 13 infoFile: {