...
|
...
|
@@ -12,6 +12,7 @@ const _ = require('lodash'); |
|
|
const Fn = require('lodash/fp');
|
|
|
const url = require('url');
|
|
|
const helpers = global.yoho.helpers;
|
|
|
const crypto = global.yoho.crypto;
|
|
|
|
|
|
const productAPI = require('./detail-product-api');
|
|
|
const detailHelper = require('./detail-helper');
|
...
|
...
|
@@ -1033,9 +1034,11 @@ const _getCoupon = (coupons) => { |
|
|
}
|
|
|
|
|
|
let couponList = _.get(coupons, 'data', []);
|
|
|
let getProp = Fn.map(Fn.pick(['couponName', 'amount', 'couponId']));
|
|
|
|
|
|
return getProp(couponList);
|
|
|
let pickProp = Fn.pick(['couponName', 'amount', 'couponId', 'acquireStatus']);
|
|
|
let encodeId = Fn.update('couponId', (cid) => crypto.encryption(null, cid + ''));
|
|
|
|
|
|
return Fn.map(Fn.pipe(pickProp, encodeId))(couponList);
|
|
|
};
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -1100,7 +1103,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { |
|
|
let additionalData = requestData.addition;
|
|
|
let favoriteData = requestData.fav;
|
|
|
let promotionData = requestData.promotion;
|
|
|
let coupoon = requestData.coupon;
|
|
|
let coupon = requestData.coupon;
|
|
|
let limitedInfo = requestData.limited;
|
|
|
let domainBrand = requestData.brand;
|
|
|
|
...
|
...
|
@@ -1137,7 +1140,7 @@ const _detailDataPkg = (origin, uid, vipLevel, cookies) => { |
|
|
}
|
|
|
|
|
|
// 优惠券
|
|
|
result.coupon = _getCoupon(coupoon);
|
|
|
result.coupon = _getCoupon(coupon);
|
|
|
|
|
|
// 有货币
|
|
|
if (!_.includes(['', '0'], propOrigin('yohoCoinNum'))) {
|
...
|
...
|
|