Authored by 郭成尧

'左侧分类选中处理'

... ... @@ -10,7 +10,7 @@ const library = '../../../library';
const helpers = require(`${library}/helpers`);
const _ = require('lodash');
const aMinute = 60000;
// const aMinute = 60000;
const anHour = 3600000;
const aDay = anHour * 24;
const timeFormat = {
... ... @@ -52,28 +52,28 @@ 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.time;
};
// 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.time;
// };
/**
* 折扣文本切割
... ... @@ -589,8 +589,10 @@ exports.handleDiscountTitleData = (origin) => {
dest.title = origin.title;
dest.up = true;
dest.discount = origin.promotion_name;
dest.time = processTimes(origin.left_time);
// dest.time = processTimes(origin.left_time);
dest.time = origin.left_time;
Object.assign(dest, discountSplit(origin.promotion_name));
return dest;
};
... ...