...
|
...
|
@@ -7,6 +7,7 @@ const helpers = global.yoho.helpers; |
|
|
|
|
|
const couponData = (params) => {
|
|
|
return api.get('', params).then(result => {
|
|
|
|
|
|
if (result && result.data && result.data.couponList) {
|
|
|
let times = moment().valueOf() / 1000;
|
|
|
let expireTime = 3600 * 24 * 3; //即将过期时间3天
|
...
|
...
|
@@ -14,6 +15,12 @@ const couponData = (params) => { |
|
|
let status1 = params.status === 1;
|
|
|
|
|
|
return result.data.couponList.map(function(elem) {
|
|
|
delete elem.id;
|
|
|
|
|
|
elem.isNoLimit = elem.isNoLimit === 'true';// 全场通用
|
|
|
elem.isDiscount = (`,${elem.shopPriceLimits},`).indexOf(',1,') !== -1;// 三折以下
|
|
|
elem.isLimited = (`,${elem.shopPriceLimits},`).indexOf(',2,') !== -1;// 限量
|
|
|
|
|
|
if (status0) {
|
|
|
elem.isSoonExpire = (elem.endTime - times) < expireTime;
|
|
|
elem.bestowLink = helpers.urlFormat('/product/index/index',
|
...
|
...
|
@@ -28,9 +35,9 @@ const couponData = (params) => { |
|
|
}
|
|
|
return elem;
|
|
|
});
|
|
|
} else {
|
|
|
return [];
|
|
|
}
|
|
|
|
|
|
return [];
|
|
|
});
|
|
|
};
|
|
|
|
...
|
...
|
|