...
|
...
|
@@ -17,7 +17,6 @@ const productProcess = require(`${utils}/product-process`); |
|
|
const _ = require('lodash');
|
|
|
const api = new API();
|
|
|
const serviceAPI = new ServiceAPI();
|
|
|
const aMinute = 60000;
|
|
|
const anHour = 3600000;
|
|
|
const aDay = anHour * 24;
|
|
|
|
...
|
...
|
@@ -72,34 +71,6 @@ const processTime = (time) => { |
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 折扣专场专题详情过期时间处理
|
|
|
* @param {[string]} time
|
|
|
* @return {[boject]}
|
|
|
*/
|
|
|
const processTimes = (time) => {
|
|
|
let data = {};
|
|
|
let type = '';
|
|
|
|
|
|
if (time > aDay) {
|
|
|
type = 'dhms';
|
|
|
} else {
|
|
|
if (time > anHour) {
|
|
|
type = 'hms';
|
|
|
} else {
|
|
|
if (time > aMinute) {
|
|
|
type = 'ms';
|
|
|
} else {
|
|
|
type = 's';
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
data.time = helpers.dateDiffFormat(timeFormat[type], time, 'ms');
|
|
|
|
|
|
return data;
|
|
|
};
|
|
|
|
|
|
/**
|
|
|
* 折扣专场列表数据处理
|
|
|
* @param {[array]} list
|
|
|
* @return {[array]}
|
...
|
...
|
@@ -119,8 +90,6 @@ const processSpecial = (list) => { |
|
|
if (flag === true) {
|
|
|
data.specialUrl = `/product/specialDetail?id=${data.id}`;
|
|
|
_.merge(data, processTime(data.leftTime));
|
|
|
} else {
|
|
|
_.merge(data, processTimes(data.leftTime));
|
|
|
}
|
|
|
|
|
|
formatData.push(data);
|
...
|
...
|
|