...
|
...
|
@@ -96,14 +96,27 @@ const getActivityDetail = (id) => { |
|
|
const convertActicityData = (data) => {
|
|
|
const formatData = [];
|
|
|
|
|
|
let discountArr = [],
|
|
|
discountNum = 0,
|
|
|
discountText = 0;
|
|
|
data = data || [];
|
|
|
_.forEach(data, (item) => {
|
|
|
discountArr = item.promotionName.split('~');
|
|
|
if (discountArr.length === 1) {
|
|
|
discountNum = discountArr[0].replace(/[^0-9]/g,"");
|
|
|
discountText = discountArr[0].replace(/[0-9]/g,"");
|
|
|
}else {
|
|
|
discountNum = discountArr[0] + '~' +discountArr[1].replace(/[^0-9]/g,"");
|
|
|
discountText = discountArr[1].replace(/[0-9]/g,"");
|
|
|
}
|
|
|
|
|
|
formatData.push({
|
|
|
activityUrl: '/product/outlet/activity?id=' + item.id,
|
|
|
coverUrl: item.coverUrl,
|
|
|
logoUrl: item.logoUrl,
|
|
|
title: item.title,
|
|
|
promotionName: item.promotionName,
|
|
|
discountNum: discountNum,
|
|
|
discountText: discountText,
|
|
|
leftTime: item.startLeftTime > 0 ? item.startLeftTime : item.endLeftTime,
|
|
|
hide: false
|
|
|
});
|
...
|
...
|
|