...
|
...
|
@@ -75,7 +75,7 @@ const processTime = (time) => { |
|
|
* @param {[array]} list
|
|
|
* @return {[array]}
|
|
|
*/
|
|
|
const processSpecial = (list) => {
|
|
|
const processDiscount = (list) => {
|
|
|
const formatData = [];
|
|
|
let flag = true;
|
|
|
|
...
|
...
|
@@ -88,7 +88,7 @@ const processSpecial = (list) => { |
|
|
|
|
|
_.forEach(list, (data) => {
|
|
|
if (flag === true) {
|
|
|
data.specialUrl = `/product/specialDetail?id=${data.id}`;
|
|
|
data.specialUrl = `/product/sale/discount/detail?id=${data.id}`;
|
|
|
_.merge(data, processTime(data.leftTime));
|
|
|
}
|
|
|
|
...
|
...
|
@@ -103,13 +103,13 @@ const processSpecial = (list) => { |
|
|
* @param {[object]} params
|
|
|
* @return {[array]}
|
|
|
*/
|
|
|
const special = (params) => {
|
|
|
const discount = (params) => {
|
|
|
params = params || {};
|
|
|
|
|
|
return api.get('', sign.apiSign(Object.assign({
|
|
|
method: 'app.activity.get',
|
|
|
sort: 2,
|
|
|
plateform: 3
|
|
|
plateform: 2
|
|
|
}, params)));
|
|
|
};
|
|
|
|
...
|
...
|
@@ -307,13 +307,13 @@ exports.getBreakCodeData = (params) => { |
|
|
* @param {[object]} params
|
|
|
* @return {[object]}
|
|
|
*/
|
|
|
exports.getSpecialData = (params) => {
|
|
|
const specialData = {};
|
|
|
exports.getDiscountData = (params) => {
|
|
|
const discountData = {};
|
|
|
|
|
|
return special(params).then((result) => {
|
|
|
return discount(params).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
specialData.data = processSpecial(result.data);
|
|
|
return specialData;
|
|
|
discountData.data = processDiscount(result.data);
|
|
|
return discountData;
|
|
|
} else {
|
|
|
logger.error('折扣专场专题列表返回 code 不是 200');
|
|
|
return {};
|
...
|
...
|
@@ -327,16 +327,16 @@ exports.getSpecialData = (params) => { |
|
|
* @param {[string]} id
|
|
|
* @return {[object]}
|
|
|
*/
|
|
|
exports.getSpecialDetailData = (id) => {
|
|
|
exports.getDiscountDetailData = (id) => {
|
|
|
let res = {};
|
|
|
let param = {
|
|
|
id: id
|
|
|
};
|
|
|
|
|
|
return special(param).then((result) => {
|
|
|
return discount(param).then((result) => {
|
|
|
if (result && result.code === 200) {
|
|
|
res = processSpecial(result.data);
|
|
|
console.log(res);
|
|
|
res = processDiscount(result.data);
|
|
|
|
|
|
return {
|
|
|
title: res[0].title,
|
|
|
activity: {
|
...
|
...
|
|