...
|
...
|
@@ -5,6 +5,7 @@ |
|
|
*/
|
|
|
'use strict';
|
|
|
|
|
|
const _ = require('lodash');
|
|
|
const Promise = require('bluebird');
|
|
|
const api = global.yoho.API;
|
|
|
const crypto = global.yoho.crypto;
|
...
|
...
|
@@ -55,15 +56,15 @@ exports.getCouponData = (channel, params) => { |
|
|
});
|
|
|
} else if (val.template_name === 'getCoupon' && val.data.length) {
|
|
|
// 优惠券楼层
|
|
|
if (!coupon.data[index - 1].data || !coupon.data[index - 1].data.text) {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
const obj = {
|
|
|
title: coupon.data[index - 1].data.text, // 楼层标题
|
|
|
coupons: []
|
|
|
};
|
|
|
|
|
|
// 楼层标题
|
|
|
if (_.get(coupon, `data[${index - 1}].template_name`, '') === 'text') {
|
|
|
obj.title = _.get(coupon, `data[${index - 1}].data.text`, '');
|
|
|
}
|
|
|
|
|
|
val.data.forEach(function(item) {
|
|
|
obj.coupons.push({
|
|
|
id: crypto.encryption('yoho9646abcdefgh', item.couponID), // 加密优惠券号
|
...
|
...
|
|