Authored by 周少峰

Merge branch 'hotfix/couponCenter' into 'release/5.6.1'

floor title

领券中心去除券楼层必须紧跟标题楼层限制

See merge request !118
... ... @@ -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), // 加密优惠券号
... ...
... ... @@ -2,33 +2,37 @@
{{> common/path-nav}}
{{> common/slide-banner}}
{{# categories}}
<div class="title clearfix">
<span>{{title}}</span>
</div>
{{# coupons}}
<div class="coupon">
<a href="{{url}}" target="_blank" href="javascript:void(0);" data-id="{{id}}">
<img src="{{image2 img}}">
{{#if empty}}
<div class="coupon-mask"></div>
{{/if}}
<div class="enable info" id="{{id}}">
<div class="normal">
<p>点击</p>
<p>领取</p>
</div>
<div class="got hidden">
<p>已领取</p>
<p class="guang">去使用</p>
</div>
<div class="empty hidden">
<p>已抢光</p>
<p class="guang">去逛逛</p>
</div>
</div>
</a>
{{#if title}}
<div class="title clearfix">
<span>{{title}}</span>
</div>
{{/ coupons}}
{{/if}}
<div class="clearfix">
{{# coupons}}
<div class="coupon">
<a href="{{url}}" target="_blank" href="javascript:void(0);" data-id="{{id}}">
<img src="{{image2 img}}">
{{#if empty}}
<div class="coupon-mask"></div>
{{/if}}
<div class="enable info" id="{{id}}">
<div class="normal">
<p>点击</p>
<p>领取</p>
</div>
<div class="got hidden">
<p>已领取</p>
<p class="guang">去使用</p>
</div>
<div class="empty hidden">
<p>已抢光</p>
<p class="guang">去逛逛</p>
</div>
</div>
</a>
</div>
{{/ coupons}}
</div>
{{/ categories}}
</div>
\ No newline at end of file
</div>
... ...